From 7f119ba4a5ccb98862b222e483bf68caae592e17 Mon Sep 17 00:00:00 2001 From: developer Date: Tue, 26 Aug 2025 15:06:27 +0700 Subject: [PATCH] first commit --- .gitignore | 45 ++ .metadata | 45 ++ README.md | 16 + analysis_options.yaml | 28 ++ android/.gitignore | 13 + android/app/build.gradle | 47 ++ android/app/google-services.json | 29 ++ android/app/src/debug/AndroidManifest.xml | 7 + android/app/src/main/AndroidManifest.xml | 47 ++ .../com/example/antispy/MainActivity.kt | 5 + .../res/drawable-v21/launch_background.xml | 12 + .../main/res/drawable/launch_background.xml | 12 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 + android/app/src/main/res/values/styles.xml | 18 + android/app/src/profile/AndroidManifest.xml | 7 + android/build.gradle | 18 + android/gradle.properties | 3 + .../gradle/wrapper/gradle-wrapper.properties | 5 + android/settings.gradle | 28 ++ assets/images/logo.png | Bin 0 -> 18105 bytes firebase.json | 1 + lib/app.dart | 17 + lib/firebase_options.dart | 62 +++ lib/main.dart | 12 + lib/routes/app_routes.dart | 31 ++ lib/screens/auth/login_page.dart | 170 +++++++ lib/screens/auth/register_page.dart | 17 + lib/screens/history/history_page.dart | 206 ++++++++ lib/screens/live_stream/live_camera_page.dart | 398 +++++++++++++++ lib/screens/main_screen.dart | 107 ++++ .../notifications/notifications_page.dart | 88 ++++ lib/screens/settings/settings_page.dart | 203 ++++++++ lib/screens/splash_screen.dart | 101 ++++ lib/services/auth_service.dart | 23 + lib/widgets/costum_header.dart | 41 ++ pubspec.lock | 458 ++++++++++++++++++ pubspec.yaml | 99 ++++ 42 files changed, 2437 insertions(+) create mode 100644 .gitignore create mode 100644 .metadata create mode 100644 README.md create mode 100644 analysis_options.yaml create mode 100644 android/.gitignore create mode 100644 android/app/build.gradle create mode 100644 android/app/google-services.json create mode 100644 android/app/src/debug/AndroidManifest.xml create mode 100644 android/app/src/main/AndroidManifest.xml create mode 100644 android/app/src/main/kotlin/com/example/antispy/MainActivity.kt create mode 100644 android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 android/app/src/main/res/drawable/launch_background.xml create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/values-night/styles.xml create mode 100644 android/app/src/main/res/values/styles.xml create mode 100644 android/app/src/profile/AndroidManifest.xml create mode 100644 android/build.gradle create mode 100644 android/gradle.properties create mode 100644 android/gradle/wrapper/gradle-wrapper.properties create mode 100644 android/settings.gradle create mode 100644 assets/images/logo.png create mode 100644 firebase.json create mode 100644 lib/app.dart create mode 100644 lib/firebase_options.dart create mode 100644 lib/main.dart create mode 100644 lib/routes/app_routes.dart create mode 100644 lib/screens/auth/login_page.dart create mode 100644 lib/screens/auth/register_page.dart create mode 100644 lib/screens/history/history_page.dart create mode 100644 lib/screens/live_stream/live_camera_page.dart create mode 100644 lib/screens/main_screen.dart create mode 100644 lib/screens/notifications/notifications_page.dart create mode 100644 lib/screens/settings/settings_page.dart create mode 100644 lib/screens/splash_screen.dart create mode 100644 lib/services/auth_service.dart create mode 100644 lib/widgets/costum_header.dart create mode 100644 pubspec.lock create mode 100644 pubspec.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79c113f --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..5b39692 --- /dev/null +++ b/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "d8a9f9a52e5af486f80d932e838ee93861ffd863" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + - platform: android + create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + - platform: ios + create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + - platform: linux + create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + - platform: macos + create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + - platform: web + create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + - platform: windows + create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/README.md b/README.md new file mode 100644 index 0000000..d7322f5 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# antispy + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..0d29021 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..55afd91 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..24a539a --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,47 @@ +plugins { + id "com.android.application" + // START: FlutterFire Configuration + id 'com.google.gms.google-services' + // END: FlutterFire Configuration + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + +android { + namespace = "com.example.antispy" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.antispy" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = 23 + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.debug + } + } +} + +flutter { + source = "../.." +} diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..b4b9d63 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "543959947783", + "project_id": "antispy-5f8a4", + "storage_bucket": "antispy-5f8a4.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:543959947783:android:7be5fc39b1b8474732a8a2", + "android_client_info": { + "package_name": "com.example.antispy" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCBrqkGjkELRWQ8zBozTeM87jSEhGSZOYA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b5db57c --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/example/antispy/MainActivity.kt b/android/app/src/main/kotlin/com/example/antispy/MainActivity.kt new file mode 100644 index 0000000..a59e120 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/antispy/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.antispy + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..d2ffbff --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = "../build" +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..2597170 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..7bb2df6 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..9759a22 --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,28 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.1.0" apply false + // START: FlutterFire Configuration + id "com.google.gms.google-services" version "4.3.15" apply false + // END: FlutterFire Configuration + id "org.jetbrains.kotlin.android" version "1.8.22" apply false +} + +include ":app" diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..19113a21608d1fa94fe60fec85b8e4d308276cf6 GIT binary patch literal 18105 zcmV(|K+(U6P)G@WJ<h@BQEZy{-ayp}bH!6b8@ZBBktl|BNvS&*SpE5RBynU}>RUW%Rep z9?t`z;qU`mNEqUUzQ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B}7^qyX+2~X*TQK6%ZK^9RBviDZ?89ZEDJ)c4!5yt#u1uK%>QlXK z@3!xiyl(Qh-#Z~&thUw;ow5S1gixsSz*Q routes = { + '/': (context) => const SplashScreen(), + '/login': (context) => const LoginPage(), + '/register': (context) => const RegisterPage(), + + // Pembungkus Bottom Navigation + '/main': (context) => const MainScreen(), + + // Rute internal (dipakai oleh MainScreen untuk switch halaman) + '/history': (context) => const HistoryPage(), + '/control': (context) => const SettingsPage(), + '/notifications': (context) => const NotificationsPage(), + '/camera': (context) => const LiveCameraPage(), + }; +} diff --git a/lib/screens/auth/login_page.dart b/lib/screens/auth/login_page.dart new file mode 100644 index 0000000..d4c8f86 --- /dev/null +++ b/lib/screens/auth/login_page.dart @@ -0,0 +1,170 @@ +import 'package:flutter/material.dart'; +import '../../services/auth_service.dart'; + +class LoginPage extends StatefulWidget { + const LoginPage({super.key}); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + final TextEditingController _emailController = TextEditingController(); + final TextEditingController _passwordController = TextEditingController(); + final AuthService _authService = AuthService(); + + bool _isLoading = false; + String? _errorMessage; + + Future _handleLogin() async { + setState(() { + _isLoading = true; + _errorMessage = null; + }); + + try { + final user = await _authService.login( + _emailController.text.trim(), + _passwordController.text.trim(), + ); + if (user != null) { + Navigator.pushReplacementNamed(context, '/main'); + } + } catch (e) { + setState(() { + _errorMessage = e.toString().replaceAll('Exception:', '').trim(); + }); + } finally { + setState(() => _isLoading = false); + } + } + + @override + Widget build(BuildContext context) { + final screenWidth = MediaQuery.of(context).size.width; + + return Scaffold( + backgroundColor: Colors.white, + body: Stack( + children: [ + // Background ungu di atas + Container( + height: MediaQuery.of(context).size.height * 0.20, + decoration: const BoxDecoration( + color: Color(0xFF6B4EFF), + ), + ), + + SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 32), + child: Column( + children: [ + const SizedBox(height: 80), + + // Kartu besar logo + teks horizontal + Container( + width: screenWidth * 0.8, + padding: const EdgeInsets.symmetric( + vertical: 60, + horizontal: 32, + ), + decoration: BoxDecoration( + color: const Color(0xFF8B70FF), + borderRadius: BorderRadius.circular(30), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.15), + blurRadius: 15, + offset: const Offset(0, 10), + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/logo.png', + height: 40, + width: 40, + ), + const SizedBox(width: 12), + const Text( + 'AntiSpy', + style: TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ], + ), + ), + + const SizedBox(height: 48), + + // Email + TextField( + controller: _emailController, + decoration: const InputDecoration( + hintText: 'Email', + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Colors.black), + ), + ), + ), + const SizedBox(height: 16), + + // Password + TextField( + controller: _passwordController, + obscureText: true, + decoration: const InputDecoration( + hintText: 'Password', + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Colors.black), + ), + ), + ), + const SizedBox(height: 24), + + // Error + if (_errorMessage != null) + Text( + _errorMessage!, + style: const TextStyle(color: Colors.red), + ), + + const SizedBox(height: 16), + + // Tombol Login + ElevatedButton( + onPressed: _isLoading ? null : _handleLogin, + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF6B4EFF), + padding: const EdgeInsets.symmetric( + horizontal: 40, vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + child: _isLoading + ? const SizedBox( + height: 20, + width: 20, + child: CircularProgressIndicator( + color: Colors.white, + strokeWidth: 2, + ), + ) + : const Text('Login', + style: TextStyle(color: Colors.white)), + ), + const SizedBox(height: 40), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/auth/register_page.dart b/lib/screens/auth/register_page.dart new file mode 100644 index 0000000..0ef21e2 --- /dev/null +++ b/lib/screens/auth/register_page.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; + +class RegisterPage extends StatelessWidget { + const RegisterPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Login'), + ), + body: const Center( + child: Text('Ini halaman Login'), + ), + ); + } +} diff --git a/lib/screens/history/history_page.dart b/lib/screens/history/history_page.dart new file mode 100644 index 0000000..d918261 --- /dev/null +++ b/lib/screens/history/history_page.dart @@ -0,0 +1,206 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import '../../widgets/costum_header.dart'; + +class HistoryPage extends StatefulWidget { + const HistoryPage({super.key}); + + @override + State createState() => _HistoryPageState(); +} + +class _HistoryPageState extends State { + DateTime? selectedDate; + + Stream getCaptureStream() { + final ref = FirebaseFirestore.instance.collection('captures'); + if (selectedDate != null) { + final start = DateTime( + selectedDate!.year, + selectedDate!.month, + selectedDate!.day, + ); + final end = start.add(const Duration(days: 1)); + return ref + .where('timestamp', isGreaterThanOrEqualTo: Timestamp.fromDate(start)) + .where('timestamp', isLessThan: Timestamp.fromDate(end)) + .orderBy('timestamp', descending: true) + .snapshots(); + } else { + return ref.orderBy('timestamp', descending: true).snapshots(); + } + } + + Future _pickDate() async { + final DateTime? date = await showDatePicker( + context: context, + initialDate: selectedDate ?? DateTime.now(), + firstDate: DateTime(2024), + lastDate: DateTime.now(), + ); + if (date != null) { + setState(() { + selectedDate = date; + }); + } + } + + @override + Widget build(BuildContext context) { + const primaryColor = Color(0xFF5F59A6); + + return Scaffold( + appBar: const CustomAppBar(title: 'Riwayat Deteksi'), + body: Column( + children: [ + // Filter tanggal + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + child: Row( + children: [ + Expanded( + child: ElevatedButton.icon( + onPressed: _pickDate, + icon: const Icon(Icons.date_range, color: Colors.white), + label: Text( + selectedDate != null + ? DateFormat('dd MMM yyyy').format(selectedDate!) + : 'Pilih Tanggal', + ), + style: ElevatedButton.styleFrom( + backgroundColor: primaryColor, + foregroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + if (selectedDate != null) + IconButton( + icon: const Icon(Icons.close, color: primaryColor), + onPressed: () { + setState(() { + selectedDate = null; + }); + }, + ), + ], + ), + ), + + // StreamBuilder ambil data dari Firestore + Expanded( + child: StreamBuilder( + stream: getCaptureStream(), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + if (!snapshot.hasData || snapshot.data!.docs.isEmpty) { + return const Center(child: Text("Belum ada riwayat deteksi.")); + } + + final items = snapshot.data!.docs; + + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: GridView.builder( + itemCount: items.length, + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 12, + mainAxisSpacing: 12, + childAspectRatio: 0.84, // proporsi ideal + ), + itemBuilder: (context, index) { + final data = items[index].data() as Map; + final imageUrl = data['imageUrl'] ?? ''; + final timestamp = (data['timestamp'] as Timestamp).toDate(); + final timeText = DateFormat('yyyy-MM-dd • HH:mm').format(timestamp); + + return GestureDetector( + onTap: () { + showDialog( + context: context, + builder: (_) => Dialog( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: ClipRRect( + borderRadius: BorderRadius.circular(16), + child: Image.network(imageUrl, fit: BoxFit.contain), + ), + ), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20), + boxShadow: const [ + BoxShadow( + color: Colors.black12, + blurRadius: 6, + offset: Offset(0, 4), + ) + ], + border: Border.all(color: primaryColor.withOpacity(0.1)), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: const BorderRadius.vertical(top: Radius.circular(20)), + child: AspectRatio( + aspectRatio: 1.2, + child: Image.network( + imageUrl, + width: double.infinity, + fit: BoxFit.cover, + loadingBuilder: (context, child, loadingProgress) { + if (loadingProgress == null) return child; + return Container( + color: Colors.black12, + child: const Center(child: CircularProgressIndicator()), + ); + }, + errorBuilder: (context, error, stackTrace) => Container( + color: Colors.black12, + child: const Icon(Icons.broken_image, size: 40, color: Colors.grey), + ), + ), + ), + ), + const SizedBox(height: 8), + const Icon(Icons.visibility, size: 22, color: primaryColor), + const SizedBox(height: 4), + Padding( + padding: const EdgeInsets.only(bottom: 2), // jarak ke bawah lebih sempit + child: Text( + timeText, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: primaryColor, + ), + ), + ), + ], +), + + ), + ); + }, + ), +); + + + }, + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/live_stream/live_camera_page.dart b/lib/screens/live_stream/live_camera_page.dart new file mode 100644 index 0000000..049db93 --- /dev/null +++ b/lib/screens/live_stream/live_camera_page.dart @@ -0,0 +1,398 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:flutter_mjpeg/flutter_mjpeg.dart'; +import 'package:http/http.dart' as http; +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:firebase_database/firebase_database.dart'; +import '../../widgets/costum_header.dart'; + +class LiveCameraPage extends StatefulWidget { + const LiveCameraPage({super.key}); + + @override + State createState() => _LiveCameraPageState(); +} + +class _LiveCameraPageState extends State { + String? _ipAddress; + bool _isStreamLoading = true; + bool _hasStreamError = false; + bool _isMotionSensorActive = false; + bool _hasCapturedRecently = false; + bool _isCapturingManually = false; + + @override + void initState() { + super.initState(); + _fetchIpAddress(); + _listenToMotionSensor(); + } + + void _listenToMotionSensor() { + final statusRef = FirebaseDatabase.instance.ref('sensorPIR/status'); + + statusRef.onValue.listen((event) async { + final status = event.snapshot.value; + + print("📥 Status PIR: $status"); + + if (status == 1 || status == '1' || status == true) { + setState(() => _isMotionSensorActive = true); + + if (!_hasCapturedRecently && _ipAddress != null) { + print("📸 Mulai capture otomatis..."); + _hasCapturedRecently = true; + await _captureAndUploadImage(); + + Future.delayed(const Duration(seconds: 10), () { + _hasCapturedRecently = false; + print("🔁 Reset capture flag."); + }); + } else { + print("⚠️ Sudah capture, tunggu delay."); + } + } else { + setState(() => _isMotionSensorActive = false); + } + }); + } + + Future _fetchIpAddress() async { + final ref = FirebaseDatabase.instance.ref('esp32cam/ip'); + final snapshot = await ref.get(); + if (snapshot.exists) { + setState(() { + _ipAddress = snapshot.value.toString(); + }); + print("📡 IP ESP32 ditemukan: $_ipAddress"); + } else { + setState(() => _ipAddress = null); + print("❌ IP ESP32 tidak ditemukan."); + } + } + + Future _captureAndUploadImage() async { + if (_ipAddress == null) return; + + final captureUrl = 'http://$_ipAddress/capture'; + const cloudinaryUrl = 'https://api.cloudinary.com/v1_1/dd2elgipw/image/upload'; + const uploadPreset = 'cam_upload'; + + try { + print("📷 Mengambil gambar dari $_ipAddress..."); + + // Coba capture maksimal 2 kali + http.Response? response; + for (int attempt = 1; attempt <= 2; attempt++) { + try { + response = await http + .get(Uri.parse(captureUrl)) + .timeout(const Duration(seconds: 10)); + if (response.statusCode == 200 && response.bodyBytes.isNotEmpty) { + print("✅ Capture berhasil pada attempt ke-$attempt"); + break; + } else { + print("⚠️ Capture gagal (status: ${response.statusCode}), mencoba ulang..."); + } + } catch (e) { + print("⚠️ Error saat capture ke-$attempt: $e"); + if (attempt == 2) rethrow; + await Future.delayed(const Duration(seconds: 2)); + } + } + + if (response == null || response.bodyBytes.isEmpty) { + throw Exception('Gambar kosong atau tidak valid'); + } + + // Upload ke Cloudinary + final uploadRequest = http.MultipartRequest('POST', Uri.parse(cloudinaryUrl)); + uploadRequest.fields['upload_preset'] = uploadPreset; + uploadRequest.files.add( + http.MultipartFile.fromBytes('file', response.bodyBytes, filename: 'snapshot.jpg'), + ); + + print("☁️ Upload ke Cloudinary..."); + final uploadResponse = await uploadRequest.send(); + final result = await http.Response.fromStream(uploadResponse); + + if (uploadResponse.statusCode != 200) throw Exception('Upload gagal'); + + final data = jsonDecode(result.body); + final imageUrl = data['secure_url']; + + // Simpan gambar dan log ke Firestore + await FirebaseFirestore.instance.collection('captures').add({ + 'imageUrl': imageUrl, + 'timestamp': Timestamp.now(), + }); + + await FirebaseFirestore.instance.collection('History').add({ + 'motion': 'Mencurigakan', + 'timestamp': DateTime.now().toIso8601String(), + }); + + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('✅ Gambar berhasil diunggah')), + ); + } + } catch (e) { + print("❌ Error saat capture: $e"); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('❌ Terjadi kesalahan saat capture: $e')), + ); + } + } + } + + @override + Widget build(BuildContext context) { + const primaryColor = Color(0xFF5F59A6); + + return Scaffold( + appBar: const CustomAppBar(title: 'AntiSpy Cam'), + body: _ipAddress == null + ? const Center(child: CircularProgressIndicator()) + : ListView( + padding: const EdgeInsets.all(16), + children: [ + _buildStreamSection(primaryColor), + const SizedBox(height: 20), + _buildMotionSensorSection(primaryColor), + _buildDetectionHistorySection(primaryColor), + ], + ), + ); + } + + Widget _buildStreamSection(Color primaryColor) { + final streamUrl = 'http://$_ipAddress/stream'; + + return Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text( + 'Live Camera Feed', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.black87), + ), + const SizedBox(height: 12), + ClipRRect( + borderRadius: BorderRadius.circular(16), + child: Container( + height: 200, + color: Colors.black, + child: Stack( + children: [ + Mjpeg( + stream: streamUrl, + isLive: true, + fit: BoxFit.cover, + loading: (context) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (_isStreamLoading) { + setState(() => _isStreamLoading = false); + } + }); + return const Center(child: CircularProgressIndicator(color: Colors.white)); + }, + error: (context, error, stack) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (!_hasStreamError) { + setState(() { + _hasStreamError = true; + _isStreamLoading = false; + }); + } + }); + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(Icons.error_outline, color: Colors.red, size: 48), + const SizedBox(height: 8), + Text('Gagal memuat stream', style: TextStyle(color: Colors.red[300])), + Text('Periksa koneksi kamera', style: TextStyle(color: Colors.red[300])), + ], + ), + ); + }, + ), + if (_isStreamLoading) + const Center(child: CircularProgressIndicator(color: Colors.white)), + ], + ), + ), + ), + const SizedBox(height: 16), + ElevatedButton.icon( + onPressed: _isCapturingManually + ? null + : () async { + if (_ipAddress == null) return; + setState(() => _isCapturingManually = true); + await _captureAndUploadImage(); + if (mounted) setState(() => _isCapturingManually = false); + }, + icon: const Icon(Icons.camera_alt), + label: Text(_isCapturingManually ? 'Mengambil...' : 'Ambil Gambar'), + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: primaryColor, + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + ), + ), + ], + ); + } + + Widget _buildMotionSensorSection(Color primaryColor) { + return _SensorStatusCard( + icon: Icons.motion_photos_on, + label: 'Sensor Gerak', + value: _isMotionSensorActive ? "Mencurigakan" : "Aktivitas Normal", + active: _isMotionSensorActive, + primaryColor: primaryColor, + ); + } + + Widget _buildDetectionHistorySection(Color primaryColor) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 16), + const Text( + 'Riwayat Deteksi', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.black87), + ), + const SizedBox(height: 12), + SizedBox( + height: 250, + child: StreamBuilder( + stream: FirebaseFirestore.instance + .collection('History') + .orderBy('timestamp', descending: true) + .snapshots(), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + + if (snapshot.hasError) { + return const Text('Gagal memuat data riwayat.'); + } + + if (!snapshot.hasData || snapshot.data!.docs.isEmpty) { + return const Padding( + padding: EdgeInsets.all(8.0), + child: Text('Tidak ada riwayat deteksi', style: TextStyle(color: Colors.grey)), + ); + } + + final logs = snapshot.data!.docs.map((doc) { + final data = doc.data() as Map; + final motionType = data['motion'] ?? 'Tidak diketahui'; + final timestampStr = data['timestamp'] ?? ''; + String formattedTime = 'Tidak diketahui'; + + try { + final dt = DateTime.parse(timestampStr); + formattedTime = TimeOfDay.fromDateTime(dt).format(context); + } catch (_) {} + + return DetectionLog( + time: formattedTime, + type: motionType, + ); + }).toList(); + + return ListView.builder( + itemCount: logs.length, + itemBuilder: (context, index) => + _buildDetectionLogItem(logs[index], primaryColor), + ); + }, + ), + ), + ], + ); + } + + Widget _buildDetectionLogItem(DetectionLog log, Color primaryColor) { + return Card( + elevation: 2, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + margin: const EdgeInsets.only(bottom: 12), + child: ListTile( + leading: Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: primaryColor.withOpacity(0.1), + shape: BoxShape.circle, + ), + child: Icon(Icons.notifications_active, color: primaryColor), + ), + title: Text(log.type, style: const TextStyle(fontWeight: FontWeight.w500)), + subtitle: Text("Waktu: ${log.time}"), + trailing: Icon(Icons.chevron_right, color: primaryColor), + ), + ); + } +} + +class DetectionLog { + final String time; + final String type; + + DetectionLog({required this.time, required this.type}); +} + +class _SensorStatusCard extends StatelessWidget { + final IconData icon; + final String label; + final String value; + final bool active; + final Color primaryColor; + + const _SensorStatusCard({ + required this.icon, + required this.label, + required this.value, + required this.active, + required this.primaryColor, + }); + + @override + Widget build(BuildContext context) { + return AnimatedContainer( + duration: const Duration(milliseconds: 300), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: active ? primaryColor.withOpacity(0.2) : primaryColor.withOpacity(0.1), + borderRadius: BorderRadius.circular(16), + border: Border.all( + color: active ? primaryColor : primaryColor.withOpacity(0.7), + width: 1.5, + ), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(icon, size: 36, color: active ? primaryColor : primaryColor.withOpacity(0.8)), + const SizedBox(height: 8), + Text(label, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold)), + const SizedBox(height: 4), + Text( + value, + style: TextStyle( + fontSize: 13, + color: active ? primaryColor : Colors.black54, + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/main_screen.dart b/lib/screens/main_screen.dart new file mode 100644 index 0000000..e877697 --- /dev/null +++ b/lib/screens/main_screen.dart @@ -0,0 +1,107 @@ +import 'package:antispy/screens/history/history_page.dart'; +import 'package:antispy/screens/live_stream/live_camera_page.dart'; +import 'package:antispy/screens/settings/settings_page.dart'; +import 'package:flutter/material.dart'; + +class MainScreen extends StatefulWidget { + const MainScreen({super.key}); + + @override + State createState() => _MainScreenState(); +} + +class _MainScreenState extends State { + int _currentIndex = 1; // camera FAB default di tengah + + final List _screens = const [ + HistoryPage(), + LiveCameraPage(), + SettingsPage(), + ]; + + void _onTap(int index) { + setState(() => _currentIndex = index); + } + + void _onMiddleTap() { + _onTap(1); // live camera + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.grey[100], + extendBody: true, + resizeToAvoidBottomInset: false, + body: _screens[_currentIndex], + floatingActionButton: FloatingActionButton( + onPressed: _onMiddleTap, + backgroundColor: const Color(0xFF5F59A6), + elevation: 8, + shape: const CircleBorder(), + child: Icon( + _currentIndex == 1 ? Icons.camera_alt : Icons.camera_alt_outlined, + size: 30, + color: Colors.white, + ), + ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + bottomNavigationBar: BottomAppBar( + shape: const CircularNotchedRectangle(), + notchMargin: 10, + elevation: 10, + color: const Color(0xFF5F59A6), // UNGU gelap + child: SizedBox( + height: 70, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _buildNavItem( + Icons.history_outlined, + Icons.history, + "History", + 0, + ), // Spacer tengah untuk FAB + const SizedBox(width: 48), + + _buildNavItem( + Icons.settings_outlined, + Icons.settings, + "Settings", + 2, + ), + ], + ), + ), + ), + ); + } + + Widget _buildNavItem( + IconData icon, IconData activeIcon, String label, int index) { + final isSelected = _currentIndex == index; + + return GestureDetector( + onTap: () => _onTap(index), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + isSelected ? activeIcon : icon, + color: isSelected ? Colors.white : Colors.white60, + ), + const SizedBox(height: 4), + Text( + label, + style: TextStyle( + fontSize: 12, + color: isSelected ? Colors.white : Colors.white60, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/notifications/notifications_page.dart b/lib/screens/notifications/notifications_page.dart new file mode 100644 index 0000000..df7d3ba --- /dev/null +++ b/lib/screens/notifications/notifications_page.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:intl/intl.dart'; +import '../../widgets/costum_header.dart'; + +class NotificationsPage extends StatelessWidget { + const NotificationsPage({super.key}); + + Stream getNotifications() { + return FirebaseFirestore.instance + .collection('notifications') + .orderBy('timestamp', descending: true) + .snapshots(); + } + + Icon _getIcon(String type) { + switch (type) { + case 'gerak': + return const Icon(Icons.directions_run, color: Colors.redAccent); + case 'jarak': + return const Icon(Icons.sensors, color: Colors.orange); + case 'kamera': + return const Icon(Icons.camera_alt, color: Colors.blueAccent); + default: + return const Icon(Icons.notification_important, color: Colors.grey); + } + } + + @override + Widget build(BuildContext context) { + // const primaryColor = Color(0xFF5F59A6); + + return Scaffold( + appBar: const CustomAppBar(title: 'Notifikasi'), + body: StreamBuilder( + stream: getNotifications(), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + + if (!snapshot.hasData || snapshot.data!.docs.isEmpty) { + return const Center(child: Text("Belum ada notifikasi.")); + } + + final items = snapshot.data!.docs; + + return ListView.separated( + padding: const EdgeInsets.all(16), + separatorBuilder: (context, index) => const SizedBox(height: 12), + itemCount: items.length, + itemBuilder: (context, index) { + final data = items[index].data() as Map; + final type = data['type'] ?? 'lainnya'; + final message = data['message'] ?? 'Tidak ada pesan'; + final timestamp = (data['timestamp'] as Timestamp).toDate(); + final timeText = + DateFormat('dd MMM yyyy • HH:mm').format(timestamp); + + return Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + boxShadow: const [ + BoxShadow( + color: Colors.black12, + blurRadius: 4, + offset: Offset(0, 2)) + ], + ), + child: ListTile( + leading: _getIcon(type), + title: Text( + message, + style: const TextStyle(fontWeight: FontWeight.w600), + ), + subtitle: Text(timeText), + contentPadding: + const EdgeInsets.symmetric(vertical: 8, horizontal: 16), + ), + ); + }, + ); + }, + ), + ); + } +} diff --git a/lib/screens/settings/settings_page.dart b/lib/screens/settings/settings_page.dart new file mode 100644 index 0000000..ce583a1 --- /dev/null +++ b/lib/screens/settings/settings_page.dart @@ -0,0 +1,203 @@ +import 'package:flutter/material.dart'; +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:firebase_database/firebase_database.dart'; +import '../../widgets/costum_header.dart'; + +class SettingsPage extends StatefulWidget { + const SettingsPage({super.key}); + + @override + State createState() => _SettingsPageState(); +} + +class _SettingsPageState extends State { + final DatabaseReference _dbRef = FirebaseDatabase.instance.ref('control'); + + bool _isDeviceOn = false; + String _mode = 'otomatis'; + + @override + void initState() { + super.initState(); + _listenToStatus(); + } + + void _listenToStatus() { + _dbRef.child('status').onValue.listen((event) { + final value = event.snapshot.value; + if (value is bool) { + setState(() { + _isDeviceOn = value; + }); + } + }); + + _dbRef.child('mode').onValue.listen((event) { + final value = event.snapshot.value; + if (value is String) { + setState(() { + _mode = value; + }); + } + }); + } + + void _toggleDevice(bool value) { + _dbRef.child('status').set(value); + } + + void _changeMode(String newMode) { + _dbRef.child('mode').set(newMode); + } + + void _logout() async { + await FirebaseAuth.instance.signOut(); + if (mounted) { + Navigator.of(context).pushReplacementNamed('/login'); + } + } + + @override + Widget build(BuildContext context) { + const primaryColor = Color(0xFF5F59A6); + + return Scaffold( + appBar: const CustomAppBar(title: 'Pengaturan'), + body: SingleChildScrollView( + padding: const EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Column( + children: [ + const Icon(Icons.settings, size: 64, color: primaryColor), + const SizedBox(height: 10), + Text( + 'Pengaturan Perangkat', + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + color: primaryColor, + ), + ), + ], + ), + const SizedBox(height: 30), + _buildControlCard( + icon: Icons.power_settings_new, + title: 'Status Perangkat', + subtitle: _isDeviceOn ? 'AKTIF' : 'NONAKTIF', + trailing: Switch( + value: _isDeviceOn, + onChanged: _toggleDevice, + activeColor: primaryColor, + ), + iconColor: _isDeviceOn ? Colors.green : Colors.red, + ), + const SizedBox(height: 20), + _buildControlCard( + icon: Icons.settings_remote, + title: 'Mode', + subtitle: _mode.toUpperCase(), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + ChoiceChip( + label: const Text('Otomatis'), + selected: _mode == 'otomatis', + onSelected: (selected) { + if (selected) _changeMode('otomatis'); + }, + selectedColor: primaryColor, + labelStyle: TextStyle( + color: _mode == 'otomatis' ? Colors.white : Colors.black, + ), + ), + const SizedBox(width: 10), + ChoiceChip( + label: const Text('Manual'), + selected: _mode == 'manual', + onSelected: (selected) { + if (selected) _changeMode('manual'); + }, + selectedColor: primaryColor, + labelStyle: TextStyle( + color: _mode == 'manual' ? Colors.white : Colors.black, + ), + ), + ], + ), + iconColor: primaryColor, + ), + const SizedBox(height: 30), + ElevatedButton.icon( + onPressed: _logout, + icon: const Icon(Icons.logout), + label: const Text('Logout'), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.redAccent, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ], + ), + ), + ); + } + + Widget _buildControlCard({ + required IconData icon, + required String title, + required String subtitle, + required Widget trailing, + required Color iconColor, + }) { + return Container( + padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(18), + boxShadow: const [ + BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 3)), + ], + border: Border.all(color: Colors.black12), + ), + child: Row( + children: [ + Container( + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: iconColor.withOpacity(0.1), + shape: BoxShape.circle, + ), + child: Icon(icon, size: 28, color: iconColor), + ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, + style: const TextStyle( + fontWeight: FontWeight.w600, fontSize: 16)), + const SizedBox(height: 4), + Text( + subtitle, + style: TextStyle( + color: Colors.grey[700], + fontSize: 13, + fontWeight: FontWeight.w500), + ), + ], + ), + ), + trailing, + ], + ), + ); + } +} diff --git a/lib/screens/splash_screen.dart b/lib/screens/splash_screen.dart new file mode 100644 index 0000000..e904b7d --- /dev/null +++ b/lib/screens/splash_screen.dart @@ -0,0 +1,101 @@ +import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:firebase_auth/firebase_auth.dart'; + +class SplashScreen extends StatefulWidget { + const SplashScreen({super.key}); + + @override + State createState() => _SplashScreenState(); +} + +class _SplashScreenState extends State + with SingleTickerProviderStateMixin { + late AnimationController _controller; + late Animation _scaleAnimation; + late Animation _opacityAnimation; + + @override + void initState() { + super.initState(); + + _controller = AnimationController( + vsync: this, + duration: const Duration(seconds: 2), + ); + + _scaleAnimation = Tween(begin: 0.6, end: 1.0).animate( + CurvedAnimation(parent: _controller, curve: Curves.easeOutBack), + ); + + _opacityAnimation = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation(parent: _controller, curve: Curves.easeIn), + ); + + _controller.forward(); + + Timer(const Duration(seconds: 3), () { + final user = FirebaseAuth.instance.currentUser; + if (user != null) { + Navigator.pushReplacementNamed(context, '/main'); + } else { + Navigator.pushReplacementNamed(context, '/login'); + } + }); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [Color(0xFF6B4EFF),Color(0xFF8B70FF) ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Center( + child: AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return Opacity( + opacity: _opacityAnimation.value, + child: Transform.scale( + scale: _scaleAnimation.value, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset( + 'assets/images/logo.png', + width: 80, + height: 80, + ), + const SizedBox(height: 20), + Text( + 'AntiSpy Security', + style: Theme.of(context).textTheme.headlineMedium?.copyWith( + color: Colors.white, + fontWeight: FontWeight.bold, + letterSpacing: 1.2, + ), + ), + const SizedBox(height: 20), + const CircularProgressIndicator(color: Colors.white), + ], + ), + ), + ); + }, + ), + ), + ), + ); + } +} diff --git a/lib/services/auth_service.dart b/lib/services/auth_service.dart new file mode 100644 index 0000000..a7be379 --- /dev/null +++ b/lib/services/auth_service.dart @@ -0,0 +1,23 @@ +import 'package:firebase_auth/firebase_auth.dart'; + +class AuthService { + final FirebaseAuth _auth = FirebaseAuth.instance; + + Future login(String email, String password) async { + try { + UserCredential result = await _auth.signInWithEmailAndPassword( + email: email, + password: password, + ); + return result.user; + } catch (e) { + throw e.toString(); + } + } + + Future logout() async { + await _auth.signOut(); + } + + Stream get userStream => _auth.authStateChanges(); +} diff --git a/lib/widgets/costum_header.dart b/lib/widgets/costum_header.dart new file mode 100644 index 0000000..7c9d406 --- /dev/null +++ b/lib/widgets/costum_header.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import '../screens/notifications/notifications_page.dart'; + +class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { + final String title; + + const CustomAppBar({super.key, required this.title}); + + @override + Widget build(BuildContext context) { + return AppBar( + backgroundColor: const Color(0xFF5F59A6), // ungu gelap + elevation: 4, + title: Text( + title, + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 20, + ), + ), + actions: [ + IconButton( + icon: const Icon(Icons.notifications, color: Colors.white), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const NotificationsPage(), + ), + ); + }, + ), +], + + ); + } + + @override + Size get preferredSize => const Size.fromHeight(kToolbarHeight); +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..84d48fb --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,458 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: "214e6f07e2a44f45972e0365c7b537eaeaddb4598db0778dd4ac64b4acd3f5b1" + url: "https://pub.dev" + source: hosted + version: "1.3.55" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + sha256: d25c956be5261c14bc9a69c9662de8addb308376b4b53a64469aade52e7b02f8 + url: "https://pub.dev" + source: hosted + version: "5.6.8" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: ee2b8f8c602ede36073afd3741e99cfea9dd982b4a44833daf665134d151c32a + url: "https://pub.dev" + source: hosted + version: "6.6.8" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: b99bc4f1f70787f694b73bc6fce238d4d6cc822c9b31ba8ef1578b180b6f77bc + url: "https://pub.dev" + source: hosted + version: "4.4.8" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + sha256: "10cd3f00a247f33b0a5c77574011a87379432bf3fec77a500b55f2bcc30ddd8b" + url: "https://pub.dev" + source: hosted + version: "5.5.4" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: "2d15872a8899b0459fab6b4c148fd142e135acfc8a303d383d80b455e4dba7bd" + url: "https://pub.dev" + source: hosted + version: "7.6.3" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: efba45393050ca03d992eae1d305d5fc8c0c9f5980624053512e935c23767c4f + url: "https://pub.dev" + source: hosted + version: "5.14.3" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "8cfe3c900512399ce8d50fcc817e5758ff8615eeb6fa5c846a4cc47bbf6353b6" + url: "https://pub.dev" + source: hosted + version: "3.13.1" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: d7253d255ff10f85cfd2adaba9ac17bae878fa3ba577462451163bd9f1d1f0bf + url: "https://pub.dev" + source: hosted + version: "5.4.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: ddd72baa6f727e5b23f32d9af23d7d453d67946f380bd9c21daf474ee0f7326e + url: "https://pub.dev" + source: hosted + version: "2.23.0" + firebase_database: + dependency: "direct main" + description: + name: firebase_database + sha256: e98c32b9462779f4c45eb036dcaf22cd6a17204e80f77c292bd1d05b08c8ef81 + url: "https://pub.dev" + source: hosted + version: "11.3.6" + firebase_database_platform_interface: + dependency: transitive + description: + name: firebase_database_platform_interface + sha256: "3e81c5e2152ad996309458f8338977989d81a44a692e27180db9380f6faffafb" + url: "https://pub.dev" + source: hosted + version: "0.2.6+6" + firebase_database_web: + dependency: transitive + description: + name: firebase_database_web + sha256: "0289c1c7832b3ca79520517c54bf42a40b9bfefa8198906145ab17e75989d80f" + url: "https://pub.dev" + source: hosted + version: "0.2.6+12" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_hooks: + dependency: transitive + description: + name: flutter_hooks + sha256: b772e710d16d7a20c0740c4f855095026b31c7eb5ba3ab67d2bd52021cd9461d + url: "https://pub.dev" + source: hosted + version: "0.21.2" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.dev" + source: hosted + version: "5.0.0" + flutter_mjpeg: + dependency: "direct main" + description: + name: flutter_mjpeg + sha256: "46ea3f1a49838deb8e2b01a70b897313c7f985affecfaf3b3bae6f4e15405b6b" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + go_router: + dependency: "direct main" + description: + name: go_router + sha256: "0b1e06223bee260dee31a171fb1153e306907563a0b0225e8c1733211911429a" + url: "https://pub.dev" + source: hosted + version: "15.1.2" + http: + dependency: transitive + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + provider: + dependency: "direct main" + description: + name: provider + sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" + url: "https://pub.dev" + source: hosted + version: "6.1.5" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 + url: "https://pub.dev" + source: hosted + version: "0.4.0+2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + webview_flutter: + dependency: "direct main" + description: + name: webview_flutter + sha256: c3e4fe614b1c814950ad07186007eff2f2e5dd2935eba7b9a9a1af8e5885f1ba + url: "https://pub.dev" + source: hosted + version: "4.13.0" + webview_flutter_android: + dependency: "direct main" + description: + name: webview_flutter_android + sha256: f6e6afef6e234801da77170f7a1847ded8450778caf2fe13979d140484be3678 + url: "https://pub.dev" + source: hosted + version: "4.7.0" + webview_flutter_platform_interface: + dependency: "direct main" + description: + name: webview_flutter_platform_interface + sha256: f0dc2dc3a2b1e3a6abdd6801b9355ebfeb3b8f6cde6b9dc7c9235909c4a1f147 + url: "https://pub.dev" + source: hosted + version: "2.13.1" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + sha256: a3d461fe3467014e05f3ac4962e5fdde2a4bf44c561cb53e9ae5c586600fdbc3 + url: "https://pub.dev" + source: hosted + version: "3.22.0" +sdks: + dart: ">=3.6.2 <4.0.0" + flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..b11b80f --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,99 @@ +name: antispy +description: "A new Flutter project." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: ^3.6.2 + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + firebase_core: ^3.13.1 + go_router: ^15.1.2 + firebase_auth: ^5.5.4 + provider: ^6.1.5 + firebase_database: ^11.3.6 + intl: ^0.20.2 + cloud_firestore: ^5.6.8 + flutter_mjpeg: ^2.0.4 + webview_flutter: ^4.13.0 + webview_flutter_android: ^4.7.0 + webview_flutter_platform_interface: ^2.13.1 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - assets/images/logo.png + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package