diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..6aa66bb --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# flora-probe + +## Description + +Flutter application for recognizing flowers and plants using machine learning. + +## The project + +... diff --git a/org.floraprobe/.gitignore b/org.floraprobe/.gitignore new file mode 100644 index 0000000..1ba9c33 --- /dev/null +++ b/org.floraprobe/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# 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/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/org.floraprobe/.metadata b/org.floraprobe/.metadata new file mode 100644 index 0000000..6ac2303 --- /dev/null +++ b/org.floraprobe/.metadata @@ -0,0 +1,10 @@ +# 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: f7a6a7906be96d2288f5d63a5a54c515a6e987fe + channel: stable + +project_type: app diff --git a/org.floraprobe/README.md b/org.floraprobe/README.md new file mode 100644 index 0000000..47a2e90 --- /dev/null +++ b/org.floraprobe/README.md @@ -0,0 +1,3 @@ +# floraprobe + +An app which identifies flowers and plants using machine learning diff --git a/org.floraprobe/android/.gitignore b/org.floraprobe/android/.gitignore new file mode 100644 index 0000000..bc2100d --- /dev/null +++ b/org.floraprobe/android/.gitignore @@ -0,0 +1,7 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java diff --git a/org.floraprobe/android/app/build.gradle b/org.floraprobe/android/app/build.gradle new file mode 100644 index 0000000..3fe2d24 --- /dev/null +++ b/org.floraprobe/android/app/build.gradle @@ -0,0 +1,68 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 29 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + aaptOptions { + noCompress 'tflite' + noCompress 'lite' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "org.floraprobe" + minSdkVersion 21 + targetSdkVersion 29 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/org.floraprobe/android/app/src/debug/AndroidManifest.xml b/org.floraprobe/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..881b4ce --- /dev/null +++ b/org.floraprobe/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/org.floraprobe/android/app/src/main/AndroidManifest.xml b/org.floraprobe/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..43189e1 --- /dev/null +++ b/org.floraprobe/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/org.floraprobe/android/app/src/main/kotlin/org/floraprobe/MainActivity.kt b/org.floraprobe/android/app/src/main/kotlin/org/floraprobe/MainActivity.kt new file mode 100644 index 0000000..164d08a --- /dev/null +++ b/org.floraprobe/android/app/src/main/kotlin/org/floraprobe/MainActivity.kt @@ -0,0 +1,6 @@ +package org.floraprobe + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/org.floraprobe/android/app/src/main/res/drawable/launch_background.xml b/org.floraprobe/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/org.floraprobe/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/org.floraprobe/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/org.floraprobe/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/org.floraprobe/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/org.floraprobe/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/org.floraprobe/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/org.floraprobe/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/org.floraprobe/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/org.floraprobe/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/org.floraprobe/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/org.floraprobe/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/org.floraprobe/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/org.floraprobe/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/org.floraprobe/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/org.floraprobe/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/org.floraprobe/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/org.floraprobe/android/app/src/main/res/values/styles.xml b/org.floraprobe/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..1f83a33 --- /dev/null +++ b/org.floraprobe/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/org.floraprobe/android/app/src/profile/AndroidManifest.xml b/org.floraprobe/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..881b4ce --- /dev/null +++ b/org.floraprobe/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/org.floraprobe/android/build.gradle b/org.floraprobe/android/build.gradle new file mode 100644 index 0000000..3100ad2 --- /dev/null +++ b/org.floraprobe/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/org.floraprobe/android/gradle.properties b/org.floraprobe/android/gradle.properties new file mode 100644 index 0000000..38c8d45 --- /dev/null +++ b/org.floraprobe/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/org.floraprobe/android/gradle/wrapper/gradle-wrapper.properties b/org.floraprobe/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..296b146 --- /dev/null +++ b/org.floraprobe/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/org.floraprobe/android/settings.gradle b/org.floraprobe/android/settings.gradle new file mode 100644 index 0000000..5a2f14f --- /dev/null +++ b/org.floraprobe/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/org.floraprobe/assets/images/Flora_bg.png b/org.floraprobe/assets/images/Flora_bg.png new file mode 100755 index 0000000..eb8893d Binary files /dev/null and b/org.floraprobe/assets/images/Flora_bg.png differ diff --git a/org.floraprobe/assets/images/flower.png b/org.floraprobe/assets/images/flower.png new file mode 100644 index 0000000..424b3db Binary files /dev/null and b/org.floraprobe/assets/images/flower.png differ diff --git a/org.floraprobe/assets/images/flower_icon.svg b/org.floraprobe/assets/images/flower_icon.svg new file mode 100644 index 0000000..9128ee3 --- /dev/null +++ b/org.floraprobe/assets/images/flower_icon.svg @@ -0,0 +1,16 @@ + + + +Retro-looking abstract flower patterns in late 60's - early 70's style. + + + + + + + + + + + + \ No newline at end of file diff --git a/org.floraprobe/assets/images/nothing.png b/org.floraprobe/assets/images/nothing.png new file mode 100644 index 0000000..16e1462 Binary files /dev/null and b/org.floraprobe/assets/images/nothing.png differ diff --git a/org.floraprobe/assets/images/scannerAI.svg b/org.floraprobe/assets/images/scannerAI.svg new file mode 100755 index 0000000..6b91dac --- /dev/null +++ b/org.floraprobe/assets/images/scannerAI.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/org.floraprobe/assets/images/scannerXD.svg b/org.floraprobe/assets/images/scannerXD.svg new file mode 100644 index 0000000..87fcc2e --- /dev/null +++ b/org.floraprobe/assets/images/scannerXD.svg @@ -0,0 +1,78 @@ + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.floraprobe/assets/models/flower_model_v1.tflite b/org.floraprobe/assets/models/flower_model_v1.tflite new file mode 100644 index 0000000..0f153a5 Binary files /dev/null and b/org.floraprobe/assets/models/flower_model_v1.tflite differ diff --git a/org.floraprobe/assets/models/label_flowers.txt b/org.floraprobe/assets/models/label_flowers.txt new file mode 100755 index 0000000..d63ab0d --- /dev/null +++ b/org.floraprobe/assets/models/label_flowers.txt @@ -0,0 +1,15 @@ +barberton daisy +butter cup +cape flower +colt's foot +daffodils +daisy +dandelion +frangipani +fritillary +hibiscus +lilly +lotus +passion flower +rose +sunflower \ No newline at end of file diff --git a/org.floraprobe/ios/.gitignore b/org.floraprobe/ios/.gitignore new file mode 100644 index 0000000..e96ef60 --- /dev/null +++ b/org.floraprobe/ios/.gitignore @@ -0,0 +1,32 @@ +*.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/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/org.floraprobe/ios/Flutter/AppFrameworkInfo.plist b/org.floraprobe/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..6b4c0f7 --- /dev/null +++ b/org.floraprobe/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/org.floraprobe/ios/Flutter/Debug.xcconfig b/org.floraprobe/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/org.floraprobe/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/org.floraprobe/ios/Flutter/Release.xcconfig b/org.floraprobe/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/org.floraprobe/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/org.floraprobe/ios/Runner.xcodeproj/project.pbxproj b/org.floraprobe/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ea99d62 --- /dev/null +++ b/org.floraprobe/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,506 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 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 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 = ""; }; + 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 */ + 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 */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 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 = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 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 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 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; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + 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; + 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 */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase 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; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 8.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; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.floraprobe; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + 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; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.floraprobe; + 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; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.floraprobe; + 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 */ + 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/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/org.floraprobe/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/org.floraprobe/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/org.floraprobe/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..a28140c --- /dev/null +++ b/org.floraprobe/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.floraprobe/ios/Runner.xcworkspace/contents.xcworkspacedata b/org.floraprobe/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/org.floraprobe/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/org.floraprobe/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/org.floraprobe/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/org.floraprobe/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/org.floraprobe/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/org.floraprobe/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/org.floraprobe/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/org.floraprobe/ios/Runner/AppDelegate.swift b/org.floraprobe/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/org.floraprobe/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@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/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/org.floraprobe/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/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..28c6bf0 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..2ccbfd9 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..f091b6b Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cde121 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..d0ef06e Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..dcdc230 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..2ccbfd9 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..c8f9ed8 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..a6d6b86 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..a6d6b86 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..75b2d16 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..c4df70d Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..6a84f41 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..d0e1f58 Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/org.floraprobe/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/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/org.floraprobe/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/org.floraprobe/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/org.floraprobe/ios/Runner/Base.lproj/LaunchScreen.storyboard b/org.floraprobe/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/org.floraprobe/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.floraprobe/ios/Runner/Base.lproj/Main.storyboard b/org.floraprobe/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/org.floraprobe/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.floraprobe/ios/Runner/Info.plist b/org.floraprobe/ios/Runner/Info.plist new file mode 100644 index 0000000..decc3a1 --- /dev/null +++ b/org.floraprobe/ios/Runner/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + floraprobe + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + NSCameraUsageDescription + Camera is required to use scanner + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/org.floraprobe/ios/Runner/Runner-Bridging-Header.h b/org.floraprobe/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/org.floraprobe/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/org.floraprobe/lib/main.dart b/org.floraprobe/lib/main.dart new file mode 100644 index 0000000..5735e14 --- /dev/null +++ b/org.floraprobe/lib/main.dart @@ -0,0 +1,48 @@ +import 'package:floraprobe/src/provider/home.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show SystemChrome, DeviceOrientation; +import 'package:provider/provider.dart'; + +import 'src/commons/string_const.dart'; +import 'src/commons/routes.dart'; + +void main() { + // Ensuring that plugin services are initialized. + WidgetsFlutterBinding.ensureInitialized(); + + /// Disables rotation to prevent side effects in Camera preview + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + ]); + + runApp( + MultiProvider( + providers: [ + ChangeNotifierProvider( + // this is the main provider which handles app state + create: (context) => HomeProvider(context), + ), + ], + child: MyApp(), + ), + ); +} + +// This widget is the root of our application. +class MyApp extends StatelessWidget { + final GlobalKey navigatorKey = GlobalKey(); + @override + Widget build(BuildContext context) { + return MaterialApp( + title: Strings.title, + navigatorKey: navigatorKey, + // generates routes for this app + onGenerateRoute: generateRoute, + theme: ThemeData( + /// Yellow swatch is used in theme as it's the first color which comes in mind when + /// thinking about flowers + primarySwatch: Colors.yellow, + ), + ); + } +} diff --git a/org.floraprobe/lib/src/commons/assets.dart b/org.floraprobe/lib/src/commons/assets.dart new file mode 100644 index 0000000..6888e0a --- /dev/null +++ b/org.floraprobe/lib/src/commons/assets.dart @@ -0,0 +1,28 @@ +import 'package:flutter/widgets.dart'; + +/// Image provider as Assets of images which might be +/// used in this application +class AppImageAssets { + static const AssetImage flowerBackground = + const AssetImage('assets/images/Flora_bg.png'); + static const AssetImage flowerIcon = + const AssetImage('assets/images/flower.png'); + static const AssetImage foundNothing = + const AssetImage('assets/images/nothing.png'); + + /// Preloads images before they are used in the app + static void heatImages(BuildContext context) { + precacheImage(flowerBackground, context); + precacheImage(flowerIcon, context); + precacheImage(foundNothing, context); + } +} + +/// String path of models which will be used in application +class ModelAssetPath { + /// The main model which is used in tensor flow lite + static const flower_model = 'assets/models/flower_model_v1.tflite'; + + /// The labels used in [flower_model] + static const flower_labels = 'assets/models/label_flowers.txt'; +} diff --git a/org.floraprobe/lib/src/commons/routes.dart b/org.floraprobe/lib/src/commons/routes.dart new file mode 100644 index 0000000..8057612 --- /dev/null +++ b/org.floraprobe/lib/src/commons/routes.dart @@ -0,0 +1,35 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// consts +import 'string_const.dart'; +// Constant Strings which are all screen's uique path +import 'routing_const.dart'; + +// Screens +import '../ui/screens/home.dart'; + +/// Wraps [screen] with a [PageRoute] +PageRoute wrapPageRoute(Widget screen, + [bool useCupertinoPageRoute = true]) { + if (useCupertinoPageRoute) { + return CupertinoPageRoute(builder: (context) => screen); + } + return MaterialPageRoute( + builder: (context) => screen, + ); +} + +/// Generates Routes which will be used in the application +Route generateRoute(RouteSettings settings) { + switch (settings.name) { + case HomeRoute: + default: + return wrapPageRoute( + // The main homescreen of this application + HomeScreen( + title: Strings.title, + ), + ); + } +} diff --git a/org.floraprobe/lib/src/commons/routing_const.dart b/org.floraprobe/lib/src/commons/routing_const.dart new file mode 100644 index 0000000..1d3c7dc --- /dev/null +++ b/org.floraprobe/lib/src/commons/routing_const.dart @@ -0,0 +1 @@ +const String HomeRoute = '/'; diff --git a/org.floraprobe/lib/src/commons/string_const.dart b/org.floraprobe/lib/src/commons/string_const.dart new file mode 100644 index 0000000..469b6e2 --- /dev/null +++ b/org.floraprobe/lib/src/commons/string_const.dart @@ -0,0 +1,5 @@ +/// All static const strings globally used in this application +class Strings { + /// Application title + static const String title = 'Flora probe'; +} diff --git a/org.floraprobe/lib/src/provider/home.dart b/org.floraprobe/lib/src/provider/home.dart new file mode 100644 index 0000000..6f06e62 --- /dev/null +++ b/org.floraprobe/lib/src/provider/home.dart @@ -0,0 +1,90 @@ +import 'dart:io'; +import 'dart:typed_data'; + +import 'package:camera/camera.dart'; +import 'package:floraprobe/src/commons/assets.dart'; +import 'package:floraprobe/src/ui/components/dialog.dart'; +import 'package:floraprobe/src/utils/probe.dart'; +import 'package:flutter/widgets.dart'; + +enum ScanState { idle, running, completed } + +class HomeProvider extends ChangeNotifier { + CameraDescription _firstCamera; + Uint8List _bytesOfLatestSnappedImage; + ImageProvider _latestSnappedImage; + String _pathOfLatestSnappedImage; + + ImageProvider get latestSnappedImage => _latestSnappedImage; + String get pathOfLatestSnappedImage => _pathOfLatestSnappedImage; + Uint8List get bytesOfLatestSnappedImage => _bytesOfLatestSnappedImage; + + ScanState _state = ScanState.idle; + + ScanState get state => _state; + double _aspectRatio = 16 / 9; + + double get aspectRatio => _aspectRatio ?? 16 / 9; + + setAspectRatio(double aspectRatio) { + _aspectRatio = aspectRatio; + } + + /// Set scan state + void setScanState(ScanState scanstate) { + _state = scanstate; + notifyListeners(); + } + + Future> searchImage( + String imagePath, + CameraController controller, + BuildContext context, + Loading loading) async { + // Starting theatrics + setAspectRatio(controller?.value?.aspectRatio); + try { + final File _imageFile = File(imagePath); + _bytesOfLatestSnappedImage = _imageFile.readAsBytesSync(); + _latestSnappedImage = FileImage( + _imageFile, + ); + await precacheImage(_latestSnappedImage, context); + setScanState(ScanState.running); + } catch (e) { + print(e); + // Dismissing dialog on error + loading.dismiss(); + setScanState(ScanState.idle); + return null; + } + notifyListeners(); + // Runs Model + List results = await Probe().runOnImage(imagePath); + // setScanState(ScanState.completed); // TODO: always show preview before idle. hint => Stay completed + loading.dismiss(); + setScanState(ScanState.idle); + return results; + } + + HomeProvider(BuildContext context) { + init(context); + } + + Future acquireCamera() async { + try { + // Obtain a list of the available cameras on the device. + final cameras = await availableCameras(); + // Get a specific camera from the list of available cameras. + _firstCamera = cameras.first; + return _firstCamera; + } on CameraException { + print('[CameraException] Couldn\'t acquire camera'); + return null; + } + } + + void init(BuildContext context) async { + AppImageAssets.heatImages(context); + } +} diff --git a/org.floraprobe/lib/src/ui/components/CameraView2.dart b/org.floraprobe/lib/src/ui/components/CameraView2.dart new file mode 100644 index 0000000..1b99d9f --- /dev/null +++ b/org.floraprobe/lib/src/ui/components/CameraView2.dart @@ -0,0 +1,114 @@ +import 'dart:async'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:floraprobe/src/provider/home.dart'; +import 'package:floraprobe/src/ui/components/dialog_of_result.dart'; +import 'package:flutter/material.dart'; +import 'package:camera/camera.dart'; +import 'package:path/path.dart' as p; +import 'package:path_provider/path_provider.dart' as pp; +import 'package:provider/provider.dart'; + +import 'dialog.dart'; + +class CameraView extends StatefulWidget { + final List cameras; + final ResultsDialog dialog; + const CameraView({Key key, this.cameras, this.dialog}) : super(key: key); + @override + _CameraViewState createState() => _CameraViewState(); +} + +class _CameraViewState extends State { + CameraController controller; + List cameras; + final Loading loading = Loading(); + + bool hasError = false; + + @override + void initState() { + super.initState(); + acquireCamera(); // Try acquiring available cameras + } + + @override + void dispose() { + controller?.dispose(); + super.dispose(); + } + + Future acquireCamera() async { + try { + cameras = await availableCameras(); + } on CameraException { + print('[CameraException] Couldn\'t acquire camera'); + setState(() { + hasError = true; + }); + return; + } + hasError = false; + controller = CameraController(cameras.first, ResolutionPreset.medium); + controller.initialize().then((_) { + if (!mounted) { + return; + } + setState(() {}); + }); + } + + @override + Widget build(BuildContext context) { + if (hasError) { + // show option to retry + return Center( + child: Icon( + EvaIcons.alertCircleOutline, + color: Colors.red, + ), + ); + } + if (!(controller?.value?.isInitialized ?? false)) { + return Container( + child: Center( + child: CircularProgressIndicator(), + ), + ); + } + return GestureDetector( + onTap: () async { + List res; + loading.show(context); + // Take the Picture in a try / catch block. If anything goes wrong, + // catch the error. + try { + // Construct the path where the image should be saved + // package. + final path = p.join( + // Store the picture in the temp directory. + (await pp.getTemporaryDirectory()).path, + '${DateTime.now()}.png', + ); + + // Attempt to take a picture and log where it's been saved. + await controller.takePicture(path); + res = await Provider.of(context, listen: false) + .searchImage(path, controller, context, loading); + } catch (e) { + // If an error occurs, log the error to the console. + print(e); + } + + // Showing results in dialog + await widget.dialog.show(res); + // Resume camera preview + // Provider.of(context, listen: false) + // .setScanState(ScanState.idle); + }, + child: AspectRatio( + aspectRatio: controller.value.aspectRatio, + child: CameraPreview(controller), + ), + ); + } +} diff --git a/org.floraprobe/lib/src/ui/components/bottomBar.dart b/org.floraprobe/lib/src/ui/components/bottomBar.dart new file mode 100644 index 0000000..d16ffd9 --- /dev/null +++ b/org.floraprobe/lib/src/ui/components/bottomBar.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; + +/// A custom bottom icon button bar +class BottomBar extends StatelessWidget { + final List items; + + /// Creates a custom bottom icon button bar + const BottomBar({Key key, this.items}) : super(key: key); + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(8), + child: SizedBox( + height: 55, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: items, + ), + ), + ); + } +} diff --git a/org.floraprobe/lib/src/ui/components/dialog.dart b/org.floraprobe/lib/src/ui/components/dialog.dart new file mode 100644 index 0000000..55ef7a5 --- /dev/null +++ b/org.floraprobe/lib/src/ui/components/dialog.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +/// A reusable, modal dialog +class Loading { + BuildContext _dialogcontext; + + /// Shows a modal dialog representing loading + show(BuildContext context) { + showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) { + _dialogcontext = context; + return WillPopScope( + onWillPop: () async => false, + child: MediaQuery.removeViewInsets( + removeLeft: true, + removeTop: true, + removeRight: true, + removeBottom: true, + context: context, + child: Center( + child: ConstrainedBox( + constraints: BoxConstraints.tight( + Size.fromRadius(60), + ), + child: Material( + color: Colors.black.withOpacity(0.5), + borderRadius: BorderRadius.circular(25), + child: Center( + child: CircularProgressIndicator(), + ), + ), + ), + ), + ), + ); + }, + ); + } + + /// Dismisses the dialog created by this Object + void dismiss() { + if (_dialogcontext == null) { + return; + } + Navigator.of(_dialogcontext).pop(); + _dialogcontext = null; + } +} diff --git a/org.floraprobe/lib/src/ui/components/dialog_of_result.dart b/org.floraprobe/lib/src/ui/components/dialog_of_result.dart new file mode 100644 index 0000000..7796e5d --- /dev/null +++ b/org.floraprobe/lib/src/ui/components/dialog_of_result.dart @@ -0,0 +1,209 @@ +import 'dart:ui'; + +import 'package:floraprobe/src/commons/assets.dart'; +import 'package:floraprobe/src/provider/home.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; + +/// A reusable, modal dialog +class ResultsDialog { + BuildContext _dialogcontext; + Widget buildOutput(List results) { + Widget child; + if (results?.isEmpty ?? true) { + // No results + child = Container( + /// Box should be square, hence the restriction + constraints: BoxConstraints.tight( + Size(100, 100), + ), + // The illustration to show when list is empty + decoration: BoxDecoration( + image: DecorationImage( + image: AppImageAssets.foundNothing, + ), + ), + ); + child = ConstrainedBox( + // constraints to not let Material expand + constraints: BoxConstraints.tight( + Size(140, 140), + ), + child: Material( + color: Colors.black.withOpacity(0.5), + borderRadius: BorderRadius.circular(25), + child: Center( + child: child, + ), + ), + ); + } else { + print('$results'); + + /// Sample output + /// [{confidence: 0.6125634908676147, index: 10, label: lilly}] + List children = []; + for (var item in results) { + double confidence = item['confidence']; + String label = item['label']; + Widget listItem = Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8), + child: Icon( + Icons.texture, + size: 30, + ), + ), + Padding( + padding: const EdgeInsets.only(left: 4.0, right: 4.0), + child: Text( + label, + style: GoogleFonts.openSans( + fontSize: 20, + color: Colors.white, + fontWeight: FontWeight.w600, + shadows: [ + Shadow( + color: const Color(0x29000000), + offset: Offset(3, 3), + blurRadius: 6, + ) + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 4.0, right: 4.0), + child: Text( + "${(confidence * 100).toString().substring(0, 5)}%", + style: GoogleFonts.openSans( + fontSize: 12, + color: Colors.white, + fontWeight: FontWeight.w600, + shadows: [ + Shadow( + color: const Color(0x29000000), + offset: Offset(3, 3), + blurRadius: 6, + ) + ], + ), + ), + ), + // icon + // Wikipedia reference + ], + ); + listItem = Padding( + padding: + const EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8, right: 8), + child: Material( + elevation: 8, + borderRadius: BorderRadius.circular(10), + color: confidence > 0.75 + ? Colors.green.withOpacity(confidence) + : Colors.yellow.withOpacity(confidence + 0.10), + child: Padding( + padding: const EdgeInsets.only( + top: 15.0, + bottom: 15.0, + ), + child: listItem, + ), + ), + ); + children.add(listItem); + } + child = ListView( + shrinkWrap: true, + physics: BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()), + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + 'Results', + style: GoogleFonts.openSans( + fontSize: 18, + color: const Color(0xfff8f5f5), + fontWeight: FontWeight.w600, + shadows: [ + Shadow( + color: const Color(0x29000000), + offset: Offset(3, 3), + blurRadius: 6, + ) + ], + ), + ), + ), + ...children, + ], + ); + child = ConstrainedBox( + constraints: BoxConstraints( + maxWidth: 250, + maxHeight: (children.length + 1) * 70.0, + ), + child: Material( + color: Colors.white.withOpacity(0.5), + borderRadius: BorderRadius.circular(25), + child: Center( + child: child, + ), + ), + ); + } + return child; + } + + getContext(BuildContext context) { + _dialogcontext = context; + } + + /// Shows a modal dialog representing loading + show(List results) async { + const double _blurSigma = 1.5; + dynamic _res = await showDialog( + context: _dialogcontext, + barrierDismissible: true, + builder: (BuildContext context) { + _dialogcontext = context; + Widget child; + child = buildOutput(results); + return MediaQuery.removeViewInsets( + removeLeft: true, + removeTop: true, + removeRight: true, + removeBottom: true, + context: context, + child: BackdropFilter( + filter: ImageFilter.blur( + sigmaX: _blurSigma, + sigmaY: _blurSigma, + ), + child: Center( + child: child, + ), + ), + ); + }, + ); + await dismiss(); + return _res; + } + + /// Dismisses the dialog created by this Object + Future dismiss() async { + // if (_dialogcontext != null) { + // // Navigator.of(_dialogcontext).pop(); + // _dialogcontext = null; + // } + Provider.of(_dialogcontext).setScanState(ScanState.idle); + return true; + } +} diff --git a/org.floraprobe/lib/src/ui/components/scannerSVG.dart b/org.floraprobe/lib/src/ui/components/scannerSVG.dart new file mode 100644 index 0000000..1123d73 --- /dev/null +++ b/org.floraprobe/lib/src/ui/components/scannerSVG.dart @@ -0,0 +1,85 @@ +// TODO: Add blur in SVG +/// The scanner decoration's .svg data as String. +/// +/// [SvgPicture.string()] of package `package:flutter_svg/svg.dart` is used to parse this data. +/// +/// Note: Drawn in AI, exported from XD, Modified in InkScape +const String scannerSVG = + """ + + + + + image/svg+xml + + + + + + + + + + + +"""; diff --git a/org.floraprobe/lib/src/ui/components/scanner_anim.dart b/org.floraprobe/lib/src/ui/components/scanner_anim.dart new file mode 100644 index 0000000..8f162be --- /dev/null +++ b/org.floraprobe/lib/src/ui/components/scanner_anim.dart @@ -0,0 +1,112 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'scanner_widget.dart'; + +/// Shows scanning animation above child +class ScannerAnimationWrap extends StatefulWidget { + final Widget child; + const ScannerAnimationWrap({Key key, this.child}) : super(key: key); + @override + _ScannerAnimationWrapState createState() => _ScannerAnimationWrapState(); +} + +class _ScannerAnimationWrapState extends State + with SingleTickerProviderStateMixin { + AnimationController _animationController; + bool _animationStopped = false; + String scanText = "Scan"; + bool scanning = false; + + @override + void initState() { + _animationController = new AnimationController( + duration: new Duration(seconds: 1), vsync: this); + + _animationController.addStatusListener((status) { + if (status == AnimationStatus.completed) { + animateScanAnimation(true); + } else if (status == AnimationStatus.dismissed) { + animateScanAnimation(false); + } + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar(middle: Text("Scanning Animation")), + child: SafeArea( + child: Container( + height: double.infinity, + width: double.infinity, + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack(children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: Container( + decoration: BoxDecoration( + border: Border.all(color: CupertinoColors.white), + borderRadius: + BorderRadius.all(Radius.circular(12))), + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(12)), + child: Image( + width: 334, + image: NetworkImage( + "https://images.pexels.com/photos/1841819/pexels-photo-1841819.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260")), + ), + ), + ), + ImageScannerAnimation( + _animationStopped, + 334, + animation: _animationController, + ) + ]), + Padding( + padding: const EdgeInsets.only(top: 32.0), + child: CupertinoButton( + color: CupertinoColors.activeGreen, + onPressed: () { + if (!scanning) { + animateScanAnimation(false); + setState(() { + _animationStopped = false; + scanning = true; + scanText = "Stop"; + }); + } else { + setState(() { + _animationStopped = true; + scanning = false; + scanText = "Scan"; + }); + } + }, + child: Text(scanText), + ), + ) + ])), + ), + ); + } + + void animateScanAnimation(bool reverse) { + if (reverse) { + _animationController.reverse(from: 1.0); + } else { + _animationController.forward(from: 0.0); + } + } + + @override + void dispose() { + _animationController.dispose(); + super.dispose(); + } +} diff --git a/org.floraprobe/lib/src/ui/components/scanner_widget.dart b/org.floraprobe/lib/src/ui/components/scanner_widget.dart new file mode 100644 index 0000000..360b55b --- /dev/null +++ b/org.floraprobe/lib/src/ui/components/scanner_widget.dart @@ -0,0 +1,44 @@ +import 'package:flutter/animation.dart'; +import 'package:flutter/cupertino.dart'; + +class ImageScannerAnimation extends AnimatedWidget { + final bool stopped; + final double width; + + ImageScannerAnimation(this.stopped, this.width, + {Key key, Animation animation}) + : super(key: key, listenable: animation); + + Widget build(BuildContext context) { + final Animation animation = listenable; + final scorePosition = (animation.value * 440) + 16; + + Color color1 = Color(0x5532CD32); + Color color2 = Color(0x0032CD32); + + if (animation.status == AnimationStatus.reverse) { + color1 = Color(0x0032CD32); + color2 = Color(0x5532CD32); + } + + return new Positioned( + bottom: scorePosition, + left: 16.0, + child: new Opacity( + opacity: (stopped) ? 0.0 : 1.0, + child: Container( + height: 60.0, + width: width, + decoration: new BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + stops: [0.1, 0.9], + colors: [color1, color2], + ), + ), + ), + ), + ); + } +} diff --git a/org.floraprobe/lib/src/ui/components/viewport.dart b/org.floraprobe/lib/src/ui/components/viewport.dart new file mode 100644 index 0000000..3cbae16 --- /dev/null +++ b/org.floraprobe/lib/src/ui/components/viewport.dart @@ -0,0 +1,64 @@ +import 'package:floraprobe/src/provider/home.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'CameraView2.dart'; +import 'dialog_of_result.dart'; + +class CameraViewport extends StatelessWidget { + final ResultsDialog resultsDialog = ResultsDialog(); + @override + Widget build(BuildContext context) { + return Consumer(builder: (context, provider, _) { + Widget child; + resultsDialog.getContext(context); + switch (provider.state) { + case ScanState.idle: + // Shows CameraView when ready to scan images. + child = ClipRRect( + borderRadius: BorderRadius.circular(25.0), + child: CameraView( + dialog: resultsDialog, + ), + ); + break; + // Displays the snapped image when processing or showing results. + case ScanState.running: + case ScanState.completed: + child = AspectRatio( + aspectRatio: provider.aspectRatio ?? 16 / 9, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25.0), + image: DecorationImage( + image: provider.latestSnappedImage, + fit: BoxFit.cover, + ), + ), + ), + ); + if (provider.state == ScanState.completed) { + child = GestureDetector( + onTap: () { + provider.setScanState(ScanState.idle); + }, + child: child, + ); + } + break; + } + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Card( + elevation: 20, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.0), + ), + child: child, + ), + ), + ); + }); + } +} diff --git a/org.floraprobe/lib/src/ui/screens/home.dart b/org.floraprobe/lib/src/ui/screens/home.dart new file mode 100644 index 0000000..a458d5d --- /dev/null +++ b/org.floraprobe/lib/src/ui/screens/home.dart @@ -0,0 +1,155 @@ +import 'dart:ui'; + +import 'package:floraprobe/src/commons/assets.dart'; +import 'package:floraprobe/src/provider/home.dart'; +import 'package:floraprobe/src/ui/components/bottomBar.dart'; +import 'package:floraprobe/src/ui/components/scannerSVG.dart'; +import 'package:floraprobe/src/ui/components/viewport.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:provider/provider.dart'; + +/// The main app screen of flora probe +class HomeScreen extends StatelessWidget { + final String title; + + HomeScreen({ + Key key, + this.title, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + const double _size = 40; + Text _appbarTitle = Text( + title, + style: GoogleFonts.dancingScript( + fontSize: _size, + fontWeight: FontWeight.w900, + ), + textAlign: TextAlign.left, + ); + IconButton _searchButton = IconButton( + icon: Icon( + EvaIcons.search, + ), + iconSize: _size, + onPressed: () { + print("Search"); + }, + ); + Widget _cameraViewport = CameraViewport(); + + /// This widget is useless and is just for decoration purposes + Widget _decorationScannerView = Center( + child: SvgPicture.string( + scannerSVG, + allowDrawingOutsideViewBox: true, + ), + ); + + /// This widget is useless and is just for decoration purposes. + /// + /// Instructs user to tap for starting scanning. + Widget _tapInstructionText = Center( + child: Text( + 'Tap to Scan', + style: GoogleFonts.openSans( + fontSize: 18, + color: const Color(0xfff8f5f5), + fontWeight: FontWeight.w600, + shadows: [ + Shadow( + color: const Color(0x29000000), + offset: Offset(3, 3), + blurRadius: 6, + ) + ], + ), + textAlign: TextAlign.center, + ), + ); + Widget _settingsButton = Container( + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.5), + shape: BoxShape.circle, + ), + child: IconButton( + iconSize: _size, + onPressed: () { + print('Settings'); + }, + splashColor: Colors.white, + icon: Icon( + EvaIcons.options2Outline, + color: Colors.white, + ), + ), + ); + Widget _historyButton = IconButton( + iconSize: _size, + onPressed: () { + print('History'); + }, + splashColor: Colors.white, + icon: Container( + height: _size, + width: _size, + decoration: BoxDecoration( + image: DecorationImage( + image: AppImageAssets.flowerIcon, + ), + ), + ), + ); + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AppImageAssets.flowerBackground, + fit: BoxFit.cover, + ), + ), + child: Container( + // filter: ImageFilter.blur(sigmaX: _sigmaX, sigmaY: _sigmaY), + child: Scaffold( + // backgroundColor: const Color(0xfffcffa4), + // backgroundColor: Colors.transparent, + backgroundColor: Colors.black.withOpacity(0.2), + appBar: AppBar( + backgroundColor: Colors.transparent, + elevation: 0, + title: _appbarTitle, + actions: [ + _searchButton, + ], + ), + body: Stack( + children: [ + _cameraViewport, + + /// Hide scanner decoration when running + Visibility( + visible: + Provider.of(context).state == ScanState.idle, + child: _decorationScannerView, + ), + Visibility( + visible: + Provider.of(context).state == ScanState.idle, + child: _tapInstructionText, + ), + ], + ), + bottomNavigationBar: BottomBar( + items: [ + _settingsButton, + _historyButton, + ], + ), + ), + ), + ); + } +} diff --git a/org.floraprobe/lib/src/utils/probe.dart b/org.floraprobe/lib/src/utils/probe.dart new file mode 100644 index 0000000..6f66a90 --- /dev/null +++ b/org.floraprobe/lib/src/utils/probe.dart @@ -0,0 +1,68 @@ +import 'dart:typed_data'; + +import 'package:tflite/tflite.dart'; + +import '../commons/assets.dart'; + +/// Responsible for identifying flora in image using the model +class Probe { + String _res; + + Future load() async { + // Loades our Tflite model + _res = await Tflite.loadModel( + model: ModelAssetPath.flower_model, + labels: ModelAssetPath.flower_labels, + numThreads: 2, // defaults to 1 + isAsset: + true // defaults to true, set to false to load resources outside assets + ); + print('$_res in loading model'); + } + + Future dispose() async { + await Tflite.close(); + } + + /// Runs model on Uint8List. + /// Sample output + /// ```json + /// { + /// index: 0, + /// label: "person", + /// confidence: 0.629 + /// } + /// ``` + Future> run(Uint8List binary) async { + await load(); + var recognitions = await Tflite.runModelOnBinary( + binary: binary, + numResults: 1, // defaults to 5 + threshold: 0.5, // defaults to 0.1 + ); + Tflite.close(); + return recognitions; + } + + /// Runs model on Uint8List. + /// Sample output + /// ```json + /// { + /// index: 0, + /// label: "person", + /// confidence: 0.629 + /// } + /// ``` + Future> runOnImage(String filepath) async { + await load(); + var recognitions = await Tflite.runModelOnImage( + path: filepath, // required + imageMean: 0.0, // defaults to 117.0 + imageStd: 255.0, // defaults to 1.0 + numResults: 1, // defaults to 5 + threshold: 0.5, // defaults to 0.1 + ); + Tflite.close(); + return recognitions; + } +} diff --git a/org.floraprobe/pubspec.lock b/org.floraprobe/pubspec.lock new file mode 100644 index 0000000..2f223c8 --- /dev/null +++ b/org.floraprobe/pubspec.lock @@ -0,0 +1,308 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + adobe_xd: + dependency: "direct main" + description: + name: adobe_xd + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + camera: + dependency: "direct main" + description: + name: camera + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.8+2" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.3" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.14.12" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" + eva_icons_flutter: + dependency: "direct main" + description: + name: eva_icons_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.12" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.6" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.8" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4" + path: + dependency: "direct main" + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.4" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" + path_provider: + dependency: "direct main" + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.9" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+3" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.0" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.2" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.15" + tflite: + dependency: "direct main" + description: + name: tflite + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.6.1" +sdks: + dart: ">=2.7.0 <3.0.0" + flutter: ">=1.17.0 <2.0.0" diff --git a/org.floraprobe/pubspec.yaml b/org.floraprobe/pubspec.yaml new file mode 100644 index 0000000..b782eb9 --- /dev/null +++ b/org.floraprobe/pubspec.yaml @@ -0,0 +1,84 @@ +name: floraprobe +description: An app which identifies flowers and plants using machine learning + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 0.0.1+1 + +environment: + sdk: ">=2.7.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + adobe_xd: ^0.1.4 + provider: ^4.1.2 + camera: ^0.5.8+2 + eva_icons_flutter: ^2.0.0 + google_fonts: ^1.1.0 + tflite: ^1.0.6 + path: ^1.6.4 + path_provider: ^1.6.9 + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + assets: + - assets/images/Flora_bg.png + - assets/images/nothing.png + - assets/images/flower.png + - assets/models/flower_model_v1.tflite + - assets/models/label_flowers.txt + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/org.floraprobe/test/widget_test.dart b/org.floraprobe/test/widget_test.dart new file mode 100644 index 0000000..54e41d4 --- /dev/null +++ b/org.floraprobe/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 that Flutter provides. 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:floraprobe/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(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); + }); +}