commit 1fb8c28c2e4c342f1e045ebcb1339cf9c0a63812 Author: Bl3kiiie Date: Sat Apr 5 11:47:40 2025 +0200 first commit 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..bdb0024 --- /dev/null +++ b/.metadata @@ -0,0 +1,42 @@ +# 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: "c23637390482d4cf9598c3ce3f2be31aa7332daf" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: android + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: ios + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: linux + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: macos + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: web + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + + # 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/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..34aec5c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "name": "Flutter (lib\\main.dart)", + "type": "dart", + "request": "launch", + "program": "lib\\main.dart" + }, + { + "name": "Flutter (lib\\main.dart)", + "type": "dart", + "request": "launch", + "program": "lib\\main.dart" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..224e167 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# shooter_app + +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..be3943c --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# 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.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..1d878aa --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,42 @@ +plugins { + id("com.android.application") + 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.shooter_app" + compileSdk = flutter.compileSdkVersion + + ndkVersion = "27.0.12077973" // ✅ Keep only this line + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + applicationId = "com.example.shooter_app" + minSdk = 26 // ✅ From earlier fix + targetSdk = 33 + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + signingConfig = signingConfigs.getByName("debug") + } + } +} + + + +flutter { + source = "../.." +} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..494833b --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,18 @@ +# TensorFlow Lite +-keep class org.tensorflow.** { *; } +-dontwarn org.tensorflow.** + +# TFLite GPU Delegate +-keep class org.tensorflow.lite.gpu.** { *; } +-dontwarn org.tensorflow.lite.gpu.** + +# TFLite Support Libraries +-keep class org.tensorflow.lite.support.** { *; } +-dontwarn org.tensorflow.lite.support.** + +# Prevent R8 stripping +-keep class com.google.** { *; } +-dontwarn com.google.** + +# Keep your YOLO model loader class if needed +-keep class your.package.name.YOLODetect { *; } 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..61624c1 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/example/shooter_app/MainActivity.kt b/android/app/src/main/kotlin/com/example/shooter_app/MainActivity.kt new file mode 100644 index 0000000..38f3481 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/shooter_app/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.shooter_app + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/android/app/src/main/kotlin/com/example/test1/MainActivity.kt b/android/app/src/main/kotlin/com/example/test1/MainActivity.kt new file mode 100644 index 0000000..a576a56 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/test1/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.test1 + +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 0000000..6d88bc4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ 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 0000000..e82c96b Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..e068c36 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ 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 0000000..fb7fed6 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ 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 0000000..1296eed Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ 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/main/res/xml/network_security_config.xml b/android/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..d4780f8 --- /dev/null +++ b/android/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + 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.kts b/android/build.gradle.kts new file mode 100644 index 0000000..89176ef --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,21 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..f018a61 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -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..afa1e8e --- /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.10.2-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..a439442 --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + 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.7.0" apply false + id("org.jetbrains.kotlin.android") version "1.8.22" apply false +} + +include(":app") diff --git a/assets/Icon.png b/assets/Icon.png new file mode 100644 index 0000000..ad41432 Binary files /dev/null and b/assets/Icon.png differ diff --git a/assets/best_float32_nms.tflite b/assets/best_float32_nms.tflite new file mode 100644 index 0000000..15f0f3f Binary files /dev/null and b/assets/best_float32_nms.tflite differ diff --git a/assets/google_logo.png b/assets/google_logo.png new file mode 100644 index 0000000..16302aa Binary files /dev/null and b/assets/google_logo.png differ diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..da243c2 Binary files /dev/null and b/assets/logo.png differ diff --git a/assets/logo.svg b/assets/logo.svg new file mode 100644 index 0000000..2c743eb --- /dev/null +++ b/assets/logo.svg @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/target.png b/assets/target.png new file mode 100644 index 0000000..c2574b4 Binary files /dev/null and b/assets/target.png differ diff --git a/assets/target.svg b/assets/target.svg new file mode 100644 index 0000000..4f10830 --- /dev/null +++ b/assets/target.svg @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..7c56964 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6908535 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,616 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.shooterApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.shooterApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.shooterApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.shooterApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.shooterApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.shooterApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..15cada4 --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..6266644 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..107b489 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..3245ad1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..780e566 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..ea4d83a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..31b13f4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..8985901 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..9c364e6 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..780e566 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..a83f74b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..167464c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png new file mode 100644 index 0000000..5fe1ef4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png new file mode 100644 index 0000000..cf08858 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png new file mode 100644 index 0000000..d521368 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png new file mode 100644 index 0000000..25ed584 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..167464c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..9b0d733 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png new file mode 100644 index 0000000..6d88bc4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png new file mode 100644 index 0000000..fb7fed6 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..741a53c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..827813a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..e2af2a0 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..06c9da8 --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Shooter App + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + shooter_app + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..6b5f166 --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; // Import for SystemChrome +import 'screens/home_screen.dart'; + +void main() { + WidgetsFlutterBinding.ensureInitialized(); + + // Set system UI overlay style globally for the app + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle( + statusBarColor: Colors.grey[900], // Set status bar color (top bar) + systemNavigationBarColor: Colors.grey[900], // Set navigation bar color + systemNavigationBarIconBrightness: Brightness.light, // Set navigation icon color to light + ), + ); + + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'App with Calendar', + debugShowCheckedModeBanner: false, + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.white), + useMaterial3: true, + ), + home: const HomeScreen(), // Change LoginScreen to HomeScreen + ); + } +} diff --git a/lib/screens/book_screen.dart b/lib/screens/book_screen.dart new file mode 100644 index 0000000..57779c7 --- /dev/null +++ b/lib/screens/book_screen.dart @@ -0,0 +1,809 @@ +import 'dart:io'; +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; // For DateFormat +import 'package:path_provider/path_provider.dart'; // For getApplicationDocumentsDirectory +import 'target_view.dart'; // Import the TargetViewScreen +import 'package:shared_preferences/shared_preferences.dart'; + +class BookScreen extends StatefulWidget { + const BookScreen({super.key}); + + @override + State createState() => _BookScreenState(); +} + +class _BookScreenState extends State with WidgetsBindingObserver { + Map> _groupedFiles = {}; // Files grouped by folder + Map _folderCreationDates = {}; // Folder creation dates + Map _folderScores = {}; // Folder scores (sum of scores of all target files inside) + String? _expandedFolder; + Color _bulletColor = Colors.blue; // default fallback + Map _folderTypes = {}; // true = tournament, false = training + String _folderFilter = 'all'; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); // Register to listen for lifecycle events + _loadBulletColor(); + _loadTargetDataFiles(); // Initial load when the screen is first created + } + + @override + void dispose() { + WidgetsBinding.instance.removeObserver(this); // Unregister from lifecycle events when disposed + super.dispose(); + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + super.didChangeAppLifecycleState(state); + if (state == AppLifecycleState.resumed) { + // Reload data when the screen is resumed or comes into view + _loadTargetDataFiles(); + } + } + + Future _loadBulletColor() async { + final prefs = await SharedPreferences.getInstance(); + final selected = prefs.getString('bulletColor') ?? 'Blue'; + setState(() { + _bulletColor = _getColorFromName(selected); + }); +} + +Color _getColorFromName(String colorName) { + switch (colorName.toLowerCase()) { + case 'blue': + return Colors.blue; + case 'green': + return Colors.green; + case 'yellow': + return Colors.yellow; + case 'purple': + return Colors.purple; + case 'cyan': + return Colors.cyan; + case 'teal': + return Colors.teal; + case 'indigo': + return Colors.indigo; + case 'pink': + return Colors.pink; + case 'lime': + return Colors.lime; + case 'mint': + return Colors.greenAccent; + case 'sky': + return Colors.orange; + case 'violet': + return Colors.deepPurpleAccent; + default: + return Colors.blue; // fallback + } +} + + // Load the target data files from the directory + void _loadTargetDataFiles() async { + try { + final directory = await getApplicationDocumentsDirectory(); + final dataDirectory = Directory('${directory.path}/saved_images'); + + if (!await dataDirectory.exists()) { + await dataDirectory.create(recursive: true); + } + + List folders = dataDirectory.listSync().whereType().toList(); + + Map> groupedFiles = {}; + Map folderDates = {}; + Map folderScores = {}; + Map folderTypes = {}; // ✅ + + for (var folder in folders) { + String folderName = folder.path.split('/').last; + DateTime folderDate = folder.statSync().modified; + + // ✅ Read isTournament flag + bool isTournament = false; + final metadataFile = File('${folder.path}/metadata.json'); + if (await metadataFile.exists()) { + try { + final metadata = jsonDecode(await metadataFile.readAsString()); + isTournament = metadata['isTournament'] == true; + } catch (e) { + debugPrint("Error reading metadata for $folderName: $e"); + } + } + folderTypes[folderName] = isTournament; + + List targetFiles = Directory(folder.path) + .listSync() + .whereType() + .where((file) => + file.path.endsWith(".json") && + !file.path.endsWith("metadata.json")) + .toList(); + + int totalScore = 0; + for (var file in targetFiles) { + final jsonString = await file.readAsString(); + final data = jsonDecode(jsonString); + final score = _getScoreFromJson(data); + totalScore += score; + } + + groupedFiles[folderName] = targetFiles; + folderDates[folderName] = folderDate; + folderScores[folderName] = totalScore; + } + + final sortedFolderNames = folderDates.keys.toList() + ..sort((a, b) => folderDates[b]!.compareTo(folderDates[a]!)); + + final sortedGroupedFiles = { + for (var folderName in sortedFolderNames) folderName: groupedFiles[folderName]! + }; + final sortedFolderScores = { + for (var folderName in sortedFolderNames) folderName: folderScores[folderName]! + }; + final sortedFolderDates = { + for (var folderName in sortedFolderNames) folderName: folderDates[folderName]! + }; + final sortedFolderTypes = { + for (var folderName in sortedFolderNames) folderName: folderTypes[folderName]! + }; + + setState(() { + _groupedFiles = sortedGroupedFiles; + _folderCreationDates = sortedFolderDates; + _folderScores = sortedFolderScores; + _folderTypes = sortedFolderTypes; // ✅ FIXED + }); + } catch (e) { + debugPrint("Error loading target data files: $e"); + } +} + + + // Function to safely get the score from the JSON data + int _getScoreFromJson(Map data) { + if (data.containsKey('totalScore') && data['totalScore'] is int) { + return data['totalScore']; + } + return 0; // Default to 0 if the score is not present or invalid + } + + // Delete a file + Future _deleteFile(File file) async { + bool? confirmDeletion = await _showConfirmationDialog( + context, + 'Are you sure you want to delete this file?', + ); + + if (confirmDeletion == true) { + try { + await file.delete(); + _loadTargetDataFiles(); // Refresh after deleting the file + } catch (e) { + ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("Error deleting file: $e"))); + } + } + } + + // Open file preview in the TargetViewScreen + void _openFilePreview(File targetFile) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => TargetViewScreen( + jsonFiles: [targetFile], // Pass the selected file in a list + refreshFolders: _loadTargetDataFiles, // Pass the refreshFolders callback + ), + ), + ); + } + + // Open folder's combined target view in the TargetViewScreen + void _openFolderTargetView(String folderName) async { + final targetFiles = _groupedFiles[folderName] ?? []; + + List> allBullets = []; + String latestDate = 'Unknown'; + + for (var file in targetFiles) { + final jsonString = await file.readAsString(); + final data = jsonDecode(jsonString); + + final bullets = (data['bullets'] as List) + .map((b) => {'x': b['x'], 'y': b['y']}) + .toList(); + + allBullets.addAll(bullets); + + if (data['date'] != null) { + latestDate = data['date']; // You could sort if you want the most recent + } + } + + // Create combined JSON structure + final combinedJson = jsonEncode({ + 'date': latestDate, + 'bullets': allBullets, + }); + + // Save this JSON temporarily to disk + final tempDir = await getTemporaryDirectory(); + final combinedFile = File('${tempDir.path}/combined_${folderName}.json'); + await combinedFile.writeAsString(combinedJson); + + // Navigate to view screen with the combined file + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => TargetViewScreen( + jsonFiles: [combinedFile], // treat it like a normal file + refreshFolders: _loadTargetDataFiles, + isCombinedView: true, // 👈 This line + ), + ), + ); +} + +List _filteredFolderNames() { + if (_folderFilter == 'all') return _groupedFiles.keys.toList(); + + final isTournamentFilter = _folderFilter == 'tournament'; + + return _groupedFiles.keys + .where((folderName) => _folderTypes[folderName] == isTournamentFilter) + .toList(); +} + + // Rename folder + Future _renameFolder(String oldFolderName) async { + final newNameController = TextEditingController(); + bool isRenameEnabled = false; + bool isTournament = _folderTypes[oldFolderName] == true; + + final result = await showDialog>( + context: context, + builder: (context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), + child: StatefulBuilder( + builder: (context, setState) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text( + 'Folder Settings', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 20), + + TextField( + controller: newNameController, + textAlign: TextAlign.center, + style: const TextStyle(color: Colors.white), + decoration: InputDecoration( + filled: true, + fillColor: Colors.grey[800], + hintText: 'Enter new folder name', + hintStyle: const TextStyle(color: Colors.white54), + contentPadding: + const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide.none, + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide(color: _bulletColor), + ), + ), + onChanged: (value) { + setState(() { + isRenameEnabled = value.trim().isNotEmpty; + }); + }, + ), + const SizedBox(height: 16), + + GestureDetector( + onTap: () { + setState(() { + isTournament = !isTournament; + }); + }, + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: isTournament + ? _bulletColor.withOpacity(0.2) + : Colors.grey[850], + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: isTournament + ? _bulletColor + : Colors.grey[700]!, + width: 1.5, + ), + ), + padding: const EdgeInsets.symmetric( + horizontal: 16, vertical: 14), + child: Center( + child: Text( + isTournament + ? 'Tournament Mode 🏆' + : 'Mark as Tournament 🏆', + style: TextStyle( + color: isTournament + ? _bulletColor + : Colors.white70, + fontWeight: FontWeight.w500, + fontSize: 16, + ), + ), + ), + ), + ), + const SizedBox(height: 20), + + Row( + children: [ + Expanded( + child: ElevatedButton( + onPressed: () => Navigator.of(context).pop(), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.grey[800], + foregroundColor: Colors.white, + padding: + const EdgeInsets.symmetric(vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text('Cancel'), + ), + ), + const SizedBox(width: 12), + Expanded( + child: ElevatedButton( + onPressed: () => Navigator.of(context).pop({ + 'name': newNameController.text.trim(), + 'isTournament': isTournament, + }), + style: ElevatedButton.styleFrom( + backgroundColor: _bulletColor, + foregroundColor: Colors.white, + padding: + const EdgeInsets.symmetric(vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text('Apply'), + ), + ), + ], + ) + ], + ); + }, + ), + ), + ); + }, + ); + + // ✅ Handle result (rename + update tag) + if (result != null) { + final newName = result['name']; + final isTournament = result['isTournament'] ?? false; + + final directory = await getApplicationDocumentsDirectory(); + final oldFolderPath = + Directory('${directory.path}/saved_images/$oldFolderName'); + + final targetFolderName = + (newName != null && newName.isNotEmpty) ? newName : oldFolderName; + + final newFolderPath = + Directory('${directory.path}/saved_images/$targetFolderName'); + + if (targetFolderName != oldFolderName) { + if (await newFolderPath.exists()) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text('A folder named "$targetFolderName" already exists.')), + ); + return; + } else { + await oldFolderPath.rename(newFolderPath.path); + } + } + + final metadataFile = File('${newFolderPath.path}/metadata.json'); + if (isTournament) { + await metadataFile.writeAsString(jsonEncode({'isTournament': true})); + } else { + if (await metadataFile.exists()) { + await metadataFile.delete(); + } + } + + _loadTargetDataFiles(); // refresh UI + } +} + + + // Delete a folder + Future _deleteFolder(String folderName) async { + bool? confirmDeletion = await _showConfirmationDialog( + context, + 'Are you sure you want to delete the folder "$folderName" and all of its contents?', + ); + + if (confirmDeletion == true) { + try { + final directory = await getApplicationDocumentsDirectory(); + final folderPath = Directory('${directory.path}/saved_images/$folderName'); + + if (await folderPath.exists()) { + await folderPath.delete(recursive: true); + } + + _loadTargetDataFiles(); // Refresh file/folder list + + if (_expandedFolder == folderName) { + setState(() { + _expandedFolder = null; + }); + } + + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text('Folder "$folderName" deleted successfully.'), + ), + ); + } catch (e) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text("Error deleting folder: $e")), + ); + } + } +} + + Future _showConfirmationDialog(BuildContext context, String message) async { + return showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text( + 'Confirm Deletion', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + Text( + message, + style: const TextStyle(color: Colors.white70, fontSize: 16), + textAlign: TextAlign.center, + ), + const SizedBox(height: 24), + + // "Yes" Button + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () => Navigator.of(context).pop(true), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.redAccent, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Yes, delete"), + ), + ), + const SizedBox(height: 12), + + // "No" Button + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () => Navigator.of(context).pop(false), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.grey[800], + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Cancel"), + ), + ), + ], + ), + ), + ); + }, + ); +} + + + // Build the folder row with folder name, trash, and rename options +// Build the folder row with folder name, trash, rename options, and view all targets icon +Widget _buildFolderRow(String folderName) { + final numberOfTargets = _groupedFiles[folderName]!.length; + final totalScore = _folderScores[folderName]; + + return Container( + padding: const EdgeInsets.all(16), + margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 16), + decoration: BoxDecoration( + color: Colors.grey[300], // Lighter background for folder + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListTile( + contentPadding: const EdgeInsets.all(0), + title: Row( + children: [ + Text(folderName, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), + if (_folderTypes[folderName] == true) + const Padding( + padding: EdgeInsets.only(left: 6), + child: Text('🏆', style: TextStyle(fontSize: 18)), + ), + ], + ), + + subtitle: Padding( + padding: const EdgeInsets.only(top: 8.0, bottom: 8.0), // Add padding between title and info + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon(Icons.insert_drive_file, color: Colors.black45), + const SizedBox(width: 4), // Small space between the icon and the text + Text( + "$numberOfTargets / 🎯 $totalScore", + style: const TextStyle(fontSize: 16, color: Colors.black), + ), + ], + ), + ), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: const Icon(Icons.my_location, color: Colors.grey), + onPressed: () => _openFolderTargetView(folderName), + ), + IconButton( + icon: Icon(Icons.edit, color: _bulletColor), + onPressed: () => _renameFolder(folderName), + ), + IconButton( + icon: const Icon(Icons.delete, color: Colors.red), + onPressed: () => _deleteFolder(folderName), + ), + ], + ), + onTap: () { + setState(() { + // If the folder is already expanded, collapse it, otherwise expand it + _expandedFolder = _expandedFolder == folderName ? null : folderName; + }); + }, + ), + if (_expandedFolder == folderName) + // When expanded, display the file row inside the folder + ..._groupedFiles[folderName]! + .asMap() + .entries + .map((entry) => _buildFileRow(entry.value, folderName, entry.key)) + .toList(), + ], + ), + ); +} + + // Build the row for files in the folder with everything in a single row + Widget _buildFileRow(File file, String folderName, int index) { + final fileName = "${index + 1} Target"; // Use number starting from 1 + final folderDate = _folderCreationDates[folderName]; + final formattedDate = folderDate != null + ? DateFormat('yyyy-MM-dd').format(folderDate) + : 'Unknown Date'; // or any default fallback string + + final score = _getScoreFromJson(jsonDecode(file.readAsStringSync())); // Read the score for the file + + return Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), // Reduced vertical padding for compact height + margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), // Tight margin + decoration: BoxDecoration( + color: Colors.grey[200], // Light grey background for files + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey[300]!, width: 1), // Light border around the file + ), + child: InkWell( + onTap: () => _openFilePreview(file), // Open the file preview when the row is tapped + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, // Distribute space across the row + children: [ + // File name + Text(fileName, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold)), + + // Date + Text(formattedDate, style: const TextStyle(fontSize: 12, color: Colors.black54)), + + // Target emoji and score + Text("🎯 $score", style: const TextStyle(fontSize: 14, color: Colors.black54)), + + // Delete button + IconButton( + icon: const Icon(Icons.delete, color: Color.fromARGB(255, 252, 102, 92)), + onPressed: () => _deleteFile(file), // Trigger file deletion + ), + ], + ), + ), + ); +} + + + @override +Widget build(BuildContext context) { + return Scaffold( + body: Column( + children: [ + // 🔽 Filter dropdown at the top + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0), + child: GestureDetector( + onTap: () => _showFolderFilterPopup(context), + child: Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + decoration: BoxDecoration( + color: Colors.grey[300], // Same as folder background + borderRadius: BorderRadius.circular(12), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + _folderFilter == 'all' + ? 'Showing: All folders' + : _folderFilter == 'tournament' + ? 'Showing: 🏆 Tournament folders' + : 'Showing: 🎯 Training folders', + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500), + ), + const Icon(Icons.filter_list), + ], + ), + ), + ), +), + + + + // 📁 Folder list or empty state + Expanded( + child: _groupedFiles.isEmpty + ? const Center(child: Text("No saved target data found", style: TextStyle(fontSize: 18))) + : ListView.builder( + itemCount: _filteredFolderNames().length, + itemBuilder: (context, index) { + String folderName = _filteredFolderNames()[index]; + return _buildFolderRow(folderName); + }, + ), + ), + ], + ), + ); +} + +void _showFolderFilterPopup(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Container( + width: double.infinity, + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text( + 'Filter Folders', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + const SizedBox(height: 24), + + _buildFilterOption('all', '📂 All folders'), + const SizedBox(height: 12), + _buildFilterOption('tournament', '🏆 Tournament'), + const SizedBox(height: 12), + _buildFilterOption('training', '🎯 Training'), + ], + ), + ), + ); + }, + ); +} + + +Widget _buildFilterOption(String value, String label) { + final isSelected = _folderFilter == value; + + return GestureDetector( + onTap: () { + setState(() { + _folderFilter = value; + }); + Navigator.of(context).pop(); + }, + child: Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: isSelected ? _bulletColor.withOpacity(0.3) : Colors.grey[800], + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: isSelected ? _bulletColor : Colors.transparent, + width: 1.5, + ), + ), + child: Center( + child: Text( + label, + style: const TextStyle(color: Colors.white, fontSize: 16), + ), + ), + ), + ); +} + + + +} diff --git a/lib/screens/calendar_screen.dart b/lib/screens/calendar_screen.dart new file mode 100644 index 0000000..e65f6d1 --- /dev/null +++ b/lib/screens/calendar_screen.dart @@ -0,0 +1,67 @@ +import 'package:flutter/material.dart'; +import 'package:webview_flutter/webview_flutter.dart'; + +class CalendarScreen extends StatefulWidget { + const CalendarScreen({super.key}); + + @override + State createState() => _CalendarScreenState(); +} + +class _CalendarScreenState extends State { + late final WebViewController _controller; + bool _isLoading = true; + bool _hasError = false; + + @override + void initState() { + super.initState(); + _controller = WebViewController() + ..setJavaScriptMode(JavaScriptMode.unrestricted) + ..setNavigationDelegate( + NavigationDelegate( + onPageStarted: (_) => setState(() { + _isLoading = true; + _hasError = false; + }), + onPageFinished: (_) => setState(() => _isLoading = false), + onWebResourceError: (error) => setState(() { + _hasError = true; + _isLoading = false; + }), + ), + ) + ..loadRequest(Uri.parse( + 'https://calendar.google.com/calendar/u/0/embed?src=b9c267252d5be63d5cdc880be499885a88421eefd0e34e1392890daba0d8471e@group.calendar.google.com&ctz=Europe/Belgrade')); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + children: [ + WebViewWidget(controller: _controller), + if (_isLoading) + const Center(child: CircularProgressIndicator()), + if (_hasError) + Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + "Failed to load Google Calendar.", + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 10), + ElevatedButton( + onPressed: () => _controller.reload(), + child: const Text("Retry"), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/camera_screen.dart b/lib/screens/camera_screen.dart new file mode 100644 index 0000000..0e6d54b --- /dev/null +++ b/lib/screens/camera_screen.dart @@ -0,0 +1,323 @@ +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:camera/camera.dart'; +import 'package:image/image.dart' as img; +import 'package:shared_preferences/shared_preferences.dart'; +import 'yolo_detector.dart'; +import 'preview_screen.dart'; + +class CameraScreen extends StatefulWidget { + const CameraScreen({super.key}); + + @override + State createState() => _CameraScreenState(); +} + +class _CameraScreenState extends State { + CameraController? _controller; + Future? _initializeControllerFuture; + late YOLODetector _yoloDetector; + Color _bulletColor = Colors.blue; // default fallback + + // The variable to hold the number of bullets entered by the user (default set to 5) + int _numberOfBullets = 5; + + @override + void initState() { + super.initState(); + _loadBulletCount(); + _initCamera(); + _loadBulletColor(); // 👈 + YOLODetector.create().then((detector) => _yoloDetector = detector); + } + + Future _loadBulletColor() async { + final prefs = await SharedPreferences.getInstance(); + final selected = prefs.getString('bulletColor') ?? 'Blue'; + setState(() { + _bulletColor = _getColorFromName(selected); + }); +} + +Color _getColorFromName(String colorName) { + switch (colorName.toLowerCase()) { + case 'blue': + return Colors.blue; + case 'green': + return Colors.green; + case 'yellow': + return Colors.yellow; + case 'purple': + return Colors.purple; + case 'cyan': + return Colors.cyan; + case 'teal': + return Colors.teal; + case 'indigo': + return Colors.indigo; + case 'pink': + return Colors.pink; + case 'lime': + return Colors.lime; + case 'mint': + return Colors.greenAccent; + case 'sky': + return Colors.lightBlueAccent; + case 'violet': + return Colors.deepPurpleAccent; + default: + return Colors.blue; + } +} + + + Future _loadBulletCount() async { + final prefs = await SharedPreferences.getInstance(); + setState(() { + _numberOfBullets = prefs.getInt('bulletCount') ?? 5; // Load stored bullet count, default to 5 + }); + } + + Future _saveBulletCount(int count) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.setInt('bulletCount', count); // Save the bullet count + } + + Future _initCamera() async { + final cameras = await availableCameras(); + final camera = cameras.first; + + _controller = CameraController( + camera, + ResolutionPreset.high, + enableAudio: false, + ); + + _initializeControllerFuture = _controller!.initialize(); + if (mounted) setState(() {}); + } + + @override + void dispose() { + _controller?.dispose(); + _yoloDetector.close(); + super.dispose(); + } + + Future _takePicture() async { + try { + await _initializeControllerFuture; + final file = await _controller!.takePicture(); + final imageFile = File(file.path); + final imageBytes = await imageFile.readAsBytes(); + final decodedImage = img.decodeImage(imageBytes)!; + + // Crop center square from full image + final width = decodedImage.width; + final height = decodedImage.height; + final size = width < height ? width : height; + final offsetX = (width - size) ~/ 2; + final offsetY = (height - size) ~/ 2; + + final cropped = img.copyCrop( + decodedImage, + x: offsetX, + y: offsetY, + width: size, + height: size, + ); + + final croppedFile = File('${file.path}_square.jpg') + ..writeAsBytesSync(img.encodeJpg(cropped)); + + final detections = await _yoloDetector.detect(croppedFile); + + if (!mounted) return; + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PreviewScreen( + imagePath: croppedFile.path, + detections: detections, + bulletCount: _numberOfBullets, // Pass the bullet count + ), + ), + ); + } catch (e) { + print('Error taking picture: $e'); + } + } + + // Method to show the dialog for selecting the number of bullets + void _showBulletDialog() { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), // Increased padding for better spacing + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: EdgeInsets.only(bottom: 16.0), + child: Text( + 'Select the number of bullets', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + Center( + child: Wrap( + alignment: WrapAlignment.center, + spacing: 12, + runSpacing: 12, + children: List.generate(5, (index) { + final bulletNum = index + 1; + final isSelected = _numberOfBullets == bulletNum; + return ElevatedButton( + onPressed: () { + _selectBulletCount(bulletNum); + Navigator.of(context).pop(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: + isSelected ? _bulletColor : Colors.grey[800], + foregroundColor: Colors.white, + padding: + const EdgeInsets.symmetric(horizontal: 20, vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text( + '$bulletNum', + style: TextStyle( + fontSize: 18, + fontWeight: + isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ); + }), + ), + ), + ], + ), + ), + ); + }, + ); + } + + + // Update the bullet count and save it + void _selectBulletCount(int number) { + setState(() { + _numberOfBullets = number; // Update the selected number + }); + _saveBulletCount(number); // Save the selected number + } + + @override + Widget build(BuildContext context) { + if (_controller == null || _initializeControllerFuture == null) { + return const Scaffold( + body: Center(child: CircularProgressIndicator()), + ); + } + + return Scaffold( + extendBody: true, + appBar: AppBar( + backgroundColor: Colors.grey[900], + title: const Text( + "Align the target inside the square", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + leading: IconButton( + icon: const Icon(Icons.arrow_back, color: Colors.white), + onPressed: () => Navigator.pop(context), + ), + centerTitle: true, + actions: [ + // Display the selected bullet count + IconButton( + icon: Text( + '$_numberOfBullets', + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + onPressed: _showBulletDialog, // Show dialog on tap + ), + const SizedBox(width: 16), // Space after the number + ], + ), + bottomNavigationBar: BottomAppBar( + color: Colors.grey[900], + shape: const CircularNotchedRectangle(), + notchMargin: 8.0, + child: SizedBox(height: 60), + ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + floatingActionButton: FloatingActionButton( + backgroundColor: Colors.white, + onPressed: _takePicture, + child: const Icon(Icons.camera_alt, color: Colors.black), + ), + body: FutureBuilder( + future: _initializeControllerFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + final screenSize = MediaQuery.of(context).size; + return Stack( + children: [ + Positioned.fill( + child: Container( + color: Colors.black, // covers any empty space + child: FittedBox( + fit: BoxFit.cover, + child: SizedBox( + width: _controller!.value.previewSize!.height, + height: _controller!.value.previewSize!.width, + child: CameraPreview(_controller!), + ), + ), + ), + ), + Center( + child: Container( + width: screenSize.width * 0.9, + height: screenSize.width * 0.9, + decoration: BoxDecoration( + border: Border.all( + color: _bulletColor.withOpacity(0.9), + width: 3, + ), + ), + ), + ), + ], + ); + } else { + return const Center(child: CircularProgressIndicator()); + } + }, + ), + ); + } +} diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart new file mode 100644 index 0000000..3b1dfcf --- /dev/null +++ b/lib/screens/home_screen.dart @@ -0,0 +1,93 @@ +import 'package:flutter/material.dart'; +import 'book_screen.dart'; +import 'calendar_screen.dart'; +import 'settings_screen.dart'; +import 'target_screen.dart'; +import '../widgets/bottom_nav.dart'; +//import 'login_screen.dart'; +import 'camera_screen.dart'; + + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + _HomeScreenState createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State { + int _selectedIndex = 1; // Default to Shooting Screen + + static final List _pages = [ + BookScreen(), + TargetScreen(), + Placeholder(), // Placeholder for Scan - optional + CalendarScreen(), + SettingsScreen(), + ]; + + static final List _pageTitles = [ + 'Book', + 'Shooting', + 'Scan', + 'Calendar', + 'Settings' + ]; + + void _onItemTapped(int index) { + if (index == 2) { + _openCameraScan(); + return; + } + setState(() { + _selectedIndex = index; + }); + } + + //void _logout() { + // Navigator.of(context).pushAndRemoveUntil( + // MaterialPageRoute(builder: (context) => const LoginScreen()), + // (Route route) => false, + // ); + //} + + // When opening the camera screen, ensure the shooting screen is always selected after returning + void _openCameraScan() async { + // Navigate to CameraScreen + await Navigator.of(context).push( + MaterialPageRoute(builder: (context) => const CameraScreen()), + ); + + // After returning, ensure that Shooting screen (index 1) is selected + setState(() { + _selectedIndex = 1; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text( + _pageTitles[_selectedIndex], + style: const TextStyle(color: Colors.white), + ), + backgroundColor: Colors.grey[900], + iconTheme: const IconThemeData(color: Colors.white), + automaticallyImplyLeading: false, + actions: [ + IconButton( + icon: const Icon(Icons.logout, color: Colors.red), + onPressed: null, // disables the button + ), + ], + ), + body: _pages[_selectedIndex], + bottomNavigationBar: BottomNavBar( + selectedIndex: _selectedIndex, + onItemTapped: _onItemTapped, + ), + ); + } +} + diff --git a/lib/screens/login_screen.dart b/lib/screens/login_screen.dart new file mode 100644 index 0000000..b3ae232 --- /dev/null +++ b/lib/screens/login_screen.dart @@ -0,0 +1,232 @@ +import 'package:flutter/material.dart'; +import 'package:google_sign_in/google_sign_in.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import '../widgets/input_field.dart'; +import 'home_screen.dart'; +import 'register_screen.dart'; + +class LoginScreen extends StatefulWidget { + const LoginScreen({super.key}); + + @override + State createState() => _LoginScreenState(); +} + +class _LoginScreenState extends State { + final usernameController = TextEditingController(); + final passwordController = TextEditingController(); + bool rememberMe = false; + + final GoogleSignIn _googleSignIn = GoogleSignIn( + clientId: 'YOUR_WEB_CLIENT_ID_HERE', + scopes: ['email'], + ); + + @override + void initState() { + super.initState(); + _checkAutoLogin(); + } + + Future _checkAutoLogin() async { + final prefs = await SharedPreferences.getInstance(); + final isRemembered = prefs.getBool('rememberMe') ?? false; + final googleUser = prefs.getString('googleUser'); + + if (isRemembered) { + final savedUsername = prefs.getString('loginUsername') ?? prefs.getString('username'); + final savedPassword = prefs.getString('password'); + if (savedUsername != null && savedPassword != null) { + usernameController.text = savedUsername; + passwordController.text = savedPassword; + setState(() => rememberMe = true); + } + } else if (googleUser != null) { + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => const HomeScreen()), + ); + } + } + + Future _saveLoginDetails(String username, String password) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.setString('loginUsername', username); // Ensures login uses latest username + await prefs.setString('password', password); + + if (rememberMe) { + await prefs.setBool('rememberMe', true); + } else { + await prefs.remove('rememberMe'); + } +} + + + void login() async { + String username = usernameController.text.trim(); + String password = passwordController.text.trim(); + + final prefs = await SharedPreferences.getInstance(); + String? savedUsername = prefs.getString('loginUsername') ?? prefs.getString('username'); // Get the latest username + String? savedPassword = prefs.getString('password'); // Get the saved password + + if (savedUsername == username && savedPassword == password) { + await _saveLoginDetails(username, password); + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => const HomeScreen()), + ); + } else { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Invalid username or password')), + ); + } +} + + + Future googleLogin() async { + try { + final GoogleSignInAccount? googleUser = await _googleSignIn.signIn(); + if (googleUser != null) { + final prefs = await SharedPreferences.getInstance(); + await prefs.setString('googleUser', googleUser.displayName ?? 'Google User'); + await prefs.setString('googleEmail', googleUser.email); + + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => const HomeScreen()), + ); + } + } catch (error) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Google Sign-In Failed: $error')), + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Center( + child: SingleChildScrollView( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset( + 'assets/logo.png', + width: 1000, + height: 150, + ), + const SizedBox(height: 40), + InputField( + hintText: 'Username', + icon: Icons.person, + controller: usernameController, + ), + const SizedBox(height: 16), + InputField( + hintText: 'Password', + icon: Icons.lock, + obscureText: true, + controller: passwordController, + ), + const SizedBox(height: 16), + + /// Remember Me Checkbox - Centered + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Checkbox( + value: rememberMe, + onChanged: (value) { + setState(() { + rememberMe = value ?? false; + }); + }, + activeColor: Colors.grey[800], + ), + const Text( + 'Remember Me', + style: TextStyle( + color: Colors.black87, + fontSize: 16, + ), + ), + ], + ), + const SizedBox(height: 24), + + /// Login Button + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Colors.grey[800], + foregroundColor: Colors.white, + minimumSize: const Size.fromHeight(50), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + onPressed: login, + child: const Text('Login', style: TextStyle(fontSize: 18)), + ), + const SizedBox(height: 16), + + /// Horizontal Line with "or" + Row( + children: const [ + Expanded( + child: Divider(color: Colors.grey, thickness: 1), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: Text("or", style: TextStyle(color: Colors.grey, fontSize: 16)), + ), + Expanded( + child: Divider(color: Colors.grey, thickness: 1), + ), + ], + ), + const SizedBox(height: 16), + + /// Google Sign-In Button (Styled same as Login) + ElevatedButton.icon( + style: ElevatedButton.styleFrom( + backgroundColor: Colors.grey[800], // Match Login Button + foregroundColor: Colors.white, + minimumSize: const Size.fromHeight(50), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + onPressed: googleLogin, + icon: const Icon(Icons.g_mobiledata, size: 30), // Google Icon + label: const Text('Sign in with Google', style: TextStyle(fontSize: 18)), + ), + const SizedBox(height: 20), + + /// Register Text (Styled in Blue) + GestureDetector( + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => const RegisterScreen()), + ); + }, + child: const Text( + "Don't have an account? Register", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.grey, // Better visibility + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/preview_screen.dart b/lib/screens/preview_screen.dart new file mode 100644 index 0000000..0182786 --- /dev/null +++ b/lib/screens/preview_screen.dart @@ -0,0 +1,972 @@ +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:image/image.dart' as img; +import 'package:path_provider/path_provider.dart'; +import 'yolo_detector.dart'; +import 'dart:convert'; // For JSON encoding +import 'dart:math'; +import 'package:shared_preferences/shared_preferences.dart'; + +class PreviewScreen extends StatefulWidget { + final String imagePath; + final List detections; + final int bulletCount; // Add bulletCount parameter + + const PreviewScreen({super.key, required this.imagePath, required this.detections, required this.bulletCount}); + + @override + State createState() => _PreviewScreenState(); +} + +enum PreviewMode { cameraWithDetections, mappedTarget } + +class _PreviewScreenState extends State { + bool _isLoading = true; + PreviewMode _mode = PreviewMode.mappedTarget; + + List _mappedBullets = []; + late List _realImageDetections; + + img.Image? _realImageDecoded; + img.Image? _targetImageDecoded; + Future? _targetImageFuture; + Offset? _targetImageCenterForScoring; + + Uint8List? _cachedTargetImage; + Uint8List? _cachedRealImage; + + final String targetAssetPath = 'assets/target.png'; + + final Offset fixedRingTargetCenter = const Offset(602.51, 600.43); + final Size fixedRingTargetSize = const Size(355.94, 359.27); + + int? _highlightedBulletIndex; + + final List _manualBulletScores = []; + bool _hasMissingBullets = false; + + Color _bulletColor = Colors.blue; // default fallback + double get _bulletOpacity => 0.8; + Color get _bulletColorWithOpacity => _bulletColor.withOpacity(_bulletOpacity); + + + + @override + void initState() { + super.initState(); + _realImageDetections = widget.detections; + _targetImageFuture = _loadAndDecodeTargetImage(); + _loadBulletColor(); // 👈 Add this + _runDetectionAndMapping(); + } + + Future _loadBulletColor() async { + final prefs = await SharedPreferences.getInstance(); + final selectedColor = prefs.getString('bulletColor') ?? 'Blue'; + + setState(() { + _bulletColor = _getColorFromName(selectedColor); + }); +} + +Color _getColorFromName(String colorName) { + switch (colorName.toLowerCase()) { + case 'blue': + return Colors.blue; + case 'green': + return Colors.green; + case 'yellow': + return Colors.yellow; + case 'purple': + return Colors.purple; + case 'cyan': + return Colors.cyan; + case 'teal': + return Colors.teal; + case 'indigo': + return Colors.indigo; + case 'pink': + return Colors.pink; + case 'lime': + return Colors.lime; + case 'mint': + return Colors.greenAccent; + case 'sky': + return Colors.orange; + case 'violet': + return Colors.deepPurpleAccent; + default: + return Colors.blue; // fallback + } +} + + Future _handleMissingBullets() async { + final currentDetected = _mappedBullets.length; + final result = await _showMismatchOptionsDialog(currentDetected); + if (result == 'retry') { + Navigator.pop(context); // Go back to camera screen + } else if (result == 'manual') { + _manualScoreEntry(); + } +} + + + Offset _generatePositionForScore(int score, Offset center) { + const double bulletRadius = 25; + final List rings = [14, 70, 125, 180, 235, 290, 345, 400, 455, 510]; + + final rng = score.clamp(0, 10); + final double distance = rng == 0 ? rings.last + bulletRadius + 5 : rings[10 - rng]; + + final angle = (360 / widget.bulletCount) * (_manualBulletScores.length + 1); + final radians = angle * 3.14159 / 180; + + return Offset( + center.dx + distance * cos(radians), + center.dy + distance * sin(radians), + ); +} + + + + Future _loadAndDecodeTargetImage() async { + final byteData = await rootBundle.load(targetAssetPath); + final bytes = byteData.buffer.asUint8List(); + final tempDir = await getTemporaryDirectory(); + final targetFile = File('${tempDir.path}/target.png'); + await targetFile.writeAsBytes(bytes); + final decoded = img.decodeImage(bytes); + if (decoded != null) { + _targetImageCenterForScoring = Offset(decoded.width / 2, decoded.height / 2 - 1); + } + return decoded; + } + + Future _runDetectionAndMapping() async { + try { + // 1. Read the real image file + final File realImageFile = File(widget.imagePath); + final realBytes = await realImageFile.readAsBytes(); + + // 2. Decode the real image (ensure it's valid) + _realImageDecoded = img.decodeImage(realBytes); + if (_realImageDecoded == null) { + debugPrint("❌ Failed to decode image from path: ${widget.imagePath}"); + setState(() => _isLoading = false); + return; + } + + // 3. Cache decoded image as PNG for rendering + _cachedRealImage = Uint8List.fromList(img.encodePng(_realImageDecoded!)); + + // 4. Find the detected ring center and size + final ringCamData = _getRingCenterSize(_realImageDetections); + if (ringCamData == null) { + debugPrint("⚠️ Ring (classId 2) not detected in real image."); + setState(() => _isLoading = false); + return; + } + + final Offset ringCamCenter = ringCamData['center']; + final Size sizeCam = ringCamData['size']; + + // 5. Extract all bullet centers (classId 0) + final List bulletsCam = _realImageDetections + .where((r) => r.classId == 0) + .map((r) => Offset((r.x1 + r.x2) / 2, (r.y1 + r.y2) / 2)) + .toList(); + + // 6. Map bullets to target and score each one + final List> scoredBullets = bulletsCam.map((bullet) { + final mappedBullet = _mapToTargetNormalized( + bullet, + ringCamCenter, + fixedRingTargetCenter, + sizeCam, + fixedRingTargetSize, + ); + final score = _scoreForBullet( + mappedBullet, + _targetImageCenterForScoring ?? fixedRingTargetCenter, + ); + return {'bullet': mappedBullet, 'score': score}; + }).toList(); + + // 7. Trim to bullet limit by removing highest scoring ones + scoredBullets.sort((a, b) => b['score'].compareTo(a['score'])); + while (scoredBullets.length > widget.bulletCount) { + scoredBullets.removeAt(0); + } + + // 8. Collect final mapped bullets + final List mappedBullets = scoredBullets + .map((e) => e['bullet'] as Offset) + .toList(); + + // 9. Load target background image + _targetImageDecoded = await _targetImageFuture; + if (_targetImageDecoded != null) { + _cachedTargetImage = Uint8List.fromList(img.encodePng(_targetImageDecoded!)); + } + + // 10. Update UI + final missing = widget.bulletCount - mappedBullets.length; + setState(() { + _mappedBullets = mappedBullets; + _isLoading = false; + _hasMissingBullets = missing > 0; + }); + + } catch (e, stack) { + debugPrint("❌ Error during detection mapping: $e"); + debugPrint(stack.toString()); + setState(() => _isLoading = false); + } +} + + +Future _showMismatchOptionsDialog(int detectedCount) async { + return showDialog( + context: context, + builder: (context) { + final missing = widget.bulletCount - detectedCount; + return AlertDialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + title: const Text( + 'Bullet Count Mismatch', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + content: Text( + 'Detected $detectedCount bullet(s), expected ${widget.bulletCount}.\n' + 'You can retry detection or manually add the ${missing.abs()} missing shot(s).', + style: const TextStyle(color: Colors.white70), + ), + contentPadding: const EdgeInsets.fromLTRB(24, 20, 24, 12), + actionsPadding: const EdgeInsets.only(bottom: 16, left: 16, right: 16), + actions: [ + Row( + children: [ + Expanded( + child: ElevatedButton( + onPressed: () => Navigator.pop(context, 'retry'), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.redAccent, + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Icon(Icons.restart_alt, color: Colors.white), + ), + ), + const SizedBox(width: 16), + Expanded( + child: ElevatedButton( + onPressed: () => Navigator.pop(context, 'manual'), + style: ElevatedButton.styleFrom( + backgroundColor: _bulletColor, + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Icon(Icons.edit, color: Colors.white), + ), + ), + ], + ), + ], + ); + }, + ); +} + +void _manualScoreEntry() { + final missingCount = widget.bulletCount - _mappedBullets.length; + final controllers = List.generate(missingCount, (_) => TextEditingController()); + + showDialog( + context: context, + builder: (context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Text( + 'Enter Missing Bullet Scores', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + const SizedBox(height: 20), + ConstrainedBox( + constraints: const BoxConstraints(maxHeight: 300), + child: SingleChildScrollView( + child: Column( + children: List.generate(missingCount, (index) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 6), + child: TextField( + controller: controllers[index], + keyboardType: TextInputType.number, + style: const TextStyle(color: Colors.white), + decoration: InputDecoration( + labelText: 'Bullet Score ${_mappedBullets.length + index + 1}', + labelStyle: const TextStyle(color: Colors.white54), + filled: true, + fillColor: Colors.grey[800], + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide.none, + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide(color: _bulletColor), + ), + ), + ), + ); + }), + ), + ), + ), + const SizedBox(height: 16), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () { + final scores = controllers.map((c) => int.tryParse(c.text.trim()) ?? 0).toList(); + final center = _targetImageCenterForScoring ?? fixedRingTargetCenter; + + setState(() { + for (final score in scores) { + final offset = _generatePositionForScore(score, center); + _mappedBullets.add(offset); + _manualBulletScores.add(score); + } + }); + + Navigator.pop(context); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.greenAccent[700], + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text('Add Bullets'), + ), + ), + ], + ), + ), + ); + }, + ); +} + + Future _saveTargetData() async { + try { + // Show a dialog to let the user select between a new folder or an existing one + final result = await _showSaveOptionsDialog(); + + if (result == null) return; + + String? selectedFolder; + bool isTournament = false; + + try { + final decoded = jsonDecode(result); + selectedFolder = decoded['folder']; + isTournament = decoded['isTournament'] == true; + } catch (_) { + selectedFolder = result; // Treat plain string as folder name (existing folder) + } + + if (selectedFolder == null) return; + + final directory = await getApplicationDocumentsDirectory(); + final saveDirectory = Directory('${directory.path}/saved_images/$selectedFolder'); + + // Create folder if it doesn't exist + if (!await saveDirectory.exists()) { + await saveDirectory.create(recursive: true); + } + + // Save tournament metadata if applicable + if (isTournament) { + final metadataFile = File('${saveDirectory.path}/metadata.json'); + await metadataFile.writeAsString(jsonEncode({'isTournament': true})); + } + + // Use timestamp for a unique file name + final now = DateTime.now(); + final dateString = "${now.year}-${now.month}-${now.day}"; + final timeString = "${now.hour}-${now.minute}-${now.second}"; + final fileName = "target_${dateString}_$timeString.json"; + final filePath = '${saveDirectory.path}/$fileName'; + + // Prepare target data to save + final targetData = { + 'date': dateString, + 'totalScore': _totalScore, + 'bullets': _mappedBullets.map((b) => {'x': b.dx, 'y': b.dy}).toList(), + }; + + // Write file + final jsonFile = File(filePath); + await jsonFile.writeAsString(jsonEncode(targetData)); + + // Close preview and signal refresh + Navigator.pop(context, true); + } catch (e) { + print("Error saving target data: $e"); + } +} + + + + Future _showSaveOptionsDialog() async { + TextEditingController _controller = TextEditingController(); + bool isNewFolderEnabled = false; + bool isTournament = false; // 👈 new flag + + final directory = await getApplicationDocumentsDirectory(); + final saveDirectory = Directory('${directory.path}/saved_images'); + + final List existingFolders = []; + final folders = saveDirectory.listSync(); + for (var folder in folders) { + if (folder is Directory) { + existingFolders.add(folder.path.split('/').last); + } + } + + String? lastFolderName = existingFolders.isNotEmpty ? existingFolders.last : null; + + return await showDialog( + context: context, + builder: (context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), + child: StatefulBuilder( + builder: (context, setState) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Padding( + padding: EdgeInsets.only(bottom: 16.0), + child: Text( + 'Save Target Data', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + ), + + const Text( + "Select where you'd like to save the data:", + style: TextStyle(color: Colors.white70), + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + + if (lastFolderName != null) ...[ + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () { + Navigator.pop(context, lastFolderName); + }, + style: ElevatedButton.styleFrom( + backgroundColor: _bulletColor, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text("Save to '$lastFolderName'"), + ), + ), + const SizedBox(height: 16), + ], + + // New folder name input + SizedBox( + width: double.infinity, + child: TextField( + controller: _controller, + style: const TextStyle(color: Colors.white), + textAlign: TextAlign.center, + decoration: InputDecoration( + filled: true, + fillColor: Colors.grey[800], + hintText: "Enter a new folder name", + hintStyle: const TextStyle(color: Colors.white54), + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide.none, + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide(color: _bulletColor), + ), + ), + onChanged: (value) { + setState(() { + isNewFolderEnabled = value.trim().isNotEmpty; + }); + }, + ), + ), + const SizedBox(height: 12), + + // Tournament toggle + if (isNewFolderEnabled) ...[ + const SizedBox(height: 12), + GestureDetector( + onTap: () { + setState(() { + isTournament = !isTournament; + }); + }, + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: isTournament ? _bulletColor.withOpacity(0.2) : Colors.grey[850], + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: isTournament ? _bulletColor : Colors.grey[700]!, + width: 1.5, + ), + ), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + child: Center( + child: Text( + isTournament ? 'Tournament Mode 🏆' : 'Mark as Tournament 🏆', + style: TextStyle( + color: isTournament ? _bulletColor : Colors.white70, + fontWeight: FontWeight.w500, + fontSize: 16, + ), + ), + ), + ), + ), + ], + + + const SizedBox(height: 16), + + // Create new folder + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: isNewFolderEnabled + ? () => Navigator.pop( + context, + jsonEncode({ + 'folder': _controller.text.trim(), + 'isTournament': isTournament, + }), + ) + : null, + style: ElevatedButton.styleFrom( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14), + backgroundColor: + isNewFolderEnabled ? _bulletColor : Colors.grey[700], + foregroundColor: Colors.white, + disabledBackgroundColor: Colors.grey[700], + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Create New Folder"), + ), + ), + ], + ); + }, + ), + ), + ); + }, + ); +} + + Map? _getRingCenterSize(List results) { + try { + final ring = results.firstWhere((r) => r.classId == 2); + final cx = (ring.x1 + ring.x2) / 2; + final cy = (ring.y1 + ring.y2) / 2; + final width = ring.x2 - ring.x1; + final height = ring.y2 - ring.y1; + return { + 'center': Offset(cx, cy), + 'size': Size(width, height), + }; + } catch (_) { + return null; + } + } + + Offset _mapToTargetNormalized( + Offset bulletCam, + Offset ringCam, + Offset ringTarget, + Size sizeCam, + Size sizeTarget) { + final normX = (bulletCam.dx - ringCam.dx) / sizeCam.width; + final normY = (bulletCam.dy - ringCam.dy) / sizeCam.height; + final mappedX = normX * sizeTarget.width + ringTarget.dx; + final mappedY = normY * sizeTarget.height + ringTarget.dy; + return Offset(mappedX, mappedY); + } + + int _scoreForBullet(Offset bullet, Offset centerOverride) { + const double bulletRadius = 25; + final double distanceToEdge = (bullet - centerOverride).distance - bulletRadius; + + final List rings = [14, 70, 125, 180, 235, 290, 345, 400, 455, 510]; + + for (int i = 0; i < rings.length; i++) { + if (distanceToEdge <= rings[i]) { + return 10 - i; + } + } + + return 0; + } + + int get _totalScore { + final autoScore = _mappedBullets + .take(widget.bulletCount - _manualBulletScores.length) + .map((b) => _scoreForBullet(b, _targetImageCenterForScoring ?? fixedRingTargetCenter)) + .fold(0, (sum, score) => sum + score); + + final manualScore = _manualBulletScores.fold(0, (a, b) => a + b); + + return autoScore + manualScore; +} + + + @override +Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + backgroundColor: Colors.grey[900], + iconTheme: const IconThemeData(color: Colors.white), + title: const Text( + 'Detection Preview', + style: TextStyle(color: Colors.white), + ), + actions: [ + IconButton( + icon: Icon( + _mode == PreviewMode.mappedTarget ? Icons.camera_alt : Icons.center_focus_strong, + ), + color: Colors.white, + onPressed: () { + setState(() { + _mode = _mode == PreviewMode.mappedTarget + ? PreviewMode.cameraWithDetections + : PreviewMode.mappedTarget; + }); + }, + tooltip: _mode == PreviewMode.mappedTarget + ? "Show Camera Detections" + : "Show Mapped Target", + ), + IconButton( + icon: const Icon(Icons.save), + color: Colors.white, + onPressed: _saveTargetData, + tooltip: "Save Target Data", + ), + ], + ), + body: _isLoading + ? const Center(child: CircularProgressIndicator()) + : Stack( + children: [ + Column( + children: [ + Expanded( + child: LayoutBuilder( + builder: (context, constraints) { + final screenWidth = constraints.maxWidth; + final screenHeight = constraints.maxHeight; + + final displayImage = _mode == PreviewMode.mappedTarget + ? _cachedTargetImage + : _cachedRealImage; + + final imgData = _mode == PreviewMode.mappedTarget + ? _targetImageDecoded + : _realImageDecoded; + + if (displayImage == null || imgData == null) { + return const Center(child: Text("Image not available")); + } + + final imgWidth = imgData.width.toDouble(); + final imgHeight = imgData.height.toDouble(); + final aspectRatio = imgWidth / imgHeight; + final screenAspect = screenWidth / screenHeight; + + double displayWidth, displayHeight, offsetX, offsetY; + + if (aspectRatio > screenAspect) { + displayWidth = screenWidth; + displayHeight = screenWidth / aspectRatio; + offsetX = 0; + offsetY = (screenHeight - displayHeight) / 2; + } else { + displayHeight = screenHeight; + displayWidth = screenHeight * aspectRatio; + offsetY = 0; + offsetX = (screenWidth - displayWidth) / 2; + } + + final scaleX = displayWidth / imgWidth; + final scaleY = displayHeight / imgHeight; + + final imageWidget = Image.memory(displayImage, fit: BoxFit.fill); + + return Stack( + children: [ + Positioned( + left: offsetX, + top: offsetY, + width: displayWidth, + height: displayHeight, + child: imageWidget, + ), + if (_mode == PreviewMode.cameraWithDetections) + ..._realImageDetections.map((d) { + final left = d.x1 * scaleX + offsetX; + final top = d.y1 * scaleY + offsetY; + final width = (d.x2 - d.x1) * scaleX; + final height = (d.y2 - d.y1) * scaleY; + return Positioned( + left: left, + top: top, + width: width, + height: height, + child: Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.green, width: 2), + ), + child: Align( + alignment: Alignment.topLeft, + child: Container( + color: Colors.green.withOpacity(0.5), + padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2), + child: Text( + "ID:${d.classId} ${(d.confidence * 100).toStringAsFixed(1)}%", + style: const TextStyle( + color: Colors.white, + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ), + ); + }).toList(), + if (_mode == PreviewMode.mappedTarget) + ..._mappedBullets.asMap().entries.take(widget.bulletCount).map((entry) { + final index = entry.key; + final b = entry.value; + final dx = b.dx * scaleX + offsetX; + final dy = b.dy * scaleY + offsetY; + final double bulletSize = ((scaleX + scaleY) / 2) * 55; + + final isHighlighted = index == _highlightedBulletIndex; + final isManual = index >= (_mappedBullets.length - _manualBulletScores.length); + + return Positioned( + left: dx - bulletSize / 2, + top: dy - bulletSize / 2, + child: Container( + width: bulletSize, + height: bulletSize, + decoration: BoxDecoration( + color: isManual + ? Colors.red.withOpacity(0.9) + : _bulletColorWithOpacity, + shape: BoxShape.circle, + border: Border.all( + color: isHighlighted ? Colors.red : Colors.black, + width: isHighlighted ? 3 : 1, + ), + ), + ), + ); + }).toList(), + ], + ); + }, + ), + ), + const SizedBox(height: 12), + if (_mappedBullets.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + child: Row( + children: List.generate( + _mappedBullets.length, + (index) { + final bullet = _mappedBullets[index]; + final isManual = index >= (_mappedBullets.length - _manualBulletScores.length); + final score = isManual + ? _manualBulletScores[index - (_mappedBullets.length - _manualBulletScores.length)] + : _scoreForBullet( + bullet, + _targetImageCenterForScoring ?? fixedRingTargetCenter, + ); + final isSelected = _highlightedBulletIndex == index; + + return Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 6), + child: GestureDetector( + onTapDown: (_) => setState(() => _highlightedBulletIndex = index), + onTapUp: (_) => setState(() => _highlightedBulletIndex = null), + onTapCancel: () => setState(() => _highlightedBulletIndex = null), + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + height: 100, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + boxShadow: const [ + BoxShadow( + color: Colors.black26, + offset: Offset(0, 2), + blurRadius: 6), + ], + ), + child: Column( + children: [ + Container( + height: 30, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(16), + topRight: Radius.circular(16), + ), + ), + alignment: Alignment.center, + child: Text( + '${index + 1}', + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14, + color: Colors.black87, + ), + ), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: isSelected + ? Colors.red[400] + : (isManual + ? Colors.red[600] + : _bulletColor), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(16), + bottomRight: Radius.circular(16), + ), + ), + alignment: Alignment.center, + child: Text( + '$score', + style: const TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + ], + ), + ), + ), + ), + ); + }, + ), + ), + ), + const SizedBox(height: 12), + ], + ), + if (_hasMissingBullets) + Positioned( + top: 12, + right: 12, + child: ElevatedButton.icon( + onPressed: _handleMissingBullets, + icon: const Icon(Icons.warning_amber_rounded, color: Colors.white, size: 20), + label: const Text("Fix Bullets", style: TextStyle(color: Colors.white)), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.red[600], + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + elevation: 4, + ), + ), + ), + ], + ), + bottomNavigationBar: BottomAppBar( + color: Colors.grey[900], + child: SizedBox( + height: 56, + child: Center( + child: Text( + "🎯 Total Score: $_totalScore", + style: const TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + ), + ); +} + +} diff --git a/lib/screens/register_screen.dart b/lib/screens/register_screen.dart new file mode 100644 index 0000000..844f7a6 --- /dev/null +++ b/lib/screens/register_screen.dart @@ -0,0 +1,180 @@ +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import '../widgets/input_field.dart'; +import 'login_screen.dart'; + +class RegisterScreen extends StatefulWidget { + const RegisterScreen({super.key}); + + @override + State createState() => _RegisterScreenState(); +} + +class _RegisterScreenState extends State { + final usernameController = TextEditingController(); + final emailController = TextEditingController(); + final passwordController = TextEditingController(); + final confirmPasswordController = TextEditingController(); + + Future register() async { + String username = usernameController.text.trim(); + String email = emailController.text.trim(); + String password = passwordController.text.trim(); + String confirmPassword = confirmPasswordController.text.trim(); + + if (username.isEmpty || email.isEmpty || password.isEmpty || confirmPassword.isEmpty) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('All fields are required')), + ); + return; + } + + if (!RegExp(r'^[^@]+@[^@]+\.[^@]+').hasMatch(email)) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Invalid email format')), + ); + return; + } + + if (password != confirmPassword) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Passwords do not match')), + ); + return; + } + + final prefs = await SharedPreferences.getInstance(); + + // Check if the username or email is already taken + String? existingUser = prefs.getString(username); + String? existingEmail = prefs.getString(email); + if (existingUser != null || existingEmail != null) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Username or Email already exists. Choose another.')), + ); + return; + } + + // Save user credentials in SharedPreferences + await prefs.setString(username, password); + await prefs.setString(email, username); // Store email linked to the username + + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Registration Successful! Please Login')), + ); + + // Redirect to Login Screen + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => const LoginScreen()), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Center( + child: SingleChildScrollView( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + /// Logo + Image.asset( + 'assets/logo.png', + width: 1000, + height: 150, + ), + const SizedBox(height: 40), + + /// Username Field + InputField( + hintText: 'Username', + icon: Icons.person, + controller: usernameController, + ), + const SizedBox(height: 16), + + /// Email Field + InputField( + hintText: 'Email', + icon: Icons.email, + controller: emailController, + ), + const SizedBox(height: 16), + + /// Password Field + InputField( + hintText: 'Password', + icon: Icons.lock, + obscureText: true, + controller: passwordController, + ), + const SizedBox(height: 16), + + /// Confirm Password Field + InputField( + hintText: 'Confirm Password', + icon: Icons.lock, + obscureText: true, + controller: confirmPasswordController, + ), + const SizedBox(height: 24), + + /// Register Button + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Colors.grey[800], // Match Login Button + foregroundColor: Colors.white, + minimumSize: const Size.fromHeight(50), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + onPressed: register, + child: const Text('Register', style: TextStyle(fontSize: 18)), + ), + const SizedBox(height: 16), + + /// Horizontal Line with "or" (optional, in case Google Sign-Up is added) + Row( + children: const [ + Expanded( + child: Divider(color: Colors.grey, thickness: 1), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: Text("or", style: TextStyle(color: Colors.grey, fontSize: 16)), + ), + Expanded( + child: Divider(color: Colors.grey, thickness: 1), + ), + ], + ), + const SizedBox(height: 16), + + /// Login Navigation (Styled in Blue) + GestureDetector( + onTap: () { + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => const LoginScreen()), + ); + }, + child: const Text( + "Already have an account? Login", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.grey, // Styled for better visibility + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart new file mode 100644 index 0000000..8675997 --- /dev/null +++ b/lib/screens/settings_screen.dart @@ -0,0 +1,445 @@ +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class SettingsScreen extends StatefulWidget { + const SettingsScreen({super.key}); + + @override + State createState() => _SettingsScreenState(); +} + +class _SettingsScreenState extends State { + List _cameraIPs = List.generate(6, (index) => 'Not Set'); + + final List _defaultIPs = [ + '192.168.0.134:9081', + '192.168.0.134:9082', + '192.168.0.134:9083', + '192.168.0.134:9084', + '192.168.0.134:9085', + '192.168.0.134:9086', + ]; + + + String _selectedBulletColor = 'Blue'; + final List _bulletColors = [ + 'Blue', + 'Green', + 'Yellow', + 'Purple', + 'Cyan', + 'Teal', + 'Indigo', + 'Pink', + 'Lime', + 'Mint', + 'Sky', + 'Violet', +]; + + @override + void initState() { + super.initState(); + _loadCameraIPs(); + _loadBulletColor(); + _loadBulletColor(); + } + + + Color _getColorFromName(String colorName) { + switch (colorName.toLowerCase()) { + case 'blue': + return Colors.blue; + case 'green': + return Colors.green; + case 'yellow': + return Colors.yellow; + case 'purple': + return Colors.purple; + case 'cyan': + return Colors.cyan; + case 'teal': + return Colors.teal; + case 'indigo': + return Colors.indigo; + case 'pink': + return Colors.pink; + case 'lime': + return Colors.lime; + case 'mint': + return Colors.greenAccent; + case 'sky': + return Colors.orange; + case 'violet': + return Colors.deepPurpleAccent; + default: + return Colors.blue; // fallback + } + } + + Future _loadBulletColor() async { + final prefs = await SharedPreferences.getInstance(); + String savedColor = prefs.getString('bulletColor') ?? 'Blue'; + + // Fallback in case old color is no longer valid + if (!_bulletColors.contains(savedColor)) { + savedColor = 'Blue'; + await prefs.setString('bulletColor', savedColor); + } + + setState(() { + _selectedBulletColor = savedColor; + }); +} + +Future _saveBulletColor(String color) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.setString('bulletColor', color); + setState(() => _selectedBulletColor = color); +} + + + Future _loadCameraIPs() async { + final prefs = await SharedPreferences.getInstance(); + + List tempIPs = []; + + for (int i = 0; i < 6; i++) { + String key = 'cameraIP_${i + 1}'; + String? savedIP = prefs.getString(key); + + // If not saved, use default and write it to prefs + if (savedIP == null) { + await prefs.setString(key, _defaultIPs[i]); + tempIPs.add(_defaultIPs[i]); + } else { + tempIPs.add(savedIP); + } + } + + setState(() { + _cameraIPs = tempIPs; + }); +} + + Future _saveCameraIP(int index, String ip) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.setString('cameraIP_${index + 1}', ip); + _loadCameraIPs(); + } + + Future _clearCameraIP(int index) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.remove('cameraIP_${index + 1}'); + _loadCameraIPs(); + } + + void _editCameraIP(int index) { + TextEditingController controller = TextEditingController( + text: _cameraIPs[index], + ); + + showDialog( + context: context, + builder: (context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), + child: StatefulBuilder( + builder: (context, setState) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "Camera ${index + 1}", + style: const TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + + SizedBox( + width: double.infinity, + child: TextField( + controller: controller, + style: const TextStyle(color: Colors.white), + textAlign: TextAlign.center, + decoration: InputDecoration( + filled: true, + fillColor: Colors.grey[800], + hintText: "Enter Camera IP", + hintStyle: const TextStyle(color: Colors.white54), + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide.none, + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide(color: _getColorFromName(_selectedBulletColor)), + ), + ), + ), + ), + const SizedBox(height: 24), + + // Save Button + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () async { + String newIP = controller.text.trim(); + if (newIP.isNotEmpty) { + await _saveCameraIP(index, newIP); + Navigator.pop(context); + } + }, + style: ElevatedButton.styleFrom( + backgroundColor: _getColorFromName(_selectedBulletColor), + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Save"), + ), + ), + const SizedBox(height: 12), + + // Reset Button + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () async { + await _clearCameraIP(index); + Navigator.pop(context); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.grey[700], + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Reset to Default"), + ), + ), + const SizedBox(height: 12), + + // Cancel Button + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () => Navigator.pop(context), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.grey[800], + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Cancel"), + ), + ), + ], + ); + }, + ), + ), + ); + }, + ); +} + + + @override + Widget build(BuildContext context) { + return Scaffold( + + body: SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16), + child: Column( + children: [ + const SizedBox(height: 8), + _buildBulletColorSelector(), + const SizedBox(height: 16), + + _buildCameraList(), + ], + ), + ), + ); + } + + Widget _buildBulletColorSelector() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Select Bullet Color", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.black87, + ), + ), + const SizedBox(height: 8), + GestureDetector( + onTap: _showBulletColorPopup, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: [ + Container( + width: 16, + height: 16, + margin: const EdgeInsets.only(right: 12), + decoration: BoxDecoration( + color: _getColorFromName(_selectedBulletColor), + shape: BoxShape.circle, + border: Border.all(color: Colors.black26), + ), + ), + Expanded( + child: Text( + _selectedBulletColor, + style: const TextStyle(color: Colors.black87, fontSize: 14), + ), + ), + const Icon(Icons.chevron_right, color: Colors.black54), + ], + ), + ), + ), + ], + ); +} + +void _showBulletColorPopup() { + showDialog( + context: context, + builder: (context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Text( + "Select Bullet Color", + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + const SizedBox(height: 20), + Wrap( + spacing: 12, + runSpacing: 12, + children: _bulletColors.map((colorName) { + final color = _getColorFromName(colorName); + final isSelected = colorName == _selectedBulletColor; + + return GestureDetector( + onTap: () async { + await _saveBulletColor(colorName); + Navigator.of(context).pop(); + }, + child: Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: color, + shape: BoxShape.circle, + border: Border.all( + color: isSelected ? Colors.white : Colors.white24, + width: isSelected ? 3 : 1, + ), + ), + ), + ); + }).toList(), + ), + const SizedBox(height: 20), + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: const Text("Cancel", style: TextStyle(color: Colors.white70)), + ), + ], + ), + ), + ); + }, + ); +} + + Widget _buildCameraList() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Camera Settings", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.black87, + ), + ), + const SizedBox(height: 8), + ...List.generate(6, (index) { + return GestureDetector( + onTap: () => _editCameraIP(index), + child: Container( + margin: const EdgeInsets.symmetric(vertical: 4), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(12), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Camera ${index + 1}", + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black87, + ), + ), + Text( + _cameraIPs[index], + style: const TextStyle(color: Colors.black54), + ), + ], + ), + const Icon(Icons.chevron_right, color: Colors.black45), + ], + ), + ), + ); + }), + ], + ); +} + + +} diff --git a/lib/screens/stream_screen.dart b/lib/screens/stream_screen.dart new file mode 100644 index 0000000..51f7c46 --- /dev/null +++ b/lib/screens/stream_screen.dart @@ -0,0 +1,579 @@ +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:screenshot/screenshot.dart'; +import 'dart:io'; +import 'package:flutter/services.dart'; +import 'package:flutter_mjpeg/flutter_mjpeg.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:image/image.dart' as img; +import 'yolo_detector.dart'; +import 'preview_screen.dart'; +import 'package:wakelock_plus/wakelock_plus.dart'; + +enum ImageFilterType { none, greyscale, invert} + +class CameraStreamScreen extends StatefulWidget { + final int cameraIndex; + + const CameraStreamScreen({super.key, required this.cameraIndex}); + + @override + State createState() => _CameraStreamScreenState(); +} + +class _CameraStreamScreenState extends State with SingleTickerProviderStateMixin { + String? _streamUrl; + bool _isError = false; + bool _isCapturing = false; + final ScreenshotController _screenshotController = ScreenshotController(); + final TransformationController _transformationController = TransformationController(); + ImageFilterType _selectedFilter = ImageFilterType.none; + + + late YOLODetector _yoloDetector; + int _numberOfBullets = 5; + + late AnimationController _zoomAnimController; + Animation? _zoomAnimation; + Matrix4? _originalMatrix; + + Color _bulletColor = Colors.blue; // default/fallback bullet color + + @override + void initState() { + super.initState(); + _loadStreamUrl(); + _loadBulletCount(); + _loadSelectedFilter(); + _loadBulletColor(); // 👈 add this to actually load the saved bullet color + + + YOLODetector.create().then((detector) => _yoloDetector = detector); + + _setSystemBarStyle(); // 👈 set colors + SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); // 👈 show bars + + _keepScreenAwake(); + + _zoomAnimController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 200), + ); + } + + Future _loadBulletColor() async { + final prefs = await SharedPreferences.getInstance(); + final selected = prefs.getString('bulletColor') ?? 'Blue'; + setState(() { + _bulletColor = _getColorFromName(selected); + }); +} + +Color _getColorFromName(String colorName) { + switch (colorName.toLowerCase()) { + case 'blue': + return Colors.blue; + case 'green': + return Colors.green; + case 'yellow': + return Colors.yellow; + case 'purple': + return Colors.purple; + case 'cyan': + return Colors.cyan; + case 'teal': + return Colors.teal; + case 'indigo': + return Colors.indigo; + case 'pink': + return Colors.pink; + case 'lime': + return Colors.lime; + case 'mint': + return Colors.greenAccent; + case 'sky': + return Colors.orange; + case 'violet': + return Colors.deepPurpleAccent; + default: + return Colors.blue; // fallback + } +} + + void _setSystemBarStyle() { + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle( + statusBarColor: Colors.grey[900], // ✅ match your AppBar + statusBarIconBrightness: Brightness.light, // white icons + systemNavigationBarColor: Colors.grey[900], + systemNavigationBarIconBrightness: Brightness.light, + ), + ); +} + + Future _loadSelectedFilter() async { + final prefs = await SharedPreferences.getInstance(); + final index = prefs.getInt('selectedFilter'); + if (index != null && index >= 0 && index < ImageFilterType.values.length) { + setState(() { + _selectedFilter = ImageFilterType.values[index]; + }); + } + } + + Future _keepScreenAwake() async { + try { + await WakelockPlus.enable(); + } catch (e) { + debugPrint("⚠️ Could not keep screen awake: $e"); + } + } + + Future _loadStreamUrl() async { + final prefs = await SharedPreferences.getInstance(); + String? url = prefs.getString('cameraIP_${widget.cameraIndex}'); + + setState(() { + _streamUrl = (url != null && url.trim().isNotEmpty) + ? (url.startsWith(RegExp(r"https?://")) ? url : "http://$url") + : null; + _isError = _streamUrl == null; + }); + } + + Future _loadBulletCount() async { + final prefs = await SharedPreferences.getInstance(); + setState(() { + _numberOfBullets = prefs.getInt('bulletCount') ?? 5; + }); + } + + Future _captureAndPreviewImage() async { + if (_streamUrl == null || _isCapturing) return; + + setState(() => _isCapturing = true); + _originalMatrix = _transformationController.value; + + try { + final targetMatrix = Matrix4.identity()..scale(1.0); + final isZoomedIn = !_matrixEquals(_originalMatrix!, targetMatrix); + + if (isZoomedIn) { + _zoomAnimController.reset(); + _zoomAnimation = Matrix4Tween( + begin: _originalMatrix, + end: targetMatrix, + ).animate(CurvedAnimation( + parent: _zoomAnimController, + curve: Curves.easeOut, + )); + + void updateZoom() { + _transformationController.value = _zoomAnimation!.value; + } + + _zoomAnimController.addListener(updateZoom); + await _zoomAnimController.forward(); + _zoomAnimController.removeListener(updateZoom); + } + + await Future.delayed(const Duration(milliseconds: 100)); + final imageBytes = await _screenshotController.capture(); + if (imageBytes == null || imageBytes.isEmpty) return; + + final decoded = img.decodeImage(imageBytes); + + if (decoded == null) return; + final width = decoded.width; + final height = decoded.height; + final size = width < height ? width : height; + final offsetX = (width - size) ~/ 2; + final offsetY = (height - size) ~/ 2; + final cropped = img.copyCrop(decoded, x: offsetX, y: offsetY, width: size, height: size); + + // Debugging: log the selected filter + debugPrint("📸 Selected filter: $_selectedFilter"); + + // Create the output directory and path + final dir = await getApplicationDocumentsDirectory(); + final path = '${dir.path}/ip_capture_temp.jpg'; + img.Image processed = cropped; + + // Apply the selected filter + switch (_selectedFilter) { + case ImageFilterType.greyscale: + processed = img.grayscale(cropped); + break; + + case ImageFilterType.invert: + processed = invertImage(cropped); // ✅ use your custom invert function + break; + case ImageFilterType.none: + break; + } + + // Save the processed image to a file + final file = File(path)..writeAsBytesSync(img.encodeJpg(processed)); + + // Detect objects in the image using YOLO + final detections = await _yoloDetector.detect(file); + + if (!mounted) return; + + // Navigate to the preview screen + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => PreviewScreen( + imagePath: file.path, + detections: detections, + bulletCount: _numberOfBullets, + ), + ), + ); + } catch (e) { + debugPrint("❌ Capture error: $e"); + if (mounted) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text("Capture failed: $e")), + ); + } + } finally { + _zoomAnimController.reset(); + _zoomAnimation = Matrix4Tween( + begin: _transformationController.value, + end: _originalMatrix!, + ).animate(CurvedAnimation( + parent: _zoomAnimController, + curve: Curves.easeIn, + )); + + void restoreZoom() { + _transformationController.value = _zoomAnimation!.value; + } + + _zoomAnimController.addListener(restoreZoom); + await _zoomAnimController.forward(); + _zoomAnimController.removeListener(restoreZoom); + + setState(() => _isCapturing = false); + } +} + + + img.Image invertImage(img.Image source) { + final result = img.Image.from(source); + for (int y = 0; y < result.height; y++) { + for (int x = 0; x < result.width; x++) { + final pixel = result.getPixel(x, y); + result.setPixelRgb(x, y, 255 - pixel.r, 255 - pixel.g, 255 - pixel.b); + } + } + return result; + } + + bool _matrixEquals(Matrix4 a, Matrix4 b) { + for (int i = 0; i < 16; i++) { + if ((a.storage[i] - b.storage[i]).abs() > 0.001) return false; + } + return true; + } + + void _showBulletDialog() { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), // Increased padding for better spacing + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: EdgeInsets.only(bottom: 16.0), + child: Text( + 'Select the number of bullets', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + Center( + child: Wrap( + alignment: WrapAlignment.center, + spacing: 12, + runSpacing: 12, + children: List.generate(5, (index) { + final bulletNum = index + 1; + final isSelected = _numberOfBullets == bulletNum; + return ElevatedButton( + onPressed: () { + _selectBulletCount(bulletNum); + Navigator.of(context).pop(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: + isSelected ? _bulletColor : Colors.grey[800], + foregroundColor: Colors.white, + padding: + const EdgeInsets.symmetric(horizontal: 20, vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text( + '$bulletNum', + style: TextStyle( + fontSize: 18, + fontWeight: + isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ); + }), + ), + ), + ], + ), + ), + ); + }, + ); + } + + void _showFilterDialog() { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Text( + 'Choose a Filter', + style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 16), + Wrap( + spacing: 12, + runSpacing: 12, + alignment: WrapAlignment.center, + children: ImageFilterType.values.map((f) { + final isSelected = _selectedFilter == f; + final label = f.toString().split('.').last; + return ElevatedButton( + onPressed: () async { + setState(() { + _selectedFilter = f; + }); + final prefs = await SharedPreferences.getInstance(); + await prefs.setInt('selectedFilter', f.index); // Save filter index + Navigator.of(context).pop(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: isSelected ? _bulletColor : Colors.grey[800], + foregroundColor: Colors.white, + ), + child: Text(label[0].toUpperCase() + label.substring(1)), + ); + }).toList(), + ), + ], + ), + ), + ); + }, + ); +} + + void _selectBulletCount(int number) async { + final prefs = await SharedPreferences.getInstance(); + setState(() { + _numberOfBullets = number; + }); + await prefs.setInt('bulletCount', number); + } + + @override +void dispose() { + _zoomAnimController.dispose(); + _yoloDetector.close(); + _restoreScreenSettings(); + + _setSystemBarStyle(); // restore grey[900] on back + + super.dispose(); +} + + + Future _restoreScreenSettings() async { + try { + await WakelockPlus.disable(); + } catch (e) { + debugPrint("⚠️ Could not restore screen settings: $e"); + } + } + + ColorFilter _buildColorFilter() { + switch (_selectedFilter) { + case ImageFilterType.greyscale: + return const ColorFilter.matrix([ + 0.2126, 0.7152, 0.0722, 0, 0, + 0.2126, 0.7152, 0.0722, 0, 0, + 0.2126, 0.7152, 0.0722, 0, 0, + 0, 0, 0, 1, 0, + ]); + case ImageFilterType.invert: + return const ColorFilter.matrix([ + -1, 0, 0, 0, 255, + 0, -1, 0, 0, 255, + 0, 0, -1, 0, 255, + 0, 0, 0, 1, 0, + ]); + default: + return const ColorFilter.mode(Colors.transparent, BlendMode.dst); + } +} + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("Target ${widget.cameraIndex}"), + backgroundColor: Colors.grey[900], + foregroundColor: Colors.white, + leading: IconButton( + icon: const Icon(Icons.arrow_back, color: Colors.white), + onPressed: () => Navigator.pop(context), + ), + actions: [ + IconButton( + icon: Text( + '$_numberOfBullets', + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + onPressed: _showBulletDialog, + ), + IconButton( + icon: const Icon(Icons.filter_alt, color: Colors.white), + onPressed: _showFilterDialog, + ), + const SizedBox(width: 16), + ], + ), + backgroundColor: Colors.black, + body: Stack( + children: [ + Screenshot( + controller: _screenshotController, + child: LayoutBuilder( + builder: (context, constraints) { + return Center( + child: InteractiveViewer( + clipBehavior: Clip.hardEdge, + constrained: false, + boundaryMargin: EdgeInsets.zero, + minScale: 1.0, + maxScale: 5.0, + transformationController: _transformationController, + child: SizedBox( + width: constraints.maxWidth, + height: constraints.maxHeight, + child: (_isError || _streamUrl == null) + ? _buildErrorContent() + : RepaintBoundary( + child: ColorFiltered( + colorFilter: _buildColorFilter(), + child: Mjpeg( + stream: _streamUrl!, + isLive: true, + fit: BoxFit.contain, + error: (context, error, stackTrace) => _buildErrorContent(), + ), + ), + ), + ), + ), + ); + }, + ), + ), + + if (_isCapturing) + Positioned.fill( + child: Container( + color: Colors.black.withOpacity(0.4), + child: const Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircularProgressIndicator(color: Colors.white), + SizedBox(height: 16), + Text( + "Processing image...", + style: TextStyle(color: Colors.white, fontSize: 16), + ), + ], + ), + ), + ), + ], + ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + floatingActionButton: _isError + ? null + : FloatingActionButton( + backgroundColor: Colors.white, + onPressed: _captureAndPreviewImage, + child: const Icon(Icons.camera_alt, color: Colors.black), + ), + bottomNavigationBar: BottomAppBar( + color: Colors.grey[900], + shape: const CircularNotchedRectangle(), + notchMargin: 8.0, + child: SizedBox( + height: 60, + child: Stack( + alignment: Alignment.center, + children: [ + Align( + alignment: Alignment.center, + ), + ], + ), + ), + ), + ); + } + + Widget _buildErrorContent() { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(Icons.error, color: Colors.red, size: 100), + const SizedBox(height: 20), + const Text( + "Unable to load camera stream", + style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 10), + ElevatedButton( + onPressed: _loadStreamUrl, + child: const Text("Retry"), + ), + ], + ); + } +} diff --git a/lib/screens/target_screen.dart b/lib/screens/target_screen.dart new file mode 100644 index 0000000..9ab7272 --- /dev/null +++ b/lib/screens/target_screen.dart @@ -0,0 +1,118 @@ +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'stream_screen.dart'; // Import the camera stream screen + +class TargetScreen extends StatefulWidget { + const TargetScreen({super.key}); + + @override + State createState() => _TargetScreenState(); +} + +class _TargetScreenState extends State { + List _cameraButtonsEnabled = List.generate(6, (_) => false); // Initially, all buttons are disabled + + @override + void initState() { + super.initState(); + _loadCameraData(); + } + + /// Load the camera IPs from SharedPreferences and update button status + Future _loadCameraData() async { + final prefs = await SharedPreferences.getInstance(); + final List defaultIPs = [ + '192.168.0.134:9081', + '192.168.0.134:9082', + '192.168.0.134:9083', + '192.168.0.134:9084', + '192.168.0.134:9085', + '192.168.0.134:9086', + ]; + + List cameraDataStatus = List.generate(6, (index) { + String key = 'cameraIP_${index + 1}'; + + if (!prefs.containsKey(key)) { + prefs.setString(key, defaultIPs[index]); + return true; // Default set + } + + String? ip = prefs.getString(key); + return ip != null && ip.isNotEmpty && ip != 'Not Set'; + }); + + if (!mounted) return; + setState(() { + _cameraButtonsEnabled = cameraDataStatus; + }); +} + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 32), + child: Column( + children: [ + Expanded( + child: GridView.builder( + itemCount: 6, + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + mainAxisSpacing: 16, + crossAxisSpacing: 16, + childAspectRatio: 1, // square-ish buttons + ), + itemBuilder: (context, index) { + final isEnabled = _cameraButtonsEnabled[index]; + return InkWell( + onTap: isEnabled + ? () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CameraStreamScreen(cameraIndex: index + 1), + ), + ); + } + : null, + borderRadius: BorderRadius.circular(16), + child: Container( + decoration: BoxDecoration( + color: isEnabled ? Colors.grey[900] : Colors.grey[300], + borderRadius: BorderRadius.circular(16), + ), + padding: const EdgeInsets.all(16), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.videocam_rounded, + color: isEnabled ? Colors.white : Colors.grey[500], + size: 36, + ), + const SizedBox(height: 12), + Text( + "Target ${index + 1}", + textAlign: TextAlign.center, + style: TextStyle( + color: isEnabled ? Colors.white : Colors.grey[600], + fontSize: 20, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + ); + }, + ), + ), + ], + ), + ), + ); +} + +} diff --git a/lib/screens/target_view.dart b/lib/screens/target_view.dart new file mode 100644 index 0000000..8a3be6d --- /dev/null +++ b/lib/screens/target_view.dart @@ -0,0 +1,515 @@ +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'dart:convert'; +import 'package:image/image.dart' as img; +import 'package:shared_preferences/shared_preferences.dart'; + +class TargetViewScreen extends StatefulWidget { + final List jsonFiles; + final Function refreshFolders; + final bool isCombinedView; + + const TargetViewScreen({ + super.key, + required this.jsonFiles, + required this.refreshFolders, + this.isCombinedView = false, + }); + + @override + State createState() => _TargetViewScreenState(); +} + +class _TargetViewScreenState extends State { + int _currentIndex = 0; + List _bullets = []; + int _totalScore = 0; + Offset? _targetCenter; + Uint8List? _targetImageBytes; + img.Image? _targetImageDecoded; + String _date = ''; + int? _highlightedBulletIndex; + int? _pressedScoreGroup; + late String _targetFilePath; + + final String targetAssetPath = 'assets/target.png'; + final double bulletSize = 19; + + Color _bulletColor = Colors.blue; // default/fallback bullet color + + + @override + void initState() { + super.initState(); + _loadBulletColor(); // 👈 this will load bullet color + _loadJsonAndImage(); + } + + Future _loadBulletColor() async { + final prefs = await SharedPreferences.getInstance(); + final selectedColor = prefs.getString('bulletColor') ?? 'Blue'; + + setState(() { + _bulletColor = _getColorFromName(selectedColor); + }); +} + + Color _getColorFromName(String colorName) { + switch (colorName.toLowerCase()) { + case 'blue': + return Colors.blue; + case 'green': + return Colors.green; + case 'yellow': + return Colors.yellow; + case 'purple': + return Colors.purple; + case 'cyan': + return Colors.cyan; + case 'teal': + return Colors.teal; + case 'indigo': + return Colors.indigo; + case 'pink': + return Colors.pink; + case 'lime': + return Colors.lime; + case 'mint': + return Colors.greenAccent; + case 'sky': + return Colors.orange; + case 'violet': + return Colors.deepPurpleAccent; + default: + return Colors.blue; // fallback + } +} + + + Future _loadJsonAndImage() async { + try { + final byteData = await rootBundle.load(targetAssetPath); + final bytes = byteData.buffer.asUint8List(); + _targetImageDecoded = img.decodeImage(bytes); + + if (_targetImageDecoded == null) { + print("Failed to decode image."); + return; + } + + _targetImageBytes = Uint8List.fromList(img.encodePng(_targetImageDecoded!)); + _targetCenter = Offset( + _targetImageDecoded!.width / 2, + _targetImageDecoded!.height / 2 - 1, + ); + + final currentFile = widget.jsonFiles[_currentIndex]; + final jsonString = await currentFile.readAsString(); + final data = jsonDecode(jsonString); + + _date = data['date'] ?? 'Unknown Date'; + final bulletsJson = data['bullets'] as List; + _bullets = bulletsJson.map((b) => Offset(b['x'], b['y'])).toList(); + + _targetFilePath = currentFile.path; + + _totalScore = _bullets + .map((b) => _scoreForBullet(b, _targetCenter!)) + .fold(0, (sum, score) => sum + score); + + setState(() {}); + } catch (e) { + print("Error loading JSON or image: $e"); + } + } + + int _scoreForBullet(Offset bullet, Offset center) { + const bulletRadius = 25; + final distance = (bullet - center).distance - bulletRadius; + final rings = [14, 70, 125, 180, 235, 290, 345, 400, 455, 510]; + for (int i = 0; i < rings.length; i++) { + if (distance <= rings[i]) return 10 - i; + } + return 0; + } + + Future _deleteTarget() async { + try { + final file = File(_targetFilePath); + await file.delete(); + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Target deleted')), + ); + widget.refreshFolders(); + Navigator.pop(context); + } catch (e) { + print("Error deleting target: $e"); + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Failed to delete target')), + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + title: Text('📅 $_date', style: const TextStyle(color: Colors.white)), + backgroundColor: Colors.grey[900], + centerTitle: true, + iconTheme: const IconThemeData(color: Colors.white), + actions: [ + IconButton( + icon: const Icon(Icons.delete), + color: Colors.red, + onPressed: () { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.grey[900], + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text( + 'Delete Target', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + const Text( + "Are you sure you want to delete this target?", + style: TextStyle(color: Colors.white70, fontSize: 16), + textAlign: TextAlign.center, + ), + const SizedBox(height: 24), + + // "Yes" Button + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () { + Navigator.of(context).pop(); + _deleteTarget(); // call your delete function + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.redAccent, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Yes, delete"), + ), + ), + const SizedBox(height: 12), + + // "Cancel" Button + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () => Navigator.of(context).pop(), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.grey[800], + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Cancel"), + ), + ), + ], + ), + ), + ); + }, + ); + + }, + ), + ], + ), + body: _targetImageDecoded == null + ? const Center(child: CircularProgressIndicator()) + : Column( + children: [ + Expanded( + child: LayoutBuilder( + builder: (context, constraints) { + final imgWidth = _targetImageDecoded!.width.toDouble(); + final imgHeight = _targetImageDecoded!.height.toDouble(); + final screenWidth = constraints.maxWidth; + final screenHeight = constraints.maxHeight; + + final aspectRatio = imgWidth / imgHeight; + final screenAspect = screenWidth / screenHeight; + + double displayWidth, displayHeight, offsetX, offsetY; + + if (aspectRatio > screenAspect) { + displayWidth = screenWidth; + displayHeight = screenWidth / aspectRatio; + offsetX = 0; + offsetY = (screenHeight - displayHeight) / 2; + } else { + displayHeight = screenHeight; + displayWidth = screenHeight * aspectRatio; + offsetY = 0; + offsetX = (screenWidth - displayWidth) / 2; + } + + final scaleX = displayWidth / imgWidth; + final scaleY = displayHeight / imgHeight; + + return Stack( + children: [ + Positioned( + left: offsetX, + top: offsetY, + width: displayWidth, + height: displayHeight, + child: Image.memory(_targetImageBytes!, fit: BoxFit.fill), + ), + ..._bullets.asMap().entries.map((entry) { + final i = entry.key; + final bullet = entry.value; + final dx = bullet.dx * scaleX + offsetX; + final dy = bullet.dy * scaleY + offsetY; + final score = _scoreForBullet(bullet, _targetCenter!); + final isHighlighted = widget.isCombinedView + ? (_pressedScoreGroup == score) + : (i == _highlightedBulletIndex); + + return Positioned( + left: dx - bulletSize / 2, + top: dy - bulletSize / 2, + child: Container( + width: bulletSize, + height: bulletSize, + decoration: BoxDecoration( + color: _bulletColor.withOpacity(0.8), + shape: BoxShape.circle, + border: Border.all( + color: isHighlighted ? Colors.red : Colors.black, + width: isHighlighted ? 3 : 1, + ), + ), + ), + ); + }).toList(), + ], + ); + }, + ), + ), + const SizedBox(height: 12), + Container( + color: Colors.white, + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + child: Row( + children: widget.isCombinedView + ? _buildGroupedScoreButtons() + : _buildIndividualScoreButtons(), + ), + ), + const SizedBox(height: 12), + ], + ), + bottomNavigationBar: BottomAppBar( + color: Colors.grey[900], + child: SizedBox( + height: 56, + child: Center( + child: Text( + "🎯 Total Score: $_totalScore", + style: const TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + ), + ); + } + + List _buildGroupedScoreButtons() { + final Map scoreGroups = {}; + for (final bullet in _bullets) { + final score = _scoreForBullet(bullet, _targetCenter!); + scoreGroups[score] = (scoreGroups[score] ?? 0) + 1; + } + + return scoreGroups.entries.map((entry) { + final score = entry.key; + final count = entry.value; + + return Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 6), + child: GestureDetector( + onTapDown: (_) => setState(() => _pressedScoreGroup = score), + onTapUp: (_) => setState(() => _pressedScoreGroup = null), + onTapCancel: () => setState(() => _pressedScoreGroup = null), + child: Container( + height: 100, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black26, + offset: const Offset(0, 2), + blurRadius: 6, + ), + ], + ), + child: Column( + children: [ + Container( + height: 30, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(16), + topRight: Radius.circular(16), + ), + ), + alignment: Alignment.center, + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + '${count}x', + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14, + color: Colors.black87, + ), + ), + ), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: _pressedScoreGroup == score + ? Colors.red[400] + : _bulletColor.withOpacity(0.85), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(16), + bottomRight: Radius.circular(16), + ), + ), + alignment: Alignment.center, + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + '$score', + style: const TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ); + }).toList(); +} + + + List _buildIndividualScoreButtons() { + return List.generate(_bullets.length, (index) { + final bullet = _bullets[index]; + final score = _scoreForBullet(bullet, _targetCenter!); + + return Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 6), + child: GestureDetector( + onTapDown: (_) => setState(() => _highlightedBulletIndex = index), + onTapUp: (_) => setState(() => _highlightedBulletIndex = null), + onTapCancel: () => setState(() => _highlightedBulletIndex = null), + child: Container( + height: 100, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black26, + offset: const Offset(0, 2), + blurRadius: 6, + ), + ], + ), + child: Column( + children: [ + Container( + height: 30, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(16), + topRight: Radius.circular(16), + ), + ), + alignment: Alignment.center, + child: Text( + '${index + 1}', + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14, + color: Colors.black87, + ), + ), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: _highlightedBulletIndex == index + ? Colors.red[400] + : _bulletColor.withOpacity(0.85), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(16), + bottomRight: Radius.circular(16), + ), + ), + alignment: Alignment.center, + child: Text( + '$score', + style: const TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + ], + ), + ), + ), + ), + ); + }); + } +} \ No newline at end of file diff --git a/lib/screens/yolo_detector.dart b/lib/screens/yolo_detector.dart new file mode 100644 index 0000000..9651b42 --- /dev/null +++ b/lib/screens/yolo_detector.dart @@ -0,0 +1,162 @@ +// ======= yolo_detector.dart (updated with imageToInputTensor helper) ======= +import 'dart:io'; +import 'dart:typed_data'; +import 'package:tflite_flutter/tflite_flutter.dart'; +import 'package:image/image.dart' as img; + +class DetectionResult { + final double x1, y1, x2, y2; + final double confidence; + final int classId; + + DetectionResult(this.x1, this.y1, this.x2, this.y2, this.confidence, this.classId); +} + +class CroppedImageResult { + final img.Image image; + final int offsetX; + final int offsetY; + final int cropWidth; + final int cropHeight; + + CroppedImageResult(this.image, this.offsetX, this.offsetY, this.cropWidth, this.cropHeight); +} + +class YOLODetector { + late Interpreter _interpreter; + late int inputWidth, inputHeight; + final double confidenceThreshold = 0.4; + + YOLODetector._create(); + + static Future create() async { + final detector = YOLODetector._create(); + await detector._loadModel(); + return detector; + } + + Future _loadModel() async { + final options = InterpreterOptions()..threads = 2; + _interpreter = await Interpreter.fromAsset('assets/best_float32_nms.tflite', options: options); + + final inputTensor = _interpreter.getInputTensor(0); + final inputShape = inputTensor.shape; + inputHeight = inputShape[1]; + inputWidth = inputShape[2]; + + print("📐 Model input shape: $inputShape"); + print("📦 Model input type: ${inputTensor.type}"); + } + + Future> detect(File imageFile) async { + final bytes = await imageFile.readAsBytes(); + final decodedImage = img.decodeImage(bytes); + if (decodedImage == null) throw Exception("Could not decode image."); + return detectFromImage(decodedImage); + } + + Future> detectFromImage(img.Image originalImage) async { + final croppedResult = cropToModelAspectRatio(originalImage, inputWidth, inputHeight); + final fixedImage = img.bakeOrientation(croppedResult.image); + final inputTensor = imageToInputTensor(fixedImage, inputWidth, inputHeight); + + final inputBuffer = reshapeFloat(inputTensor.toList(), [1, inputHeight, inputWidth, 3]); + + final outputShape = _interpreter.getOutputTensor(0).shape; + final numDetections = outputShape[1]; + final outputBuffer = List.generate(1, (_) => + List.generate(numDetections, (_) => List.filled(6, 0.0))); + + print("🚀 Running inference..."); + _interpreter.run(inputBuffer, outputBuffer); + + final rawDetections = outputBuffer[0]; + final results = []; + + for (var detection in rawDetections) { + final x1 = detection[0]; + final y1 = detection[1]; + final x2 = detection[2]; + final y2 = detection[3]; + final score = detection[4]; + final classId = detection[5].toInt(); + + if (score < confidenceThreshold) continue; + + results.add(DetectionResult( + x1 * croppedResult.cropWidth + croppedResult.offsetX, + y1 * croppedResult.cropHeight + croppedResult.offsetY, + x2 * croppedResult.cropWidth + croppedResult.offsetX, + y2 * croppedResult.cropHeight + croppedResult.offsetY, + score, + classId, + )); + } + + print("🎯 Detections found: ${results.length}"); + return results; + } + + void close() { + _interpreter.close(); + } + + List>>> reshapeFloat(List flat, List dims) { + final d0 = dims[0], d1 = dims[1], d2 = dims[2], d3 = dims[3]; + final reshaped = List.generate(d0, (_) => + List.generate(d1, (_) => + List.generate(d2, (_) => List.filled(d3, 0.0)))); + int index = 0; + for (int i = 0; i < d0; i++) { + for (int j = 0; j < d1; j++) { + for (int k = 0; k < d2; k++) { + for (int l = 0; l < d3; l++) { + reshaped[i][j][k][l] = flat[index++]; + } + } + } + } + return reshaped; + } + + CroppedImageResult cropToModelAspectRatio(img.Image image, int targetWidth, int targetHeight) { + final targetAspectRatio = targetWidth / targetHeight; + final originalAspectRatio = image.width / image.height; + + int cropWidth = image.width; + int cropHeight = image.height; + + if (originalAspectRatio > targetAspectRatio) { + cropWidth = (image.height * targetAspectRatio).toInt(); + } else { + cropHeight = (image.width / targetAspectRatio).toInt(); + } + + final offsetX = ((image.width - cropWidth) / 2).toInt(); + final offsetY = ((image.height - cropHeight) / 2).toInt(); + + final croppedImage = img.copyCrop(image, x: offsetX, y: offsetY, width: cropWidth, height: cropHeight); + + return CroppedImageResult(croppedImage, offsetX, offsetY, cropWidth, cropHeight); + } + + Float32List imageToInputTensor(img.Image inputImage, int width, int height) { + final resized = img.copyResize(inputImage, width: width, height: height); + final Float32List input = Float32List(width * height * 3); + int index = 0; + + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + final pixel = resized.getPixel(x, y); + final r = pixel.r / 255.0; + final g = pixel.g / 255.0; + final b = pixel.b / 255.0; + input[index++] = r; + input[index++] = g; + input[index++] = b; + } + } + + return input; + } +} diff --git a/lib/services/shared_prefs_service.dart b/lib/services/shared_prefs_service.dart new file mode 100644 index 0000000..c3a0d53 --- /dev/null +++ b/lib/services/shared_prefs_service.dart @@ -0,0 +1,15 @@ +import 'package:shared_preferences/shared_preferences.dart'; + +class SharedPrefsService { + static Future saveCameraIPs(List cameraIPs) async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + for (int i = 0; i < 6; i++) { + prefs.setString('camera_$i', cameraIPs[i]); + } + } + + static Future> loadCameraIPs() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + return List.generate(6, (index) => prefs.getString('camera_$index') ?? ''); + } +} diff --git a/lib/services/test.dart b/lib/services/test.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/widgets/bottom_nav.dart b/lib/widgets/bottom_nav.dart new file mode 100644 index 0000000..70e0b01 --- /dev/null +++ b/lib/widgets/bottom_nav.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; + +class BottomNavBar extends StatelessWidget { + final int selectedIndex; + final Function(int) onItemTapped; + + const BottomNavBar({ + super.key, + required this.selectedIndex, + required this.onItemTapped, + }); + + @override +Widget build(BuildContext context) { + return SafeArea( + child: SizedBox( + height: 80, + child: BottomNavigationBar( + backgroundColor: Colors.grey[900], + currentIndex: selectedIndex, + onTap: onItemTapped, + showSelectedLabels: true, + showUnselectedLabels: true, + type: BottomNavigationBarType.fixed, + selectedFontSize: 12, + unselectedFontSize: 12, + selectedItemColor: Colors.white, + unselectedItemColor: Colors.white70, + items: const [ + BottomNavigationBarItem(icon: Icon(Icons.book), label: "Book"), + BottomNavigationBarItem(icon: Icon(Icons.my_location), label: "Shooting"), + BottomNavigationBarItem(icon: Icon(Icons.camera_alt), label: "Camera"), + BottomNavigationBarItem(icon: Icon(Icons.calendar_today), label: "Calendar"), + BottomNavigationBarItem(icon: Icon(Icons.settings), label: "Settings"), + ], + ), + ), + ); +} + +} diff --git a/lib/widgets/input_field.dart b/lib/widgets/input_field.dart new file mode 100644 index 0000000..e93bea5 --- /dev/null +++ b/lib/widgets/input_field.dart @@ -0,0 +1,36 @@ +import 'package:flutter/material.dart'; + +class InputField extends StatelessWidget { + final String hintText; + final IconData icon; + final bool obscureText; + final TextEditingController controller; + + const InputField({ + super.key, + required this.hintText, + required this.icon, + this.obscureText = false, + required this.controller, + }); + + @override + Widget build(BuildContext context) { + return TextField( + controller: controller, + obscureText: obscureText, + style: const TextStyle(color: Colors.grey), // Text inside input field is gray + decoration: InputDecoration( + prefixIcon: Icon(icon, color: Colors.grey), // Icons inside input field are gray + hintText: hintText, + hintStyle: const TextStyle(color: Colors.grey), // Placeholder text is gray + filled: true, + fillColor: Colors.grey[300], // Light gray background for inputs + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide.none, // No border + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..67b025f --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,930 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + sha256: "7dcbd0f87fe5f61cb28da39a1a8b70dbc106e2fe0516f7836eb7bb2948481a12" + url: "https://pub.dev" + source: hosted + version: "4.0.5" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + url: "https://pub.dev" + source: hosted + version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + camera: + dependency: "direct main" + description: + name: camera + sha256: dfa8fc5a1adaeb95e7a54d86a5bd56f4bb0e035515354c8ac6d262e35cec2ec8 + url: "https://pub.dev" + source: hosted + version: "0.10.6" + camera_android: + dependency: transitive + description: + name: camera_android + sha256: "997f19dbdb1bb0e40bdb87265c7e550abea657fe3c4ba3720f81e97b6d4b64dd" + url: "https://pub.dev" + source: hosted + version: "0.10.10+1" + camera_avfoundation: + dependency: transitive + description: + name: camera_avfoundation + sha256: ba48b65a3a97004276ede882e6b838d9667642ff462c95a8bb57ca8a82b6bd25 + url: "https://pub.dev" + source: hosted + version: "0.9.18+11" + camera_platform_interface: + dependency: transitive + description: + name: camera_platform_interface + sha256: "953e7baed3a7c8fae92f7200afeb2be503ff1a17c3b4e4ed7b76f008c2810a31" + url: "https://pub.dev" + source: hosted + version: "2.9.0" + camera_web: + dependency: transitive + description: + name: camera_web + sha256: "595f28c89d1fb62d77c73c633193755b781c6d2e0ebcd8dc25b763b514e6ba8f" + url: "https://pub.dev" + source: hosted + version: "0.3.5" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + collection: + dependency: "direct main" + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + url: "https://pub.dev" + source: hosted + version: "1.3.2" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + url: "https://pub.dev" + source: hosted + version: "0.9.3+2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc" + url: "https://pub.dev" + source: hosted + version: "0.9.4+2" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b" + url: "https://pub.dev" + source: hosted + version: "0.9.3+4" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_exif_rotation: + dependency: "direct main" + description: + name: flutter_exif_rotation + sha256: f581601523bbb7fbec3a0498fe930bf6c48f627d4548d859b2772230edfbe658 + url: "https://pub.dev" + source: hosted + version: "0.5.2" + flutter_hooks: + dependency: transitive + description: + name: flutter_hooks + sha256: b772e710d16d7a20c0740c4f855095026b31c7eb5ba3ab67d2bd52021cd9461d + url: "https://pub.dev" + source: hosted + version: "0.21.2" + flutter_launcher_icons: + dependency: "direct main" + description: + name: flutter_launcher_icons + sha256: bfa04787c85d80ecb3f8777bde5fc10c3de809240c48fa061a2c2bf15ea5211c + url: "https://pub.dev" + source: hosted + version: "0.14.3" + 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_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "5a1e6fb2c0561958d7e4c33574674bda7b77caaca7a33b758876956f2902eea3" + url: "https://pub.dev" + source: hosted + version: "2.0.27" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b + url: "https://pub.dev" + source: hosted + version: "2.0.17" + 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" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "55580f436822d64c8ff9a77e37d61f5fb1e6c7ec9d632a43ee324e2a05c3c6c9" + url: "https://pub.dev" + source: hosted + version: "0.3.3" + google_sign_in: + dependency: "direct main" + description: + name: google_sign_in + sha256: d0a2c3bcb06e607bb11e4daca48bd4b6120f0bbc4015ccebbe757d24ea60ed2a + url: "https://pub.dev" + source: hosted + version: "6.3.0" + google_sign_in_android: + dependency: transitive + description: + name: google_sign_in_android + sha256: "4e52c64366bdb3fe758f683b088ee514cc7a95e69c52b5ee9fc5919e1683d21b" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + google_sign_in_ios: + dependency: transitive + description: + name: google_sign_in_ios + sha256: "29cd125f58f50ceb40e8253d3c0209e321eee3e5df16cd6d262495f7cad6a2bd" + url: "https://pub.dev" + source: hosted + version: "5.8.1" + google_sign_in_platform_interface: + dependency: transitive + description: + name: google_sign_in_platform_interface + sha256: "5f6f79cf139c197261adb6ac024577518ae48fdff8e53205c5373b5f6430a8aa" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + google_sign_in_web: + dependency: transitive + description: + name: google_sign_in_web + sha256: "460547beb4962b7623ac0fb8122d6b8268c951cf0b646dd150d60498430e4ded" + url: "https://pub.dev" + source: hosted + version: "0.12.4+4" + http: + dependency: "direct overridden" + 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" + image: + dependency: "direct main" + description: + name: image + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + url: "https://pub.dev" + source: hosted + version: "4.5.4" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "8bd392ba8b0c8957a157ae0dc9fcf48c58e6c20908d5880aea1d79734df090e9" + url: "https://pub.dev" + source: hosted + version: "0.8.12+22" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" + url: "https://pub.dev" + source: hosted + version: "0.8.12+2" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" + url: "https://pub.dev" + source: hosted + version: "2.10.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + url: "https://pub.dev" + source: hosted + version: "10.0.8" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + url: "https://pub.dev" + source: hosted + version: "3.0.9" + 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" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + 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: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" + url: "https://pub.dev" + source: hosted + version: "8.3.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "0ca7359dad67fd7063cb2892ab0c0737b2daafd807cf1acecd62374c8fae6c12" + url: "https://pub.dev" + source: hosted + version: "2.2.16" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + photo_view: + dependency: "direct main" + description: + name: photo_view + sha256: "1fc3d970a91295fbd1364296575f854c9863f225505c28c46e0a03e48960c75e" + url: "https://pub.dev" + source: hosted + version: "0.15.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + posix: + dependency: transitive + description: + name: posix + sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a + url: "https://pub.dev" + source: hosted + version: "6.0.1" + quiver: + dependency: transitive + description: + name: quiver + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + screenshot: + dependency: "direct main" + description: + name: screenshot + sha256: "63817697a7835e6ce82add4228e15d233b74d42975c143ad8cfe07009fab866b" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "846849e3e9b68f3ef4b60c60cf4b3e02e9321bc7f4d8c4692cf87ffa82fc8a3a" + url: "https://pub.dev" + source: hosted + version: "2.5.2" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "3ec7210872c4ba945e3244982918e502fa2bfb5230dff6832459ca0e1879b7ad" + url: "https://pub.dev" + source: hosted + version: "2.4.8" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + syncfusion_flutter_calendar: + dependency: "direct overridden" + description: + name: syncfusion_flutter_calendar + sha256: "87761c6e73997d8d39181741f9e6244daf29b521aafaccf46b1bf31e86767a3f" + url: "https://pub.dev" + source: hosted + version: "28.2.12" + syncfusion_flutter_core: + dependency: transitive + description: + name: syncfusion_flutter_core + sha256: f1d2b52697543e13bdefdc62d15868124a265987577f53224a7dbe176c8448f0 + url: "https://pub.dev" + source: hosted + version: "28.2.12" + syncfusion_flutter_datepicker: + dependency: transitive + description: + name: syncfusion_flutter_datepicker + sha256: cfc91ebacee63b2c5220e541736f8df211d4f0bfbf34265778862ae20faf094f + url: "https://pub.dev" + source: hosted + version: "28.2.12" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + tflite_flutter: + dependency: "direct main" + description: + name: tflite_flutter + sha256: ffb8651fdb116ab0131d6dc47ff73883e0f634ad1ab12bb2852eef1bbeab4a6a + url: "https://pub.dev" + source: hosted + version: "0.10.4" + timezone: + dependency: transitive + description: + name: timezone + sha256: ffc9d5f4d1193534ef051f9254063fa53d588609418c84299956c3db9383587d + url: "https://pub.dev" + source: hosted + version: "0.10.0" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" + url: "https://pub.dev" + source: hosted + version: "1.1.18" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.dev" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" + url: "https://pub.dev" + source: hosted + version: "1.1.16" + 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: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + wakelock_plus: + dependency: "direct main" + description: + name: wakelock_plus + sha256: b90fbcc8d7bdf3b883ea9706d9d76b9978cb1dfa4351fcc8014d6ec31a493354 + url: "https://pub.dev" + source: hosted + version: "1.2.11" + wakelock_plus_platform_interface: + dependency: transitive + description: + name: wakelock_plus_platform_interface + sha256: "70e780bc99796e1db82fe764b1e7dcb89a86f1e5b3afb1db354de50f2e41eb7a" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + 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: "889a0a678e7c793c308c68739996227c9661590605e70b1f6cf6b9a6634f7aec" + url: "https://pub.dev" + source: hosted + version: "4.10.0" + webview_flutter_android: + dependency: "direct main" + description: + name: webview_flutter_android + sha256: e09150b28a07933839adef0e4a088bb43e8c8d9e6b93025b01882d4067a58ab0 + url: "https://pub.dev" + source: hosted + version: "4.3.4" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + sha256: d937581d6e558908d7ae3dc1989c4f87b786891ab47bb9df7de548a151779d8d + url: "https://pub.dev" + source: hosted + version: "2.10.0" + webview_flutter_wkwebview: + dependency: "direct main" + description: + name: webview_flutter_wkwebview + sha256: c49a98510080378b1525132f407a92c3dcd3b7145bef04fb8137724aadcf1cf0 + url: "https://pub.dev" + source: hosted + version: "3.18.4" + win32: + dependency: transitive + description: + name: win32 + sha256: dc6ecaa00a7c708e5b4d10ee7bec8c270e9276dfcab1783f57e9962d7884305f + url: "https://pub.dev" + source: hosted + version: "5.12.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.7.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..003a3a3 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,58 @@ +name: test1 +description: A new Flutter project. +publish_to: 'none' # This prevents publishing to pub.dev + +version: 1.0.0+1 + +environment: + sdk: '>=3.3.0 <4.0.0' + +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.8 + google_sign_in: ^6.1.5 + shared_preferences: ^2.2.2 + photo_view: ^0.15.0 + screenshot: ^3.0.0 + flutter_mjpeg: ^2.0.0 + webview_flutter: ^4.4.1 + webview_flutter_android: ^4.3.3 + webview_flutter_wkwebview: ^3.7.4 + intl: any + flutter_exif_rotation: any + flutter_launcher_icons: ^0.14.3 + flutter_svg: ^2.0.9 + collection: ^1.17.2 + + tflite_flutter: ^0.10.4 + image: ^4.5.4 + camera: ^0.10.0 + path_provider: ^2.0.15 + image_picker: ^1.0.4 + wakelock_plus: ^1.2.11 + +dependency_overrides: + syncfusion_flutter_calendar: ^28.2.9 + http: ^0.13.6 + + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +flutter_icons: + android: true + ios: true + image_path: "assets/Icon.png" + + +flutter: + uses-material-design: true + assets: + - assets/logo.png + - assets/logo.svg + - assets/target.png + - assets/google_logo.png + - assets/best_float32_nms.tflite diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..1109a73 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:test1/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}