diff --git a/android/build.gradle b/android/build.gradle index 16acf69..c3b469e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,13 @@ group 'com.conezi.face_camera' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.8.22' repositories { google() mavenCentral() } - dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -29,8 +28,9 @@ android { if (project.android.hasProperty("namespace")) { namespace 'com.conezi.face_camera' } - compileSdkVersion 34 - + compileSdkVersion 36 + + // Enable Java 8 features compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -50,5 +50,23 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation 'androidx.annotation:annotation:1.6.0' + implementation 'androidx.core:core-ktx:1.10.1' + implementation 'com.google.android.gms:play-services-mlkit-face-detection:17.1.0' + + // CameraX dependencies + def camerax_version = '1.3.0' + implementation "androidx.camera:camera-core:${camerax_version}" + implementation "androidx.camera:camera-camera2:${camerax_version}" + implementation "androidx.camera:camera-lifecycle:${camerax_version}" + implementation "androidx.camera:camera-view:${camerax_version}" + implementation "androidx.camera:camera-extensions:${camerax_version}" + + // Lifecycle components + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' + implementation 'androidx.lifecycle:lifecycle-common-java8:2.6.1' + + // CameraX View class + implementation 'androidx.camera:camera-view:1.3.0' } diff --git a/example/.gitignore b/example/.gitignore index 0fa6b67..3820a95 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -5,9 +5,12 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ +migrate_working_dir/ # IntelliJ related *.iml @@ -24,15 +27,11 @@ **/doc/api/ **/ios/Flutter/.last_build_id .dart_tool/ -.flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ - -# Web related -lib/generated_plugin_registrant.dart +/coverage/ # Symbolication related app.*.symbols diff --git a/example/.metadata b/example/.metadata index 3c3e4b5..5f4336f 100644 --- a/example/.metadata +++ b/example/.metadata @@ -4,7 +4,42 @@ # This file should be version controlled and should not be manually edited. version: - revision: 5464c5bac742001448fe4fc0597be939379f88ea - channel: stable + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + - platform: android + create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + - platform: ios + create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + - platform: linux + create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + - platform: macos + create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + - platform: web + create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + - platform: windows + create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2 + + # 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/example/README.md b/example/README.md index 5f6021e..2b3fce4 100644 --- a/example/README.md +++ b/example/README.md @@ -1,6 +1,6 @@ -# face_camera_example +# example -Demonstrates how to use the face_camera plugin. +A new Flutter project. ## Getting Started @@ -8,9 +8,9 @@ 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://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) +- [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, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, +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/example/analysis_options.yaml b/example/analysis_options.yaml index 61b6c4d..0d29021 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -13,8 +13,7 @@ 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-lang.github.io/linter/lints/index.html. + # 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 diff --git a/example/android/.gitignore b/example/android/.gitignore index 6f56801..be3943c 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -5,9 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index 6279628..0000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - id "dev.flutter.flutter-gradle-plugin" -} - -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - - -android { - namespace "com.conezi.face_camera_example" - compileSdkVersion flutter.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.conezi.face_camera_example" - minSdkVersion 21 - targetSdkVersion flutter.targetSdkVersion - 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 '../..' -} diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts new file mode 100644 index 0000000..21ecea9 --- /dev/null +++ b/example/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +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.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 1e29c5c..399f698 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index f99f728..74a78b9 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,13 +1,13 @@ - - + + + + + + + + diff --git a/example/android/app/src/main/kotlin/com/conezi/face_camera_example/MainActivity.kt b/example/android/app/src/main/kotlin/com/conezi/face_camera_example/MainActivity.kt deleted file mode 100644 index 6034078..0000000 --- a/example/android/app/src/main/kotlin/com/conezi/face_camera_example/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.conezi.face_camera_example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 0000000..ac81bae --- /dev/null +++ b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml index 3db14bb..06952be 100644 --- a/example/android/app/src/main/res/values-night/styles.xml +++ b/example/android/app/src/main/res/values-night/styles.xml @@ -3,7 +3,7 @@ diff --git a/example/android/build.gradle b/example/android/build.gradle deleted file mode 100644 index ec77c10..0000000 --- a/example/android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -//workaround for plugins namespace -subprojects { - afterEvaluate { project -> - if (project.hasProperty('android')) { - project.android { - if (namespace == null) { - namespace project.group - } - } - } - } -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/example/android/build.gradle.kts b/example/android/build.gradle.kts new file mode 100644 index 0000000..dbee657 --- /dev/null +++ b/example/android/build.gradle.kts @@ -0,0 +1,24 @@ +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/example/android/gradle.properties b/example/android/gradle.properties index 94adc3a..f018a61 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index e6b38c2..ac3b479 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#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-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index db7675c..0000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false -} - -include ":app" \ No newline at end of file diff --git a/example/android/settings.gradle.kts b/example/android/settings.gradle.kts new file mode 100644 index 0000000..fb605bc --- /dev/null +++ b/example/android/settings.gradle.kts @@ -0,0 +1,26 @@ +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.9.1" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false +} + +include(":app") diff --git a/example/assets/images/face_net.png b/example/assets/images/face_net.png deleted file mode 100644 index 841b936..0000000 Binary files a/example/assets/images/face_net.png and /dev/null differ diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 7c56964..1dc6cf7 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 12.0 + 13.0 diff --git a/example/ios/Podfile b/example/ios/Podfile index 77be1c3..620e46e 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '15.5.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -29,31 +29,15 @@ flutter_ios_podfile_setup target 'Runner' do use_frameworks! - use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end end - -# add this line: -$iOSVersion = '15.5' # or newer version - post_install do |installer| - # add these lines: - installer.pods_project.build_configurations.each do |config| - config.build_settings["EXCLUDED_ARCHS[sdk=*]"] = "armv7" - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion - end - installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) - - # add these lines: - target.build_configurations.each do |config| - if Gem::Version.new($iOSVersion) > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']) - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion - end - end - end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock deleted file mode 100644 index 2dd766d..0000000 --- a/example/ios/Podfile.lock +++ /dev/null @@ -1,114 +0,0 @@ -PODS: - - camera_avfoundation (0.0.1): - - Flutter - - face_camera (0.0.1): - - Flutter - - Flutter (1.0.0) - - google_mlkit_commons (0.9.0): - - Flutter - - MLKitVision - - google_mlkit_face_detection (0.12.0): - - Flutter - - google_mlkit_commons - - GoogleMLKit/FaceDetection (~> 7.0.0) - - GoogleDataTransport (10.1.0): - - nanopb (~> 3.30910.0) - - PromisesObjC (~> 2.4) - - GoogleMLKit/FaceDetection (7.0.0): - - GoogleMLKit/MLKitCore - - MLKitFaceDetection (~> 6.0.0) - - GoogleMLKit/MLKitCore (7.0.0): - - MLKitCommon (~> 12.0.0) - - GoogleToolboxForMac/Defines (4.2.1) - - GoogleToolboxForMac/Logger (4.2.1): - - GoogleToolboxForMac/Defines (= 4.2.1) - - "GoogleToolboxForMac/NSData+zlib (4.2.1)": - - GoogleToolboxForMac/Defines (= 4.2.1) - - GoogleUtilities/Environment (8.0.2): - - GoogleUtilities/Privacy - - GoogleUtilities/Logger (8.0.2): - - GoogleUtilities/Environment - - GoogleUtilities/Privacy - - GoogleUtilities/Privacy (8.0.2) - - GoogleUtilities/UserDefaults (8.0.2): - - GoogleUtilities/Logger - - GoogleUtilities/Privacy - - GTMSessionFetcher/Core (3.5.0) - - MLImage (1.0.0-beta6) - - MLKitCommon (12.0.0): - - GoogleDataTransport (~> 10.0) - - GoogleToolboxForMac/Logger (< 5.0, >= 4.2.1) - - "GoogleToolboxForMac/NSData+zlib (< 5.0, >= 4.2.1)" - - GoogleUtilities/Logger (~> 8.0) - - GoogleUtilities/UserDefaults (~> 8.0) - - GTMSessionFetcher/Core (< 4.0, >= 3.3.2) - - MLKitFaceDetection (6.0.0): - - MLKitCommon (~> 12.0) - - MLKitVision (~> 8.0) - - MLKitVision (8.0.0): - - GoogleToolboxForMac/Logger (< 5.0, >= 4.2.1) - - "GoogleToolboxForMac/NSData+zlib (< 5.0, >= 4.2.1)" - - GTMSessionFetcher/Core (< 4.0, >= 3.3.2) - - MLImage (= 1.0.0-beta6) - - MLKitCommon (~> 12.0) - - nanopb (3.30910.0): - - nanopb/decode (= 3.30910.0) - - nanopb/encode (= 3.30910.0) - - nanopb/decode (3.30910.0) - - nanopb/encode (3.30910.0) - - PromisesObjC (2.4.0) - -DEPENDENCIES: - - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`) - - face_camera (from `.symlinks/plugins/face_camera/ios`) - - Flutter (from `Flutter`) - - google_mlkit_commons (from `.symlinks/plugins/google_mlkit_commons/ios`) - - google_mlkit_face_detection (from `.symlinks/plugins/google_mlkit_face_detection/ios`) - -SPEC REPOS: - trunk: - - GoogleDataTransport - - GoogleMLKit - - GoogleToolboxForMac - - GoogleUtilities - - GTMSessionFetcher - - MLImage - - MLKitCommon - - MLKitFaceDetection - - MLKitVision - - nanopb - - PromisesObjC - -EXTERNAL SOURCES: - camera_avfoundation: - :path: ".symlinks/plugins/camera_avfoundation/ios" - face_camera: - :path: ".symlinks/plugins/face_camera/ios" - Flutter: - :path: Flutter - google_mlkit_commons: - :path: ".symlinks/plugins/google_mlkit_commons/ios" - google_mlkit_face_detection: - :path: ".symlinks/plugins/google_mlkit_face_detection/ios" - -SPEC CHECKSUMS: - camera_avfoundation: 759172d1a77ae7be0de08fc104cfb79738b8a59e - face_camera: 787c50bc183b37c9b6f9777a1416e5b384b5c234 - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - google_mlkit_commons: 384e4e206e122b6dad430d3158205e0b2fac6789 - google_mlkit_face_detection: ff627695d8eba051db7e0f13f7b20d802df1f84c - GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 - GoogleMLKit: eff9e23ec1d90ea4157a1ee2e32a4f610c5b3318 - GoogleToolboxForMac: d1a2cbf009c453f4d6ded37c105e2f67a32206d8 - GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d - GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 - MLImage: 0ad1c5f50edd027672d8b26b0fee78a8b4a0fc56 - MLKitCommon: 07c2c33ae5640e5380beaaa6e4b9c249a205542d - MLKitFaceDetection: 2a593db4837db503ad3426b565e7aab045cefea5 - MLKitVision: 45e79d68845a2de77e2dd4d7f07947f0ed157b0e - nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 - PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 - -PODFILE CHECKSUM: 251c540b86ac8c2dbf28814f4241a9a0973eacd0 - -COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 02a2dd2..faa8e15 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -8,14 +8,24 @@ /* 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 */; }; - 48E4B76CE6B756A66EB1B9FD /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 40522BA8BA5918187D8063C6 /* Pods_Runner.framework */; }; 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; @@ -30,15 +40,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0CAB0517EA1190F06B296CB7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 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 = ""; }; - 40522BA8BA5918187D8063C6 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; - 92D8FFB6E9378F3BC822909C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.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; }; @@ -46,7 +55,6 @@ 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 = ""; }; - B2BAB4959A30BDE210540C75 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,13 +62,20 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 48E4B76CE6B756A66EB1B9FD /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -78,8 +93,7 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - D8BA30948EE3C25BE4ED4CDC /* Pods */, - BE0DDB5DF9CEBA6EB394DAB1 /* Frameworks */, + 331C8082294A63A400263BE5 /* RunnerTests */, ); sourceTree = ""; }; @@ -87,6 +101,7 @@ isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, ); name = Products; sourceTree = ""; @@ -106,40 +121,36 @@ path = Runner; sourceTree = ""; }; - BE0DDB5DF9CEBA6EB394DAB1 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 40522BA8BA5918187D8063C6 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - D8BA30948EE3C25BE4ED4CDC /* Pods */ = { - isa = PBXGroup; - children = ( - B2BAB4959A30BDE210540C75 /* Pods-Runner.debug.xcconfig */, - 0CAB0517EA1190F06B296CB7 /* Pods-Runner.release.xcconfig */, - 92D8FFB6E9378F3BC822909C /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - 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 = ( - A1244AD42C7D984A57BEA2D8 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 1DD9E7F292D00AC6ADD738E5 /* [CP] Embed Pods Frameworks */, - F230A7FB2012CCCFF84F8BD7 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -156,9 +167,14 @@ 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; @@ -179,11 +195,19 @@ 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; @@ -198,23 +222,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1DD9E7F292D00AC6ADD738E5 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -246,48 +253,17 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - A1244AD42C7D984A57BEA2D8 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - F230A7FB2012CCCFF84F8BD7 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -299,6 +275,14 @@ }; /* 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; @@ -323,6 +307,7 @@ 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++"; @@ -352,7 +337,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - "EXCLUDED_ARCHS[sdk=*]" = armv7; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -361,7 +346,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -376,29 +361,74 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 4J6G3CYQ9U; + DEVELOPMENT_TEAM = K966339N22; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.conezi.faceCameraExample; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; 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.example.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.example.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.example.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 = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -428,7 +458,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - "EXCLUDED_ARCHS[sdk=*]" = armv7; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -443,7 +473,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -455,6 +485,7 @@ 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++"; @@ -484,7 +515,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - "EXCLUDED_ARCHS[sdk=*]" = armv7; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -493,7 +524,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -510,19 +541,16 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 4J6G3CYQ9U; + DEVELOPMENT_TEAM = K966339N22; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.conezi.faceCameraExample; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -536,19 +564,16 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 4J6G3CYQ9U; + DEVELOPMENT_TEAM = K966339N22; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.conezi.faceCameraExample; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -558,6 +583,16 @@ /* 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 = ( diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c53e2b3..e3773d4 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + - - diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift index b636303..6266644 100644 --- a/example/ios/Runner/AppDelegate.swift +++ b/example/ios/Runner/AppDelegate.swift @@ -1,5 +1,5 @@ -import UIKit import Flutter +import UIKit @main @objc class AppDelegate: FlutterAppDelegate { diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf0..7353c41 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd9..797d452 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b..6ed2d93 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde121..4cd7b00 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e..fe73094 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc230..321773c 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd9..797d452 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8..502f463 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b86..0ec3034 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b86..0ec3034 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d16..e9f5fea 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d..84ac32a 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41..8953cba 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f58..0467bf1 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 98034a3..5458fc4 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -2,12 +2,10 @@ - CADisableMinimumFrameDurationOnPhone - CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Face Camera + Example CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - face_camera_example + example CFBundlePackageType APPL CFBundleShortVersionString @@ -26,12 +24,6 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS - NSCameraUsageDescription - Camera permission is required for image upload. - NSMicrophoneUsageDescription - This app needs to be able to access your microphone - UIApplicationSupportsIndirectInputEvents - UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -49,7 +41,9 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - UIViewControllerBasedStatusBarAppearance - + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/example/ios/RunnerTests/RunnerTests.swift b/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/example/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/example/lib/main.dart b/example/lib/main.dart index 4cf5eb3..bfa32c0 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,8 +1,7 @@ import 'dart:io'; -import 'package:flutter/material.dart'; - import 'package:face_camera/face_camera.dart'; +import 'package:flutter/material.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -27,7 +26,7 @@ class _MyAppState extends State { @override void initState() { controller = FaceCameraController( - autoCapture: true, + autoCapture: false, defaultCameraLens: CameraLens.front, onCapture: (File? image) { setState(() => _capturedImage = image); @@ -43,10 +42,9 @@ class _MyAppState extends State { Widget build(BuildContext context) { return MaterialApp( home: Scaffold( - appBar: AppBar( - title: const Text('FaceCamera example app'), - ), - body: Builder(builder: (context) { + appBar: AppBar(title: const Text('FaceCamera example app')), + body: Builder( + builder: (context) { if (_capturedImage != null) { return Center( child: Stack( @@ -58,42 +56,54 @@ class _MyAppState extends State { fit: BoxFit.fitWidth, ), ElevatedButton( - onPressed: () async { - await controller.startImageStream(); - setState(() => _capturedImage = null); - }, - child: const Text( - 'Capture Again', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14, fontWeight: FontWeight.w700), - )) + onPressed: () async { + await controller.startImageStream(); + setState(() => _capturedImage = null); + }, + child: const Text( + 'Capture Again', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + ), + ), + ), ], ), ); } return SmartFaceCamera( - controller: controller, - messageBuilder: (context, face) { - if (face == null) { - return _message('Place your face in the camera'); - } - if (!face.wellPositioned) { - return _message('Center your face in the square'); - } - return const SizedBox.shrink(); - }); - })), + controller: controller, + indicatorShape: IndicatorShape.square, + messageBuilder: (context, face) { + if (face == null) { + return _message('Place your face in the camera'); + } + if (!face.wellPositioned) { + return _message('Center your face in the square'); + } + return const SizedBox.shrink(); + }, + ); + }, + ), + ), ); } Widget _message(String msg) => Padding( - padding: const EdgeInsets.symmetric(horizontal: 55, vertical: 15), - child: Text(msg, - textAlign: TextAlign.center, - style: const TextStyle( - fontSize: 14, height: 1.5, fontWeight: FontWeight.w400)), - ); + padding: const EdgeInsets.symmetric(horizontal: 55, vertical: 15), + child: Text( + msg, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 14, + height: 1.5, + fontWeight: FontWeight.w400, + ), + ), + ); @override void dispose() { diff --git a/example/pubspec.lock b/example/pubspec.lock index d5e2924..2e27dd6 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -21,42 +21,42 @@ packages: dependency: transitive description: name: camera - sha256: "26ff41045772153f222ffffecba711a206f670f5834d40ebf5eed3811692f167" + sha256: eefad89f262a873f38d21e5eec853461737ea074d7c9ede39f3ceb135d201cab url: "https://pub.dev" source: hosted - version: "0.11.0+2" + version: "0.11.3" camera_android_camerax: dependency: transitive description: name: camera_android_camerax - sha256: "59967e6d80df9d682a33b86f228cc524e6b52d6184b84f6ac62151dd98bd1ea0" + sha256: b68b638e5e0ede21155e670493ac568981a8f56c5f636d720935a916a1c5a0ef url: "https://pub.dev" source: hosted - version: "0.6.5+2" + version: "0.6.24" camera_avfoundation: dependency: transitive description: name: camera_avfoundation - sha256: "7d021e8cd30d9b71b8b92b4ad669e80af432d722d18d6aac338572754a786c15" + sha256: "34bcd5db30e52414f1f0783c5e3f566909fab14141a21b3b576c78bd35382bf6" url: "https://pub.dev" source: hosted - version: "0.9.16" + version: "0.9.22+4" camera_platform_interface: dependency: transitive description: name: camera_platform_interface - sha256: a250314a48ea337b35909a4c9d5416a208d736dcb01d0b02c6af122be66660b0 + sha256: ea1ef6ba79cdbed93df2d3eeef11542a90dec24dbcd9cde574926b86d7a09a10 url: "https://pub.dev" source: hosted - version: "2.7.4" + version: "2.11.0" camera_web: dependency: transitive description: name: camera_web - sha256: "9e9aba2fbab77ce2472924196ff8ac4dd8f9126c4f9a3096171cd1d870d6b26c" + sha256: "595f28c89d1fb62d77c73c633193755b781c6d2e0ebcd8dc25b763b514e6ba8f" url: "https://pub.dev" source: hosted - version: "0.3.3" + version: "0.3.5" characters: dependency: transitive description: @@ -85,18 +85,18 @@ packages: dependency: transitive description: name: cross_file - sha256: "7632a2bcddc8cef4afde3c6f80e69b29a7060e176f01119c229fe4eb3a2a3d4f" + sha256: "942a4791cd385a68ccb3b32c71c427aba508a1bb949b86dff2adbe4049f16239" url: "https://pub.dev" source: hosted - version: "0.3.3+1" + version: "0.3.5" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: "1989d917fbe8e6b39806207df5a3fdd3d816cbd090fac2ce26fb45e9a71476e5" + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.8" face_camera: dependency: "direct main" description: @@ -108,10 +108,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -121,18 +121,18 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "5.0.0" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f" + sha256: "306f0596590e077338312f38837f595c04f28d6cdeeac392d3d74df2f0003687" url: "https://pub.dev" source: hosted - version: "2.0.19" + version: "2.0.32" flutter_test: dependency: "direct dev" description: flutter @@ -147,58 +147,50 @@ packages: dependency: transitive description: name: google_mlkit_commons - sha256: "7e9a6d6e66b44aa8cfe944bda9bc3346c52486dd890ca49e5bc98845cda40d7f" + sha256: "8f40fbac10685cad4715d11e6a0d86837d9ad7168684dfcad29610282a88e67a" url: "https://pub.dev" source: hosted - version: "0.9.0" + version: "0.11.0" google_mlkit_face_detection: dependency: transitive description: name: google_mlkit_face_detection - sha256: "65988405c884fd84a4ccc8bded7b5e3e4c33362f6f4eaaa94818bdaaba7bab7d" + sha256: f336737d5b8a86797fd4368f42a5c26aeaa9c6dcc5243f0a16b5f6f663cfb70a url: "https://pub.dev" source: hosted - version: "0.12.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" + version: "0.13.1" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: name: lints - sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "5.1.1" matcher: dependency: transitive description: @@ -219,10 +211,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" path: dependency: transitive description: @@ -272,10 +264,10 @@ packages: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -296,26 +288,34 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.7" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "1.1.1" sdks: - dart: ">=3.7.0-0 <4.0.0" - flutter: ">=3.19.0" + dart: ">=3.9.2 <4.0.0" + flutter: ">=3.35.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 6630bc1..56f68cb 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,12 +1,25 @@ -name: face_camera_example -description: Demonstrates how to use the face_camera plugin. - +name: example +description: "A new Flutter project." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + environment: - sdk: ">=2.16.2 <3.0.0" + sdk: ^3.9.2 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -18,6 +31,7 @@ dependencies: flutter: sdk: flutter + face_camera: # When depending on this package from a real application you should use: # face_camera: ^x.y.z @@ -28,7 +42,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.8 dev_dependencies: flutter_test: @@ -39,12 +53,12 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^1.0.0 + flutter_lints: ^5.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec -# The following section is specific to Flutter. +# The following section is specific to Flutter packages. flutter: # The following line ensures that the Material Icons font is @@ -56,14 +70,12 @@ flutter: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg - assets: - - assets/images/ # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. + # https://flutter.dev/to/resolution-aware-images # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages + # https://flutter.dev/to/asset-from-package # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a @@ -83,4 +95,4 @@ flutter: # weight: 700 # # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + # see https://flutter.dev/to/font-from-package diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index e1aac96..092d222 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -1,27 +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 +// 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:face_camera_example/main.dart'; +import 'package:example/main.dart'; void main() { - testWidgets('Verify Platform version', (WidgetTester tester) async { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(const MyApp()); - // Verify that platform version is retrieved. - expect( - find.byWidgetPredicate( - (Widget widget) => - widget is Text && widget.data!.startsWith('Running on:'), - ), - findsOneWidget, - ); + // 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); }); } diff --git a/lib/src/controllers/face_camera_controller.dart b/lib/src/controllers/face_camera_controller.dart index 36a86b3..5b21522 100644 --- a/lib/src/controllers/face_camera_controller.dart +++ b/lib/src/controllers/face_camera_controller.dart @@ -76,35 +76,44 @@ class FaceCameraController extends ValueNotifier { } value = value.copyWith( - availableCameraLens: availableCameraLens, - currentCameraLens: currentCameraLens); + availableCameraLens: availableCameraLens, + currentCameraLens: currentCameraLens, + ); } Future _initCamera() async { final cameras = FaceCamera.cameras - .where((c) => - c.lensDirection == - EnumHandler.cameraLensToCameraLensDirection( - value.availableCameraLens[value.currentCameraLens])) + .where( + (c) => + c.lensDirection == + EnumHandler.cameraLensToCameraLensDirection( + value.availableCameraLens[value.currentCameraLens], + ), + ) .toList(); if (cameras.isNotEmpty) { - final cameraController = CameraController(cameras.first, - EnumHandler.imageResolutionToResolutionPreset(imageResolution), - enableAudio: enableAudio, - imageFormatGroup: Platform.isAndroid - ? ImageFormatGroup.nv21 - : ImageFormatGroup.bgra8888); + final cameraController = CameraController( + cameras.first, + EnumHandler.imageResolutionToResolutionPreset(imageResolution), + enableAudio: enableAudio, + imageFormatGroup: Platform.isAndroid + ? ImageFormatGroup.yuv420 + : ImageFormatGroup.bgra8888, + ); await cameraController.initialize().whenComplete(() { value = value.copyWith( - isInitialized: true, cameraController: cameraController); + isInitialized: true, + cameraController: cameraController, + ); }); await changeFlashMode(value.availableFlashMode.indexOf(defaultFlashMode)); await cameraController.lockCaptureOrientation( - EnumHandler.cameraOrientationToDeviceOrientation(orientation)); + EnumHandler.cameraOrientationToDeviceOrientation(orientation), + ); } startImageStream(); @@ -114,11 +123,14 @@ class FaceCameraController extends ValueNotifier { final newIndex = index ?? (value.currentFlashMode + 1) % value.availableFlashMode.length; await value.cameraController! - .setFlashMode(EnumHandler.cameraFlashModeToFlashMode( - value.availableFlashMode[newIndex])) + .setFlashMode( + EnumHandler.cameraFlashModeToFlashMode( + value.availableFlashMode[newIndex], + ), + ) .then((_) { - value = value.copyWith(currentFlashMode: newIndex); - }); + value = value.copyWith(currentFlashMode: newIndex); + }); } /// The supplied [zoom] value should be between 1.0 and the maximum supported @@ -132,8 +144,9 @@ class FaceCameraController extends ValueNotifier { Future changeCameraLens() async { value = value.copyWith( - currentCameraLens: - (value.currentCameraLens + 1) % value.availableCameraLens.length); + currentCameraLens: + (value.currentCameraLens + 1) % value.availableCameraLens.length, + ); _initCamera(); } @@ -188,10 +201,10 @@ class FaceCameraController extends ValueNotifier { value = value.copyWith(alreadyCheckingImage: true); try { await FaceIdentifier.scanImage( - cameraImage: cameraImage, - controller: cameraController, - performanceMode: performanceMode) - .then((result) async { + cameraImage: cameraImage, + controller: cameraController, + performanceMode: performanceMode, + ).then((result) async { value = value.copyWith(detectedFace: result); if (result != null) { @@ -238,7 +251,7 @@ class FaceCameraController extends ValueNotifier { } } -/* void onViewFinderTap(TapDownDetails details, BoxConstraints constraints) { + /* void onViewFinderTap(TapDownDetails details, BoxConstraints constraints) { if (value.cameraController == null) { return; } diff --git a/lib/src/extension/nv21_converter.dart b/lib/src/extension/nv21_converter.dart index ce985d0..6fcbad5 100644 --- a/lib/src/extension/nv21_converter.dart +++ b/lib/src/extension/nv21_converter.dart @@ -7,6 +7,15 @@ extension Nv21Converter on CameraImage { final width = this.width; final height = this.height; + // Safety check: ensure we have enough planes + if (planes.length < 3) { + print( + '⚠️ Camera image has ${planes.length} plane(s), expected 3 for NV21', + ); + // Fallback: return the Y plane only + return planes[0].bytes; + } + final yPlane = planes[0]; final uPlane = planes[1]; final vPlane = planes[2]; @@ -44,7 +53,7 @@ extension Nv21Converter on CameraImage { final bufferIndex = uvOffset + (x * uvPixelStride); //V channel nv21[idUV++] = vBuffer[bufferIndex]; - //V channel + //U channel nv21[idUV++] = uBuffer[bufferIndex]; } } diff --git a/lib/src/handlers/face_identifier.dart b/lib/src/handlers/face_identifier.dart index d380636..f8eecc4 100644 --- a/lib/src/handlers/face_identifier.dart +++ b/lib/src/handlers/face_identifier.dart @@ -1,17 +1,19 @@ import 'dart:io'; + import 'package:camera/camera.dart'; +import 'package:face_camera/src/extension/nv21_converter.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:google_mlkit_face_detection/google_mlkit_face_detection.dart'; -import 'package:face_camera/src/extension/nv21_converter.dart'; import '../models/detected_image.dart'; class FaceIdentifier { - static Future scanImage( - {required CameraImage cameraImage, - required CameraController? controller, - required FaceDetectorMode performanceMode}) async { + static Future scanImage({ + required CameraImage cameraImage, + required CameraController? controller, + required FaceDetectorMode performanceMode, + }) async { final orientations = { DeviceOrientation.portraitUp: 0, DeviceOrientation.landscapeLeft: 90, @@ -21,9 +23,13 @@ class FaceIdentifier { DetectedFace? result; final face = await _detectFace( - performanceMode: performanceMode, - visionImage: - _inputImageFromCameraImage(cameraImage, controller, orientations)); + performanceMode: performanceMode, + visionImage: _inputImageFromCameraImage( + cameraImage, + controller, + orientations, + ), + ); if (face != null) { result = face; } @@ -31,8 +37,11 @@ class FaceIdentifier { return result; } - static InputImage? _inputImageFromCameraImage(CameraImage image, - CameraController? controller, Map orientations) { + static InputImage? _inputImageFromCameraImage( + CameraImage image, + CameraController? controller, + Map orientations, + ) { // get image rotation // it is used in android to convert the InputImage from Dart to Java // `rotation` is not used in iOS to convert the InputImage from Dart to Obj-C @@ -64,16 +73,18 @@ class FaceIdentifier { // only supported formats: // * bgra8888 for iOS if (format == null || - (Platform.isIOS && format != InputImageFormat.bgra8888)) return null; + (Platform.isIOS && format != InputImageFormat.bgra8888)) + return null; if (image.planes.isEmpty) return null; final bytes = Platform.isAndroid ? image.getNv21Uint8List() : Uint8List.fromList( image.planes.fold( - [], - (List previousValue, element) => - previousValue..addAll(element.bytes)), + [], + (List previousValue, element) => + previousValue..addAll(element.bytes), + ), ); // compose InputImage using bytes @@ -88,14 +99,16 @@ class FaceIdentifier { ); } - static Future _detectFace( - {required InputImage? visionImage, - required FaceDetectorMode performanceMode}) async { + static Future _detectFace({ + required InputImage? visionImage, + required FaceDetectorMode performanceMode, + }) async { if (visionImage == null) return null; final options = FaceDetectorOptions( - enableLandmarks: true, - enableTracking: true, - performanceMode: performanceMode); + enableLandmarks: true, + enableTracking: true, + performanceMode: performanceMode, + ); final faceDetector = FaceDetector(options: options); try { final List faces = await faceDetector.processImage(visionImage); @@ -163,9 +176,6 @@ class FaceIdentifier { } } - return DetectedFace( - wellPositioned: wellPositioned, - face: detectedFace, - ); + return DetectedFace(wellPositioned: wellPositioned, face: detectedFace); } } diff --git a/lib/src/res/builders.dart b/lib/src/res/builders.dart index 1ee3b9d..3af4e7d 100644 --- a/lib/src/res/builders.dart +++ b/lib/src/res/builders.dart @@ -3,17 +3,25 @@ import 'package:flutter/material.dart'; import '../../face_camera.dart'; /// Returns widget for flash modes -typedef FlashControlBuilder = Widget Function( - BuildContext context, CameraFlashMode mode); +typedef FlashControlBuilder = + Widget Function(BuildContext context, CameraFlashMode mode); /// Returns message based on face position -typedef MessageBuilder = Widget Function( - BuildContext context, DetectedFace? detectedFace); +typedef MessageBuilder = + Widget Function(BuildContext context, DetectedFace? detectedFace); /// Returns widget for detector -typedef IndicatorBuilder = Widget Function( - BuildContext context, DetectedFace? detectedFace, Size? imageSize); +typedef IndicatorBuilder = + Widget Function( + BuildContext context, + DetectedFace? detectedFace, + Size? imageSize, + ); /// Returns widget for capture control -typedef CaptureControlBuilder = Widget Function( - BuildContext context, DetectedFace? detectedFace); +typedef CaptureControlBuilder = + Widget Function(BuildContext context, DetectedFace? detectedFace); + +/// Returns widget for custom controls +typedef CustomControlBuilder = + Widget Function(BuildContext context, DetectedFace? detectedFace); diff --git a/lib/src/smart_face_camera.dart b/lib/src/smart_face_camera.dart index 9ff4b49..1aecf60 100644 --- a/lib/src/smart_face_camera.dart +++ b/lib/src/smart_face_camera.dart @@ -8,6 +8,10 @@ import 'paints/hole_painter.dart'; import 'res/builders.dart'; class SmartFaceCamera extends StatefulWidget { + ///Initial widget to show when camera is initializing + + final Widget? initialLoadingWidget; + /// Set false to hide all controls. final bool showControls; @@ -29,6 +33,9 @@ class SmartFaceCamera extends StatefulWidget { /// Use this to build custom widgets for capture control. final CaptureControlBuilder? captureControlBuilder; + /// Use this to build custom controls. + final CustomControlBuilder? customControlsBuilder; + /// Use this to render a custom widget for camera lens control. final Widget? lensControlIcon; @@ -53,29 +60,34 @@ class SmartFaceCamera extends StatefulWidget { /// The controller for the [SmartFaceCamera] widget. final FaceCameraController controller; - const SmartFaceCamera( - {required this.controller, - this.showControls = true, - this.showCaptureControl = true, - this.showFlashControl = true, - this.showCameraLensControl = true, - this.message, - this.messageStyle = const TextStyle( - fontSize: 14, height: 1.5, fontWeight: FontWeight.w400), - this.captureControlBuilder, - this.lensControlIcon, - this.flashControlBuilder, - this.messageBuilder, - this.indicatorShape = IndicatorShape.defaultShape, - this.indicatorAssetImage, - this.indicatorBuilder, - this.autoDisableCaptureControl = false, - Key? key}) - : assert( - indicatorShape != IndicatorShape.image || - indicatorAssetImage != null, - 'IndicatorAssetImage must be provided when IndicatorShape is set to image.'), - super(key: key); + const SmartFaceCamera({ + required this.controller, + this.showControls = true, + this.showCaptureControl = true, + this.showFlashControl = true, + this.showCameraLensControl = true, + this.message, + this.messageStyle = const TextStyle( + fontSize: 14, + height: 1.5, + fontWeight: FontWeight.w400, + ), + this.captureControlBuilder, + this.lensControlIcon, + this.flashControlBuilder, + this.messageBuilder, + this.indicatorShape = IndicatorShape.defaultShape, + this.indicatorAssetImage, + this.indicatorBuilder, + this.autoDisableCaptureControl = false, + this.initialLoadingWidget, + Key? key, + this.customControlsBuilder, + }) : assert( + indicatorShape != IndicatorShape.image || indicatorAssetImage != null, + 'IndicatorAssetImage must be provided when IndicatorShape is set to image.', + ), + super(key: key); @override State createState() => _SmartFaceCameraState(); @@ -139,53 +151,72 @@ class _SmartFaceCameraState extends State widget.indicatorShape != IndicatorShape.none) ...[ SizedBox( - width: - cameraController.value.previewSize!.width, - height: cameraController - .value.previewSize!.height, - child: widget.indicatorBuilder?.call( - context, - value.detectedFace, - Size( - cameraController - .value.previewSize!.height, - cameraController - .value.previewSize!.width, - )) ?? - CustomPaint( - painter: FacePainter( - face: value.detectedFace!.face, - indicatorShape: - widget.indicatorShape, - indicatorAssetImage: - widget.indicatorAssetImage, - imageSize: Size( - cameraController - .value.previewSize!.height, - cameraController - .value.previewSize!.width, - )), - )) - ] + width: + cameraController.value.previewSize!.width, + height: + cameraController.value.previewSize!.height, + child: + widget.indicatorBuilder?.call( + context, + value.detectedFace, + Size( + cameraController + .value + .previewSize! + .height, + cameraController + .value + .previewSize! + .width, + ), + ) ?? + CustomPaint( + painter: FacePainter( + face: value.detectedFace!.face, + indicatorShape: widget.indicatorShape, + indicatorAssetImage: + widget.indicatorAssetImage, + imageSize: Size( + cameraController + .value + .previewSize! + .height, + cameraController + .value + .previewSize! + .width, + ), + ), + ), + ), + ], ], ), ), ), ), ), - ) + ), ] else ...[ - const Text('No Camera Detected', - style: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.w500, - )), - CustomPaint( - size: size, - painter: HolePainter(), - ) + widget.initialLoadingWidget != null + ? widget.initialLoadingWidget! + : Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'No Camera Detected', + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.w500, + ), + ), + CustomPaint(size: size, painter: HolePainter()), + ], + ), ], - if (widget.showControls) ...[ + + if (widget.showControls && + widget.customControlsBuilder == null) ...[ Align( alignment: Alignment.bottomCenter, child: Padding( @@ -194,21 +225,24 @@ class _SmartFaceCameraState extends State mainAxisSize: MainAxisSize.min, children: [ if (widget.showFlashControl) ...[ - _flashControlWidget(value) + _flashControlWidget(value), ], if (widget.showCaptureControl) ...[ const SizedBox(width: 15), _captureControlWidget(value), - const SizedBox(width: 15) + const SizedBox(width: 15), ], if (widget.showCameraLensControl) ...[ - _lensControlWidget() + _lensControlWidget(), ], ], ), ), - ) - ] + ), + ] else ...[ + if (widget.showControls && widget.customControlsBuilder != null) + widget.customControlsBuilder!.call(context, value.detectedFace), + ], ], ); }, @@ -219,19 +253,30 @@ class _SmartFaceCameraState extends State Widget _cameraDisplayWidget(FaceCameraState value) { final CameraController? cameraController = value.cameraController; if (cameraController != null && cameraController.value.isInitialized) { - return CameraPreview(cameraController, child: Builder(builder: (context) { - if (widget.messageBuilder != null) { - return widget.messageBuilder!.call(context, value.detectedFace); - } - if (widget.message != null) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 55, vertical: 15), - child: Text(widget.message!, - textAlign: TextAlign.center, style: widget.messageStyle), - ); - } - return const SizedBox.shrink(); - })); + return CameraPreview( + cameraController, + child: Builder( + builder: (context) { + if (widget.messageBuilder != null) { + return widget.messageBuilder!.call(context, value.detectedFace); + } + if (widget.message != null) { + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: 55, + vertical: 15, + ), + child: Text( + widget.message!, + textAlign: TextAlign.center, + style: widget.messageStyle, + ), + ); + } + return const SizedBox.shrink(); + }, + ), + ); } return const SizedBox.shrink(); } @@ -248,17 +293,19 @@ class _SmartFaceCameraState extends State /// Display the control buttons to take pictures. Widget _captureControlWidget(FaceCameraState value) { return IconButton( - icon: widget.captureControlBuilder?.call(context, value.detectedFace) ?? + icon: + widget.captureControlBuilder?.call(context, value.detectedFace) ?? CircleAvatar( - radius: 35, - foregroundColor: - widget.controller.enableControls && !_disableCapture - ? null - : Theme.of(context).disabledColor, - child: const Padding( - padding: EdgeInsets.all(8.0), - child: Icon(Icons.camera_alt, size: 35), - )), + radius: 35, + foregroundColor: + widget.controller.enableControls && !_disableCapture + ? null + : Theme.of(context).disabledColor, + child: const Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.camera_alt, size: 35), + ), + ), onPressed: widget.controller.enableControls && !_disableCapture ? widget.controller.captureImage : null, @@ -272,19 +319,23 @@ class _SmartFaceCameraState extends State final icon = availableFlashMode[currentFlashMode] == CameraFlashMode.always ? Icons.flash_on : availableFlashMode[currentFlashMode] == CameraFlashMode.off - ? Icons.flash_off - : Icons.flash_auto; + ? Icons.flash_off + : Icons.flash_auto; return IconButton( - icon: widget.flashControlBuilder - ?.call(context, availableFlashMode[currentFlashMode]) ?? + icon: + widget.flashControlBuilder?.call( + context, + availableFlashMode[currentFlashMode], + ) ?? CircleAvatar( - radius: 25, - foregroundColor: iconColor, - child: Padding( - padding: const EdgeInsets.all(2.0), - child: Icon(icon, size: 25), - )), + radius: 25, + foregroundColor: iconColor, + child: Padding( + padding: const EdgeInsets.all(2.0), + child: Icon(icon, size: 25), + ), + ), onPressed: widget.controller.enableControls ? widget.controller.changeFlashMode : null, @@ -294,16 +345,19 @@ class _SmartFaceCameraState extends State /// Display the control buttons to switch between camera lens. Widget _lensControlWidget() { return IconButton( - icon: widget.lensControlIcon ?? - CircleAvatar( - radius: 25, - foregroundColor: iconColor, - child: const Padding( - padding: EdgeInsets.all(2.0), - child: Icon(Icons.switch_camera_sharp, size: 25), - )), - onPressed: widget.controller.enableControls - ? widget.controller.changeCameraLens - : null); + icon: + widget.lensControlIcon ?? + CircleAvatar( + radius: 25, + foregroundColor: iconColor, + child: const Padding( + padding: EdgeInsets.all(2.0), + child: Icon(Icons.switch_camera_sharp, size: 25), + ), + ), + onPressed: widget.controller.enableControls + ? widget.controller.changeCameraLens + : null, + ); } } diff --git a/lib/src/utils/logger.dart b/lib/src/utils/logger.dart index b5931a0..47c8eaf 100644 --- a/lib/src/utils/logger.dart +++ b/lib/src/utils/logger.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; void logError(String message, [String? code]) { if (code != null) { - debugPrint('Error: $code\nError Message: $message'); + debugPrint('Face Camera Error: $code\nError Message: $message'); } else { - debugPrint('Error: $code'); + debugPrint('Face Camera Error: $code'); } } diff --git a/pubspec.yaml b/pubspec.yaml index acc3f06..28bc855 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,14 +4,19 @@ version: 0.1.4 homepage: https://github.com/Conezi/face_camera environment: - sdk: '>=2.18.4 <4.0.0' - flutter: ">=2.5.0" + sdk: ">=3.8.0 <=4.0.0" + flutter: ">=3.0.0" dependencies: flutter: sdk: flutter - camera: ^0.11.0+2 - google_mlkit_face_detection: ^0.12.0 + camera: ^0.11.3 + google_mlkit_face_detection: ^0.13.1 + flutter_plugin_android_lifecycle: ^2.0.32 + camera_android_camerax: ^0.6.24 + +dependency_overrides: + camera_platform_interface: ^2.8.1 dev_dependencies: flutter_test: