├── ios ├── Assets │ └── .gitkeep ├── Classes │ ├── DarwinCameraPlugin.h │ ├── DarwinCameraPlugin.m │ └── SwiftDarwinCameraPlugin.swift ├── .gitignore └── darwin_camera.podspec ├── android ├── settings.gradle ├── .gitignore ├── gradle.properties ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ └── com │ │ └── atlan │ │ └── darwin_camera │ │ └── DarwinCameraPlugin.kt ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── build.gradle ├── example ├── ios │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Flutter.podspec │ │ └── AppFrameworkInfo.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── .gitignore │ ├── Podfile.lock │ └── Podfile ├── android │ ├── gradle.properties │ ├── .gitignore │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── atlan │ │ │ │ │ │ └── darwin_camera_example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── test_driver │ ├── app.dart │ └── app_test.dart ├── .gitignore ├── test │ └── widget_test.dart ├── README.md ├── pubspec.yaml ├── lib │ └── main.dart └── pubspec.lock ├── lib ├── core │ ├── core.dart │ ├── helper.dart │ └── ui.dart ├── theme │ ├── colors.dart │ ├── texts.dart │ ├── darwin_font_icons.dart │ └── dimensions.dart └── darwin_camera.dart ├── .vscode └── launch.json ├── CHANGELOG.md ├── .idea ├── libraries │ ├── Flutter_for_Android.xml │ └── Dart_SDK.xml ├── runConfigurations │ └── example_lib_main_dart.xml ├── modules.xml └── workspace.xml ├── .metadata ├── .github ├── workflows │ └── main.yml └── PULL_REQUEST_TEMPLATE.md ├── darwin_camera.iml ├── test └── darwin_camera_test.dart ├── LICENSE ├── CONTRIBUTING.md ├── pubspec.yaml ├── CODE_OF_CONDUCT.md ├── README.md ├── .gitignore └── pubspec.lock /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'darwin_camera' 2 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /ios/Classes/DarwinCameraPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface DarwinCameraPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlanhq/darwin-camera/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /lib/core/core.dart: -------------------------------------------------------------------------------- 1 | export './helper.dart'; 2 | export './ui.dart'; 3 | 4 | 5 | 6 | export '../theme/colors.dart'; 7 | export '../theme/darwin_font_icons.dart'; 8 | export '../theme/dimensions.dart'; 9 | export '../theme/texts.dart'; -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | 5 | { 6 | "name": "Flutter", 7 | "request": "launch", 8 | "type": "dart" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.2 2 | 3 | * Updated author information, plugin description, changelog and example/README.md. 4 | 5 | ## 0.0.1 6 | 7 | * This is the first release of Darwin Camera. All the features in this release are described in the README.md. 8 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 6 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /ios/Classes/DarwinCameraPlugin.m: -------------------------------------------------------------------------------- 1 | #import "DarwinCameraPlugin.h" 2 | #import 3 | 4 | @implementation DarwinCameraPlugin 5 | + (void)registerWithRegistrar:(NSObject*)registrar { 6 | [SwiftDarwinCameraPlugin registerWithRegistrar:registrar]; 7 | } 8 | @end 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 7bf9aea25435ae7b7afae3e0f2cc781a3db26c23 8 | channel: master 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 7bf9aea25435ae7b7afae3e0f2cc781a3db26c23 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/test_driver/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_driver/driver_extension.dart'; 2 | import 'package:darwin_camera_example/main.dart' as app; 3 | 4 | void main() { 5 | // This line enables the extension. 6 | enableFlutterDriverExtension(); 7 | 8 | // Call the `main()` function of the app, or call `runApp` with 9 | // any widget you are interested in testing. 10 | app.main(); 11 | } -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | 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. -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/atlan/darwin_camera_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.atlan.darwin_camera_example 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Classes/SwiftDarwinCameraPlugin.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | public class SwiftDarwinCameraPlugin: NSObject, FlutterPlugin { 5 | public static func register(with registrar: FlutterPluginRegistrar) { 6 | let channel = FlutterMethodChannel(name: "darwin_camera", binaryMessenger: registrar.messenger()) 7 | let instance = SwiftDarwinCameraPlugin() 8 | registrar.addMethodCallDelegate(instance, channel: channel) 9 | } 10 | 11 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 12 | result("iOS " + UIDevice.current.systemVersion) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | test: 7 | name: Test on FLUTTER Integration test 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | matrix: 11 | os: [macos-latest] 12 | steps: 13 | - uses: actions/checkout@v1 14 | - uses: actions/setup-java@v1 15 | with: 16 | java-version: '12.x' 17 | 18 | 19 | - uses: subosito/flutter-action@v1 20 | with: 21 | flutter-version: '1.7.8+hotfix.4' 22 | channel: 'beta' 23 | 24 | - run: flutter drive --target=example/test_driver/app.dart 25 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Generated.xcconfig 20 | Flutter/app.flx 21 | Flutter/app.zip 22 | Flutter/flutter_assets/ 23 | Flutter/flutter_export_environment.sh 24 | ServiceDefinitions.json 25 | Runner/GeneratedPluginRegistrant.* 26 | 27 | # Exceptions to above rules. 28 | !default.mode1v3 29 | !default.mode2v3 30 | !default.pbxuser 31 | !default.perspectivev3 32 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Web related 33 | lib/generated_plugin_registrant.dart 34 | 35 | # Exceptions to above rules. 36 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 37 | -------------------------------------------------------------------------------- /ios/darwin_camera.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'darwin_camera' 6 | s.version = '0.0.1' 7 | s.summary = 'A new flutter plugin project.' 8 | s.description = <<-DESC 9 | A new flutter plugin project. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | 19 | s.ios.deployment_target = '8.0' 20 | end 21 | 22 | -------------------------------------------------------------------------------- /example/ios/Flutter/Flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: This podspec is NOT to be published. It is only used as a local source! 3 | # 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'Flutter' 7 | s.version = '1.0.0' 8 | s.summary = 'High-performance, high-fidelity mobile apps.' 9 | s.description = <<-DESC 10 | Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. 11 | DESC 12 | s.homepage = 'https://flutter.io' 13 | s.license = { :type => 'MIT' } 14 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } 15 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } 16 | s.ios.deployment_target = '8.0' 17 | s.vendored_frameworks = 'Flutter.framework' 18 | end 19 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/atlan/darwin_camera/DarwinCameraPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.atlan.darwin_camera 2 | 3 | import io.flutter.plugin.common.MethodCall 4 | import io.flutter.plugin.common.MethodChannel 5 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 6 | import io.flutter.plugin.common.MethodChannel.Result 7 | import io.flutter.plugin.common.PluginRegistry.Registrar 8 | 9 | class DarwinCameraPlugin: MethodCallHandler { 10 | companion object { 11 | @JvmStatic 12 | fun registerWith(registrar: Registrar) { 13 | val channel = MethodChannel(registrar.messenger(), "darwin_camera") 14 | channel.setMethodCallHandler(DarwinCameraPlugin()) 15 | } 16 | } 17 | 18 | override fun onMethodCall(call: MethodCall, result: Result) { 19 | if (call.method == "getPlatformVersion") { 20 | result.success("Android ${android.os.Build.VERSION.RELEASE}") 21 | } else { 22 | result.notImplemented() 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /darwin_camera.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | // import 'package:darwin_camera_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | // await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.atlan.darwin_camera' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.3.50' 6 | repositories { 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.5.0' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | sourceSets { 31 | main.java.srcDirs += 'src/main/kotlin' 32 | } 33 | defaultConfig { 34 | minSdkVersion 16 35 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 36 | } 37 | lintOptions { 38 | disable 'InvalidPackage' 39 | } 40 | } 41 | 42 | dependencies { 43 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 44 | } 45 | -------------------------------------------------------------------------------- /test/darwin_camera_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:darwin_camera/darwin_camera.dart'; 5 | 6 | void main() { 7 | // const MethodChannel channel = MethodChannel('darwin_camera'); 8 | 9 | group("Test UI Library", () { 10 | test("test: function: backgroundGradient : PASS", () { 11 | Alignment begin = Alignment.topCenter; 12 | Alignment end = Alignment.bottomCenter; 13 | 14 | LinearGradient correctResult = LinearGradient( 15 | colors: [ 16 | Colors.black, 17 | Colors.transparent, 18 | ], 19 | begin: begin, 20 | end: end, 21 | ); 22 | 23 | /// 24 | /// 25 | LinearGradient data = DarwinCameraHelper.backgroundGradient( 26 | Alignment.topCenter, 27 | Alignment.bottomCenter, 28 | ); 29 | 30 | expect(data, correctResult); 31 | 32 | /// 33 | }); 34 | }); 35 | 36 | /// 37 | /// 38 | /// 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Atlan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. 4 | 5 | **DarwinCamera params change/addition/deletion if any** 6 | 7 | | param | type | default value | 8 | |------------------------|--------|---------------| 9 | | `defaultToFrontFacing` | `bool` | false | 10 | 11 | 12 | 13 | Fixes # (issue) 14 | - Issue Title. Fixes [#1234](http://issue-link/) 15 | 16 | 17 | ## Screenshots 18 | 19 | 20 | ## Type of change 21 | 22 | Please delete options that are not relevant. 23 | 24 | - [ ] Bug fix (non-breaking change which fixes an issue) 25 | - [ ] New feature (non-breaking change which adds functionality) 26 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 27 | - [ ] This change requires a documentation update 28 | 29 | # How Has This Been Tested? 30 | 31 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration 32 | 33 | 34 | 35 | # Checklist: 36 | 37 | - [ ] I have performed a self-review of my own code 38 | - [ ] I have commented my code, particularly in hard-to-understand areas 39 | - [ ] I have made corresponding changes to the documentation 40 | - [ ] My changes generate no new warnings 41 | - [ ] I have added tests that prove my fix is effective or that my feature works -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Darwin Camera 2 | 3 | 👍🎉 First off, thanks for taking the time to contribute! 🎉👍 4 | 5 | The following is a set of guidelines for contributing to this package. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. 6 | 7 | ## Proposing a Change 8 | 9 | If you intend to change the `DarwinCamera` widget, or make any non-trivial changes to the implementation, we recommend filing an issue. This lets us reach an agreement on your proposal before you put significant effort into it. 10 | 11 | If you’re only fixing a bug, it’s fine to submit a pull request right away but we still recommend to file an issue detailing what you’re fixing. This is helpful in case we don’t accept that specific fix but want to keep track of the issue. 12 | 13 | ## Creating a Pull Request 14 | 15 | Before creating a pull request please: 16 | 17 | 1. Fork the repository and create your branch from `master`. 18 | 2. Install all dependencies (`flutter packages get` or `pub get`). 19 | 3. Squash your commits and ensure you have a meaningful commit message. 20 | 4. Ensure the test suite passes. 21 | 5. If you've changed the `DarwinCamera` widget, make sure to update/add documentation. 22 | 6. Create the Pull Request. 23 | 24 | 25 | While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted. 26 | 27 | 28 | ## Getting in Touch 29 | Drop an email to engineering@atlan.com to connect with us. 30 | 31 | ## License 32 | 33 | By contributing to Darwin-Camera, you agree that your contributions will be licensed under its MIT license. 34 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - camera (0.0.1): 3 | - Flutter 4 | - darwin_camera (0.0.1): 5 | - Flutter 6 | - Flutter (1.0.0) 7 | - flutter_image_compress (0.0.1): 8 | - Flutter 9 | - Mantle 10 | - Mantle (2.1.0): 11 | - Mantle/extobjc (= 2.1.0) 12 | - Mantle/extobjc (2.1.0) 13 | - path_provider (0.0.1): 14 | - Flutter 15 | - permission_handler (3.3.0): 16 | - Flutter 17 | 18 | DEPENDENCIES: 19 | - camera (from `.symlinks/plugins/camera/ios`) 20 | - darwin_camera (from `.symlinks/plugins/darwin_camera/ios`) 21 | - Flutter (from `Flutter`) 22 | - flutter_image_compress (from `.symlinks/plugins/flutter_image_compress/ios`) 23 | - path_provider (from `.symlinks/plugins/path_provider/ios`) 24 | - permission_handler (from `.symlinks/plugins/permission_handler/ios`) 25 | 26 | SPEC REPOS: 27 | https://github.com/cocoapods/specs.git: 28 | - Mantle 29 | 30 | EXTERNAL SOURCES: 31 | camera: 32 | :path: ".symlinks/plugins/camera/ios" 33 | darwin_camera: 34 | :path: ".symlinks/plugins/darwin_camera/ios" 35 | Flutter: 36 | :path: Flutter 37 | flutter_image_compress: 38 | :path: ".symlinks/plugins/flutter_image_compress/ios" 39 | path_provider: 40 | :path: ".symlinks/plugins/path_provider/ios" 41 | permission_handler: 42 | :path: ".symlinks/plugins/permission_handler/ios" 43 | 44 | SPEC CHECKSUMS: 45 | camera: 38cc83ae9a5667bb5a71c7d9edaf60a91920fd4e 46 | darwin_camera: fbdc05392614f393a0761272717f8cfb53c2c565 47 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 48 | flutter_image_compress: f69d0e0e078ce52b4810695593bc861ee319ae7d 49 | Mantle: 2fa750afa478cd625a94230fbf1c13462f29395b 50 | path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 51 | permission_handler: 67637977b227d62d46bfbf524f335f8568de5a73 52 | 53 | PODFILE CHECKSUM: 262273b3282c7b673950e15997a2bfdd46690074 54 | 55 | COCOAPODS: 1.7.0 56 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | darwin_camera_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | NSCameraUsageDescription 30 | Can I use the camera please? 31 | NSMicrophoneUsageDescription 32 | Can I use the mic please? 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Darwin Camera Example 2 | Demonstrates how to use the darwin_camera plugin. 3 | 4 | ```dart 5 | import 'package:darwin_camera/darwin_camera.dart'; 6 | 7 | DarwinCameraResult result = await Navigator.push( 8 | context, 9 | MaterialPageRoute( 10 | builder: (context) => DarwinCamera( 11 | cameraDescription: cameraDescription, 12 | filePath: filePath, 13 | resolution: ResolutionPreset.high, 14 | defaultToFrontFacing: false, 15 | quality: 90, 16 | ), 17 | ), 18 | ); 19 | 20 | if (result != null && result.isFileAvailable) { 21 | /// File object returned by Camera. 22 | print(result.file); 23 | /// Path where the file is faced. 24 | print(result.file.path); 25 | } 26 | 27 | ``` 28 | 29 | ### `DarwinCamera` configuration 30 | This widget captures an image and save it at the path provided by you. 31 | 32 | ```dart 33 | DarwinCamera({ 34 | 35 | /// 36 | /// Flag to enable/disable image compression. 37 | bool enableCompression = false, 38 | 39 | /// 40 | /// Disables swipe based native back functionality provided by iOS. 41 | bool disableNativeBackFunctionality = false, 42 | 43 | /// @Required 44 | /// List of cameras availale in the device. 45 | /// 46 | /// How to get the list available cameras? 47 | /// `List cameraDescription = await availableCameras();` 48 | List cameraDescription, 49 | 50 | /// @Required 51 | 52 | /// Path where the image file will be saved. 53 | String filePath, 54 | 55 | /// 56 | /// Resolution of the image captured 57 | /// Possible values: 58 | /// 1. ResolutionPreset.high 59 | /// 2. ResolutionPreset.medium 60 | /// 3. ResolutionPreset.low 61 | ResolutionPreset resolution = ResolutionPreset.high, 62 | 63 | /// 64 | /// Open front camera instead of back camera on launch. 65 | bool defaultToFrontFacing = false; 66 | 67 | /// 68 | /// Decides the quality of final image captured. 69 | /// Possible values `0 - 100` 70 | int quality = 90; 71 | 72 | }) 73 | 74 | ``` -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: darwin_camera 2 | description: A Flutter plugin that simplifies camera app development. 3 | version: 0.0.2 4 | author: Atlan Engineering 5 | homepage: "https://atlan.com/" 6 | 7 | environment: 8 | sdk: ">=2.1.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | camera: ^0.5.2+1 14 | flutter_image_compress: ^0.6.3 15 | 16 | dev_dependencies: 17 | flutter_driver: 18 | sdk: flutter 19 | flutter_test: 20 | sdk: flutter 21 | 22 | # For information on the generic Dart part of this file, see the 23 | # following page: https://dart.dev/tools/pub/pubspec 24 | 25 | # The following section is specific to Flutter. 26 | flutter: 27 | # This section identifies this Flutter project as a plugin project. 28 | # The androidPackage and pluginClass identifiers should not ordinarily 29 | # be modified. They are used by the tooling to maintain consistency when 30 | # adding or updating assets for this project. 31 | plugin: 32 | androidPackage: com.atlan.darwin_camera 33 | pluginClass: DarwinCameraPlugin 34 | # To add assets to your plugin package, add an assets section, like this: 35 | # assets: 36 | # - images/a_dot_burr.jpeg 37 | # - images/a_dot_ham.jpeg 38 | # 39 | # For details regarding assets in packages, see 40 | # https://flutter.dev/assets-and-images/#from-packages 41 | # 42 | # An image asset can refer to one or more resolution-specific "variants", see 43 | # https://flutter.dev/assets-and-images/#resolution-aware. 44 | # To add custom fonts to your plugin package, add a fonts section here, 45 | # in this "flutter" section. Each entry in this list should have a 46 | # "family" key with the font family name, and a "fonts" key with a 47 | # list giving the asset and other descriptors for the font. For 48 | # example: 49 | # fonts: 50 | # - family: Schyler 51 | # fonts: 52 | # - asset: fonts/Schyler-Regular.ttf 53 | # - asset: fonts/Schyler-Italic.ttf 54 | # style: italic 55 | # - family: Trajan Pro 56 | # fonts: 57 | # - asset: fonts/TrajanPro.ttf 58 | # - asset: fonts/TrajanPro_Bold.ttf 59 | # weight: 700 60 | # 61 | # For details regarding fonts in packages, see 62 | # https://flutter.dev/custom-fonts/#from-packages 63 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.atlan.darwin_camera_example" 42 | minSdkVersion 21 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | } 68 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: darwin_camera_example 2 | description: Demonstrates how to use the darwin_camera plugin. 3 | publish_to: 'none' 4 | 5 | version: 0.0.1+1 6 | 7 | environment: 8 | sdk: ">=2.2.2 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | # The following adds the Cupertino Icons font to your application. 15 | # Use with the CupertinoIcons class for iOS style icons. 16 | cupertino_icons: ^0.1.2 17 | camera: ^0.5.2+1 18 | permission_handler: ^3.3.0 19 | path_provider: ^0.5.0+1 20 | 21 | dev_dependencies: 22 | flutter_driver: 23 | sdk: flutter 24 | test: any 25 | 26 | darwin_camera: 27 | path: ../ 28 | 29 | # For information on the generic Dart part of this file, see the 30 | # following page: https://dart.dev/tools/pub/pubspec 31 | 32 | # The following section is specific to Flutter. 33 | flutter: 34 | 35 | # The following line ensures that the Material Icons font is 36 | # included with your application, so that you can use the icons in 37 | # the material Icons class. 38 | uses-material-design: true 39 | 40 | # To add assets to your application, add an assets section, like this: 41 | # assets: 42 | # - images/a_dot_burr.jpeg 43 | # - images/a_dot_ham.jpeg 44 | 45 | # An image asset can refer to one or more resolution-specific "variants", see 46 | # https://flutter.dev/assets-and-images/#resolution-aware. 47 | 48 | # For details regarding adding assets from package dependencies, see 49 | # https://flutter.dev/assets-and-images/#from-packages 50 | 51 | # To add custom fonts to your application, add a fonts section here, 52 | # in this "flutter" section. Each entry in this list should have a 53 | # "family" key with the font family name, and a "fonts" key with a 54 | # list giving the asset and other descriptors for the font. For 55 | # example: 56 | # fonts: 57 | # - family: Schyler 58 | # fonts: 59 | # - asset: fonts/Schyler-Regular.ttf 60 | # - asset: fonts/Schyler-Italic.ttf 61 | # style: italic 62 | # - family: Trajan Pro 63 | # fonts: 64 | # - asset: fonts/TrajanPro.ttf 65 | # - asset: fonts/TrajanPro_Bold.ttf 66 | # weight: 700 67 | # 68 | # For details regarding fonts from package dependencies, 69 | # see https://flutter.dev/custom-fonts/#from-packages 70 | -------------------------------------------------------------------------------- /lib/theme/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const DarwinPrimaryDark = const Color(0xff161849); 4 | const DarwinPrimary = const Color(0xff2026d2); 5 | const DarwinPrimaryLight = const Color(0xffd7ebfb); 6 | const DarwinPrimaryLighter = const Color(0xffecf7ff); 7 | const DarwinPrimarySteel = const Color(0xff9dc0da); 8 | const DarwinAccent = const Color(0xff62e1fc); 9 | const DarwinAccentLight = const Color.fromRGBO(98, 225, 252, 0.15); 10 | const DarwinSecondary = const Color(0xfff34d77); 11 | const DarwinGrayDark = const Color(0xff8e95a1); 12 | const DarwinGrayNormal = const Color(0xffc2c7cf); 13 | const DarwinGrayLight = const Color(0xffe6e8eb); 14 | const DarwinSuccess = const Color(0xff4aa740); 15 | const DarwinSuccessLight = const Color(0xffe6f4e9); 16 | const DarwinWarning = const Color(0xffff8212); 17 | const DarwinWarningLight = const Color(0xffffecdc); 18 | const DarwinInfo = const Color(0xff3eacfc); 19 | const DarwinInfoLight = const Color(0xffe8f0fd); 20 | const DarwinDanger = const Color(0xfff64a4a); 21 | const DarwinDangerLight = const Color(0xfffce8e6); 22 | const DarwinDangerLighter = const Color.fromRGBO(252, 232, 230, 0.4); 23 | const DarwinWhite = const Color(0xffffffff); 24 | const DarwinBlack = const Color(0xff000000); 25 | 26 | /// Primary Dark color with opacity (shadow) 27 | const DarwinPrimaryDarkShadow = const Color.fromRGBO(22, 24, 73, 0.2); 28 | const DarwinPrimaryDarkShadowLight = const Color.fromRGBO(22, 24, 73, 0.08); 29 | /// Primary Light color with opacity (shadow) 30 | const DarwinPrimaryLightShadow = const Color.fromRGBO(32,38, 210, 0.15); 31 | /// Warning color with opacity (shadow) 32 | const DarwinWarningShadow = const Color.fromRGBO(255, 130, 18, 0.45); 33 | /// Success color with opacity (shadow) 34 | const DarwinSuccessShadow = const Color.fromRGBO(74, 167, 64, 0.45); 35 | /// Danger color with opacity (shadow) 36 | const DarwinDangerShadow = const Color.fromRGBO(246, 74, 74, 0.45); 37 | /// Info color with opacity (shadow) 38 | const DarwinInfoShadow = const Color.fromRGBO(62, 172, 252, 0.45); 39 | /// Shadow color for Boxes 40 | const DarwinBoxShadow = const Color(0x592026d2); 41 | 42 | /// Splash color for normal Buttons 43 | const DarwinWhiteSplash = const Color.fromRGBO(255, 255, 255, 0.1); 44 | 45 | /// Overlay color 46 | const DarwinOverlay = const Color.fromRGBO(22, 24, 73, 0.5); 47 | const DarwinTransparent = const Color.fromRGBO(22, 24, 73, 0); -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/core/helper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:camera/camera.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_image_compress/flutter_image_compress.dart'; 6 | 7 | class DarwinCameraHelper { 8 | /// 9 | static LinearGradient backgroundGradient( 10 | AlignmentGeometry begin, 11 | AlignmentGeometry end, 12 | ) { 13 | return LinearGradient( 14 | colors: [ 15 | Colors.black, 16 | Colors.transparent, 17 | ], 18 | begin: begin, 19 | end: end, 20 | ); 21 | } 22 | 23 | /// 24 | /// 25 | /// Captures image from the selected Camera. 26 | static Future captureImage( 27 | CameraController cameraController, 28 | String filePath, { 29 | bool enableCompression = true, 30 | int quality, 31 | }) async { 32 | imageCache.clear(); 33 | if (!cameraController.value.isInitialized) { 34 | return null; 35 | } 36 | 37 | if (cameraController.value.isTakingPicture) { 38 | return null; 39 | } 40 | File file = File(filePath); 41 | 42 | try { 43 | if (file.existsSync()) { 44 | await file.delete(); 45 | } 46 | 47 | await cameraController.takePicture(filePath); 48 | 49 | file = File(filePath); 50 | if (enableCompression == true) { 51 | await compressImage(file, quality); 52 | } 53 | } on CameraException catch (e, stacktrace) { 54 | print(e); 55 | print(stacktrace); 56 | return null; 57 | } 58 | return filePath; 59 | } 60 | 61 | /// 62 | /// 63 | /// Compress Image saved in phone internal storage. 64 | static compressImage(File file, int quality) async { 65 | var result; 66 | result = await FlutterImageCompress.compressWithFile( 67 | file.absolute.path, 68 | quality: quality, 69 | autoCorrectionAngle: true, 70 | keepExif: true, 71 | ); 72 | await file.delete(); 73 | await file.writeAsBytes(result); 74 | print('[+] COMPRESSED FILE SIZE: ${result.length}'); 75 | } 76 | 77 | static returnResult(context, {File file}) { 78 | var result = DarwinCameraResult(file: file); 79 | Navigator.pop(context, result); 80 | } 81 | } 82 | 83 | class DarwinCameraResult { 84 | /// 85 | final File file; 86 | 87 | /// Scanned text in returned in case of Barcode Scanner. 88 | final String scannedText; 89 | 90 | bool get isFileAvailable { 91 | if (file == null) { 92 | return false; 93 | } else { 94 | return true; 95 | } 96 | } 97 | 98 | DarwinCameraResult({ 99 | this.file, 100 | this.scannedText, 101 | }); 102 | } 103 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at engineering@atlan.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | generated_key_values = {} 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) do |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | generated_key_values[podname] = podpath 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | end 32 | generated_key_values 33 | end 34 | 35 | target 'Runner' do 36 | use_frameworks! 37 | use_modular_headers! 38 | 39 | # Flutter Pod 40 | 41 | copied_flutter_dir = File.join(__dir__, 'Flutter') 42 | copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') 43 | copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') 44 | unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) 45 | # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. 46 | # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. 47 | # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. 48 | 49 | generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') 50 | unless File.exist?(generated_xcode_build_settings_path) 51 | raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" 52 | end 53 | generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) 54 | cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; 55 | 56 | unless File.exist?(copied_framework_path) 57 | FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) 58 | end 59 | unless File.exist?(copied_podspec_path) 60 | FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) 61 | end 62 | end 63 | 64 | # Keep pod path relative so it can be checked into Podfile.lock. 65 | pod 'Flutter', :path => 'Flutter' 66 | 67 | # Plugin Pods 68 | 69 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 70 | # referring to absolute paths on developers' machines. 71 | system('rm -rf .symlinks') 72 | system('mkdir -p .symlinks/plugins') 73 | plugin_pods = parse_KV_file('../.flutter-plugins') 74 | plugin_pods.each do |name, path| 75 | symlink = File.join('.symlinks', 'plugins', name) 76 | File.symlink(path, symlink) 77 | pod name, :path => File.join(symlink, 'ios') 78 | end 79 | end 80 | 81 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 82 | install! 'cocoapods', :disable_input_output_paths => true 83 | 84 | post_install do |installer| 85 | installer.pods_project.targets.each do |target| 86 | target.build_configurations.each do |config| 87 | config.build_settings['ENABLE_BITCODE'] = 'NO' 88 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0' 89 | end 90 | end 91 | end 92 | -------------------------------------------------------------------------------- /lib/theme/texts.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './colors.dart'; 3 | 4 | 5 | // Primary Font Styles 6 | const primaryJumboBold = const TextStyle( 7 | color: DarwinPrimaryDark, 8 | fontWeight: FontWeight.w700, 9 | fontFamily: 'Gilroy', 10 | fontStyle: FontStyle.normal, 11 | fontSize: 49.0 12 | ); 13 | 14 | const primaryH1Bold = const TextStyle( 15 | color: DarwinPrimaryDark, 16 | fontWeight: FontWeight.w700, 17 | fontFamily: 'Gilroy', 18 | fontStyle: FontStyle.normal, 19 | fontSize: 37.0 20 | ); 21 | 22 | const primaryH2Bold = const TextStyle( 23 | color: DarwinPrimaryDark, 24 | fontWeight: FontWeight.w700, 25 | fontFamily: 'Gilroy', 26 | fontStyle: FontStyle.normal, 27 | fontSize: 28.0 28 | ); 29 | 30 | const primaryH3Bold = const TextStyle( 31 | color: DarwinPrimaryDark, 32 | fontWeight: FontWeight.w700, 33 | fontFamily: 'Gilroy', 34 | fontStyle: FontStyle.normal, 35 | fontSize: 21.0 36 | ); 37 | 38 | const primaryPRegular = const TextStyle( 39 | color: DarwinPrimaryDark, 40 | fontWeight: FontWeight.w300, 41 | fontFamily: 'Gilroy', 42 | fontStyle: FontStyle.normal, 43 | fontSize: 16.0 44 | ); 45 | 46 | const primaryPBold = const TextStyle( 47 | color: DarwinPrimaryDark, 48 | fontWeight: FontWeight.w700, 49 | fontFamily: 'Gilroy', 50 | fontStyle: FontStyle.normal, 51 | fontSize: 16.0 52 | ); 53 | 54 | const primaryLabelRegular = const TextStyle( 55 | color: DarwinPrimaryDark, 56 | fontWeight: FontWeight.w300, 57 | fontFamily: 'Gilroy', 58 | fontStyle: FontStyle.normal, 59 | fontSize: 12.0 60 | ); 61 | 62 | const primaryLabelBold = const TextStyle( 63 | color: DarwinPrimaryDark, 64 | fontWeight: FontWeight.w700, 65 | fontFamily: 'Gilroy', 66 | fontStyle: FontStyle.normal, 67 | fontSize: 12.0 68 | ); 69 | 70 | 71 | // Secondary Font Styles 72 | const secondaryJumboBold = const TextStyle( 73 | color: DarwinPrimaryDark, 74 | fontWeight: FontWeight.w700, 75 | fontFamily: 'Avenir', 76 | fontStyle: FontStyle.normal, 77 | fontSize: 49.0 78 | ); 79 | 80 | const secondaryH1Bold = const TextStyle( 81 | color: DarwinPrimaryDark, 82 | fontWeight: FontWeight.w700, 83 | fontFamily: 'Avenir', 84 | fontStyle: FontStyle.normal, 85 | fontSize: 37.0 86 | ); 87 | 88 | const secondaryH2Bold = const TextStyle( 89 | color: DarwinPrimaryDark, 90 | fontWeight: FontWeight.w700, 91 | fontFamily: 'Avenir', 92 | fontStyle: FontStyle.normal, 93 | fontSize: 28.0 94 | ); 95 | 96 | const secondaryH3Bold = const TextStyle( 97 | color: DarwinPrimaryDark, 98 | fontWeight: FontWeight.w700, 99 | fontFamily: 'Avenir', 100 | fontStyle: FontStyle.normal, 101 | fontSize: 21.0 102 | ); 103 | 104 | const secondaryH3Regular = const TextStyle( 105 | color: DarwinPrimaryDark, 106 | fontWeight: FontWeight.w300, 107 | fontFamily: 'Avenir', 108 | fontStyle: FontStyle.normal, 109 | fontSize: 21.0 110 | ); 111 | 112 | const secondaryPRegular = const TextStyle( 113 | color: DarwinPrimaryDark, 114 | fontWeight: FontWeight.w300, 115 | fontFamily: 'Avenir', 116 | fontStyle: FontStyle.normal, 117 | fontSize: 16.0 118 | ); 119 | 120 | const secondaryPBold = const TextStyle( 121 | color: DarwinPrimaryDark, 122 | fontWeight: FontWeight.w700, 123 | fontFamily: 'Avenir', 124 | fontStyle: FontStyle.normal, 125 | fontSize: 16.0 126 | ); 127 | 128 | const secondaryLabelRegular = const TextStyle( 129 | color: DarwinPrimaryDark, 130 | fontWeight: FontWeight.w300, 131 | fontFamily: 'Avenir', 132 | fontStyle: FontStyle.normal, 133 | fontSize: 12.0 134 | ); 135 | 136 | const secondaryLabelBold = const TextStyle( 137 | color: DarwinPrimaryDark, 138 | fontWeight: FontWeight.w700, 139 | fontFamily: 'Avenir', 140 | fontStyle: FontStyle.normal, 141 | fontSize: 12.0 142 | ); -------------------------------------------------------------------------------- /lib/theme/darwin_font_icons.dart: -------------------------------------------------------------------------------- 1 | /// Flutter icons DarwinFont 2 | /// Copyright (C) 2019 by original authors @ fluttericon.com, fontello.com 3 | /// This font was generated by FlutterIcon.com, which is derived from Fontello. 4 | /// 5 | /// To use this font, place it in your fonts/ directory and include the 6 | /// following in your pubspec.yaml 7 | /// 8 | /// flutter: 9 | /// fonts: 10 | /// - family: DarwinFont 11 | /// fonts: 12 | /// - asset: fonts/DarwinFont.ttf 13 | /// 14 | /// 15 | /// 16 | import 'package:flutter/widgets.dart'; 17 | 18 | class DarwinFont { 19 | DarwinFont._(); 20 | 21 | static const _kFontFam = 'DarwinFont'; 22 | 23 | static const IconData bell = const IconData(0xe800, fontFamily: _kFontFam); 24 | static const IconData calendar = const IconData(0xe801, fontFamily: _kFontFam); 25 | static const IconData camera = const IconData(0xe802, fontFamily: _kFontFam); 26 | static const IconData cancel = const IconData(0xe803, fontFamily: _kFontFam); 27 | static const IconData check = const IconData(0xe804, fontFamily: _kFontFam); 28 | static const IconData chevron_down = const IconData(0xe805, fontFamily: _kFontFam); 29 | static const IconData chevron_left = const IconData(0xe806, fontFamily: _kFontFam); 30 | static const IconData chevron_right = const IconData(0xe807, fontFamily: _kFontFam); 31 | static const IconData clock = const IconData(0xe808, fontFamily: _kFontFam); 32 | static const IconData edit = const IconData(0xe809, fontFamily: _kFontFam); 33 | static const IconData emoji_happy = const IconData(0xe80a, fontFamily: _kFontFam); 34 | static const IconData emoji_ok = const IconData(0xe80b, fontFamily: _kFontFam); 35 | static const IconData emoji_sad = const IconData(0xe80c, fontFamily: _kFontFam); 36 | static const IconData emoji_too_happy = const IconData(0xe80d, fontFamily: _kFontFam); 37 | static const IconData emoji_too_sad = const IconData(0xe80e, fontFamily: _kFontFam); 38 | static const IconData files = const IconData(0xe80f, fontFamily: _kFontFam); 39 | static const IconData filter = const IconData(0xe810, fontFamily: _kFontFam); 40 | static const IconData gps = const IconData(0xe811, fontFamily: _kFontFam); 41 | static const IconData layers = const IconData(0xe812, fontFamily: _kFontFam); 42 | static const IconData check_round = const IconData(0xe813, fontFamily: _kFontFam); 43 | static const IconData mail = const IconData(0xe814, fontFamily: _kFontFam); 44 | static const IconData map = const IconData(0xe815, fontFamily: _kFontFam); 45 | static const IconData mic = const IconData(0xe816, fontFamily: _kFontFam); 46 | static const IconData more_horizontal = const IconData(0xe817, fontFamily: _kFontFam); 47 | static const IconData phone = const IconData(0xe818, fontFamily: _kFontFam); 48 | static const IconData play = const IconData(0xe819, fontFamily: _kFontFam); 49 | static const IconData record = const IconData(0xe81a, fontFamily: _kFontFam); 50 | static const IconData refresh = const IconData(0xe81b, fontFamily: _kFontFam); 51 | static const IconData search = const IconData(0xe81c, fontFamily: _kFontFam); 52 | static const IconData settings = const IconData(0xe81d, fontFamily: _kFontFam); 53 | static const IconData signature = const IconData(0xe81e, fontFamily: _kFontFam); 54 | static const IconData sort = const IconData(0xe81f, fontFamily: _kFontFam); 55 | static const IconData star_outline = const IconData(0xe820, fontFamily: _kFontFam); 56 | static const IconData star_solid = const IconData(0xe821, fontFamily: _kFontFam); 57 | static const IconData stop = const IconData(0xe822, fontFamily: _kFontFam); 58 | static const IconData undo = const IconData(0xe823, fontFamily: _kFontFam); 59 | static const IconData users = const IconData(0xe824, fontFamily: _kFontFam); 60 | static const IconData video = const IconData(0xe825, fontFamily: _kFontFam); 61 | static const IconData logo_animatable = const IconData(0xe826, fontFamily: _kFontFam); 62 | static const IconData logo = const IconData(0xe827, fontFamily: _kFontFam); 63 | static const IconData star_solid_half = const IconData(0xe828, fontFamily: _kFontFam); 64 | static const IconData round_ring = const IconData(0xe829, fontFamily: _kFontFam); 65 | static const IconData cancel_round = const IconData(0xe82a, fontFamily: _kFontFam); 66 | } 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | # Darwin Camera 6 | 7 | 8 | 9 | 10 | Darwin camera makes it super easy to add camera to your Flutter app. It uses the official camera plugin implementation underneath. 11 | 12 | - Captures RAW image at maximum resolution supported by the device camera. 13 | - Provides a toggle between front and back camera. 14 | - You can configure what it defaults to on opening. 15 | - Provides configuration to set quality of the captured image. 16 | - Uses the [flutter_image_compress](https://pub.dev/packages/flutter_image_compress) library. 17 | - Provides a minimal UI for the reviewing the capture before saving image. 18 | - Supports both Android and iOS. 19 | 20 | 21 | 22 | | Camera Stream | Preview Captured Image | 23 | | :---: | :---: | 24 | | | | 25 | | Press the `white circular button` to capture image. | Press the `green button` to save the image. | 26 | | Press the button at the bottom right to `toggle camera`. | Press the close button to `discard` the `captured image`. | 27 | 28 | 29 | 30 | 31 | 32 | ## Getting Started 33 | 34 | In your flutter project add `darwin_camera` as a dependency in `pubspec.yaml`: 35 | 36 | ```yml 37 | dependencies: 38 | ... 39 | darwin_camera: 40 | git: https://github.com/atlanhq/darwin-camera 41 | 42 | ``` 43 | ### iOS 44 | 45 | Add two rows to the `ios/Runner/Info.plist`: 46 | 47 | * one with the key `Privacy - Camera Usage Description` and a usage description. 48 | * and one with the key `Privacy - Microphone Usage Description` and a usage description. 49 | 50 | Or in text format add the key: 51 | 52 | ```xml 53 | NSCameraUsageDescription 54 | Can I use the camera please? 55 | NSMicrophoneUsageDescription 56 | Can I use the mic please? 57 | ``` 58 | 59 | ### Android 60 | 61 | Change the minimum Android sdk version to 21 (or higher) in your `android/app/build.gradle` file. 62 | 63 | ``` 64 | minSdkVersion 21 65 | ``` 66 | 67 | 68 | 69 | ## Usage example 70 | ```dart 71 | import 'package:darwin_camera/darwin_camera.dart'; 72 | 73 | DarwinCameraResult result = await Navigator.push( 74 | context, 75 | MaterialPageRoute( 76 | builder: (context) => DarwinCamera( 77 | cameraDescription: cameraDescription, 78 | filePath: filePath, 79 | resolution: ResolutionPreset.high, 80 | defaultToFrontFacing: false, 81 | quality: 90, 82 | ), 83 | ), 84 | ); 85 | 86 | if (result != null && result.isFileAvailable) { 87 | /// File object returned by Camera. 88 | print(result.file); 89 | /// Path where the file is faced. 90 | print(result.file.path); 91 | } 92 | 93 | ``` 94 | 95 | ### `DarwinCamera` configuration 96 | This widget captures an image and save it at the path provided by you. 97 | 98 | ```dart 99 | DarwinCamera({ 100 | 101 | /// 102 | /// Flag to enable/disable image compression. 103 | bool enableCompression = false, 104 | 105 | /// 106 | /// Disables swipe based native back functionality provided by iOS. 107 | bool disableNativeBackFunctionality = false, 108 | 109 | /// @Required 110 | /// List of cameras availale in the device. 111 | /// 112 | /// How to get the list available cameras? 113 | /// `List cameraDescription = await availableCameras();` 114 | List cameraDescription, 115 | 116 | /// @Required 117 | 118 | /// Path where the image file will be saved. 119 | String filePath, 120 | 121 | /// 122 | /// Resolution of the image captured 123 | /// Possible values: 124 | /// 1. ResolutionPreset.high 125 | /// 2. ResolutionPreset.medium 126 | /// 3. ResolutionPreset.low 127 | ResolutionPreset resolution = ResolutionPreset.high, 128 | 129 | /// 130 | /// Open front camera instead of back camera on launch. 131 | bool defaultToFrontFacing = false; 132 | 133 | /// 134 | /// Decides the quality of final image captured. 135 | /// Possible values `0 - 100` 136 | int quality = 90; 137 | 138 | }) 139 | 140 | ``` 141 | 142 | ## Complete example with permission handling. 143 | See the [example](https://github.com/atlanhq/darwin-camera/tree/master/example) directory in the github repository 144 | 145 | 146 | ## Tests 147 | 148 | ```bash 149 | cd example 150 | flutter drive --target=test_driver/app.dart 151 | ``` 152 | 153 | ## How to contribute? 154 | See [CONTRIBUTING.md](https://github.com/atlanhq/darwin-camera/blob/master/CONTRIBUTING.md) 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /example/test_driver/app_test.dart: -------------------------------------------------------------------------------- 1 | // Imports the Flutter Driver API. 2 | import 'package:flutter_driver/flutter_driver.dart'; 3 | import 'package:test/test.dart'; 4 | 5 | void main() { 6 | group('Darwin Camera App', () { 7 | // First, define the Finders and use them to locate widgets from the 8 | // test suite. Note: the Strings provided to the `byValueKey` method must 9 | // be the same as the Strings we used for the Keys in step 1. 10 | final openDarwinCamerButton = find.byValueKey("OpenDarwinCameraButton"); 11 | final cameraStream = find.byValueKey("CameraStream"); 12 | final headerCancelButton = find.byValueKey("HeaderCancelButton"); 13 | final captureButton = find.byValueKey("CaptureButton"); 14 | final confirmImageButton = find.byValueKey("ConfirmImageButton"); 15 | final cameraTogglebutton = find.byValueKey("CameraToggleButton"); 16 | 17 | final capturedImageWidget = find.byValueKey("RenderCapturedImageWidget"); 18 | final capturedImageCancelButton = 19 | find.byValueKey("CapturedImageCancelButton"); 20 | final capturedImagePreview = find.byValueKey("CapturedImagePreview"); 21 | 22 | /// 23 | FlutterDriver driver; 24 | 25 | // Connect to the Flutter driver before running any tests. 26 | setUpAll(() async { 27 | driver = await FlutterDriver.connect(); 28 | }); 29 | 30 | // Close the connection to the driver after the tests have completed. 31 | tearDownAll(() async { 32 | if (driver != null) { 33 | driver.close(); 34 | } 35 | }); 36 | 37 | testOpenCameraStream() async { 38 | /// Tap on open camera button 39 | await driver.tap(openDarwinCamerButton); 40 | 41 | /// Open camera Stream; 42 | await driver.waitFor(cameraStream); 43 | } 44 | 45 | testCloseCameraStream() async { 46 | /// Close camera Stream; 47 | await driver.tap(headerCancelButton); 48 | 49 | /// Wait for Camera Stream to be gone from the screen. 50 | await driver.waitForAbsent(cameraStream); 51 | } 52 | 53 | testCaptureImage() async { 54 | /// Capture Image; 55 | print("TAP BEFORE CAPTURE"); 56 | await driver.tap(captureButton); 57 | print("TAP AFTER CAPTURE"); 58 | /// Wait for new widget. 59 | await driver.waitFor(capturedImageWidget); 60 | print("CAPTURE IMAGE RENDERED"); 61 | await driver.waitFor(capturedImageCancelButton); 62 | } 63 | 64 | testDiscardImage() async { 65 | /// Discard Image. 66 | await driver.tap(capturedImageCancelButton); 67 | print("IMAGE DISCARDED"); 68 | 69 | /// Wait if CaptureImage widget disappers 70 | await driver.waitForAbsent(capturedImageWidget); 71 | } 72 | 73 | testSaveImage() async { 74 | /// 75 | /// Save Image 76 | await driver.tap(confirmImageButton); 77 | 78 | await driver.waitForAbsent(capturedImageWidget); 79 | await driver.waitForAbsent(cameraStream); 80 | 81 | await driver.waitFor(capturedImagePreview); 82 | } 83 | 84 | /// 85 | /// 86 | /// 87 | /// 88 | /// ================================================================================= 89 | /// 90 | /// ###### ##### #### ###### #### ###### ### ##### ###### 91 | /// ## ## ## ## ## ## ## ## ## ## ## 92 | /// ## ##### ### ## ### ## ## ## ##### ## 93 | /// ## ## ## ## ## ## ####### ## ## ## 94 | /// ## ##### #### ## #### ## ## ## ## ## ## 95 | /// 96 | /// ================================================================================= 97 | 98 | test('Camera Stream is rendered and Cancel button is working', () async { 99 | await testOpenCameraStream(); 100 | 101 | await testCloseCameraStream(); 102 | }); 103 | 104 | test('Camera Stream is rendered and Toggle button is working', () async { 105 | await testOpenCameraStream(); 106 | 107 | /// Switch Camera 108 | await driver.tap(cameraTogglebutton); 109 | 110 | /// Close Camera 111 | await testCloseCameraStream(); 112 | }); 113 | 114 | test('Image is captured using second camera and discarded', () async { 115 | await testOpenCameraStream(); 116 | 117 | /// Switch Camera 118 | await driver.tap(cameraTogglebutton); 119 | 120 | /// 121 | await testCaptureImage(); 122 | 123 | await testDiscardImage(); 124 | 125 | /// 126 | /// Close Camera stream 127 | await testCloseCameraStream(); 128 | }); 129 | 130 | test('Image is captured using primary camera and discarded', () async { 131 | await testOpenCameraStream(); 132 | print("CAMERA OPENED"); 133 | 134 | /// 135 | /// 136 | await testCaptureImage(); 137 | print("IMAGE CAPTURED"); 138 | 139 | /// 140 | /// 141 | await testDiscardImage(); 142 | 143 | /// 144 | /// 145 | await testCloseCameraStream(); 146 | }); 147 | 148 | test("Image is captured by primary camera and saved", () async { 149 | await testOpenCameraStream(); 150 | 151 | await testCaptureImage(); 152 | 153 | await testSaveImage(); 154 | }); 155 | 156 | /// 157 | /// 158 | /// 159 | test("Image is captured by secondary camera and saved", () async { 160 | await testOpenCameraStream(); 161 | 162 | await driver.tap(cameraTogglebutton); 163 | 164 | await driver.waitFor(captureButton); 165 | /// 166 | await testCaptureImage(); 167 | 168 | await testSaveImage(); 169 | }); 170 | }); 171 | } 172 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | example/ios/GoogleService-Info.plist 19 | example/ios/Runner/GoogleService-Info.plist 20 | 21 | # Visual Studio Code related 22 | .vscode/ 23 | 24 | # Flutter repo-specific 25 | /bin/cache/ 26 | /bin/mingit/ 27 | /dev/benchmarks/mega_gallery/ 28 | /dev/bots/.recipe_deps 29 | /dev/bots/android_tools/ 30 | /dev/docs/doc/ 31 | /dev/docs/flutter.docs.zip 32 | /dev/docs/lib/ 33 | /dev/docs/pubspec.yaml 34 | /packages/flutter/coverage/ 35 | version 36 | 37 | # packages file containing multi-root paths 38 | .packages.generated 39 | 40 | # Flutter/Dart/Pub related 41 | **/doc/api/ 42 | .dart_tool/ 43 | .flutter-plugins 44 | .packages 45 | .pub-cache/ 46 | .pub/ 47 | # If you're building an application, you may want to check-in your pubspec.lock 48 | pubspec.lock 49 | 50 | # Directory created by dartdoc 51 | # If you don't generate documentation locally you can remove this line. 52 | doc/api/ 53 | 54 | ### Intellij ### 55 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 56 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 57 | 58 | # User-specific stuff: 59 | .idea/**/workspace.xml 60 | .idea/**/tasks.xml 61 | 62 | # Sensitive or high-churn files: 63 | .idea/**/dataSources/ 64 | .idea/**/dataSources.ids 65 | .idea/**/dataSources.xml 66 | .idea/**/dataSources.local.xml 67 | .idea/**/sqlDataSources.xml 68 | .idea/**/dynamic.xml 69 | .idea/**/uiDesigner.xml 70 | 71 | # Gradle: 72 | .idea/**/gradle.xml 73 | .idea/**/libraries 74 | 75 | # CMake 76 | cmake-build-debug/ 77 | 78 | # Mongo Explorer plugin: 79 | .idea/**/mongoSettings.xml 80 | 81 | ## File-based project format: 82 | 83 | ## Plugin-specific files: 84 | 85 | # IntelliJ 86 | 87 | # mpeltonen/sbt-idea plugin 88 | 89 | # JIRA plugin 90 | 91 | # Cursive Clojure plugin 92 | .idea/replstate.xml 93 | 94 | # Crashlytics plugin (for Android Studio and IntelliJ) 95 | 96 | ### Intellij Patch ### 97 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 98 | 99 | # *.iml 100 | # modules.xml 101 | # .idea/misc.xml 102 | # *.ipr 103 | 104 | # Sonarlint plugin 105 | .idea/sonarlint 106 | 107 | ### Objective-C ### 108 | # Xcode 109 | # 110 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 111 | 112 | ## Build generated 113 | DerivedData/ 114 | 115 | ## Various settings 116 | *.pbxuser 117 | !default.pbxuser 118 | *.mode1v3 119 | !default.mode1v3 120 | *.mode2v3 121 | !default.mode2v3 122 | *.perspectivev3 123 | !default.perspectivev3 124 | xcuserdata/ 125 | 126 | ## Other 127 | *.moved-aside 128 | *.xccheckout 129 | *.xcscmblueprint 130 | 131 | ## Obj-C/Swift specific 132 | *.hmap 133 | *.ipa 134 | *.dSYM.zip 135 | *.dSYM 136 | 137 | # CocoaPods - Refactored to standalone file 138 | 139 | 140 | # Carthage - Refactored to standalone file 141 | 142 | # fastlane 143 | # 144 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 145 | # screenshots whenever they are needed. 146 | # For more information about the recommended setup visit: 147 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 148 | 149 | fastlane/report.xml 150 | fastlane/Preview.html 151 | fastlane/screenshots 152 | fastlane/test_output 153 | 154 | # Code Injection 155 | # 156 | # After new code Injection tools there's a generated folder /iOSInjectionProject 157 | # https://github.com/johnno1962/injectionforxcode 158 | 159 | iOSInjectionProject/ 160 | 161 | ### Objective-C Patch ### 162 | 163 | ### Swift ### 164 | # Xcode 165 | # 166 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 167 | 168 | ## Build generated 169 | ios/Flutter/App.framework/flutter_assets 170 | Flutter/App.framework/flutter_assets 171 | ios/Flutter/flutter_export_environment.sh 172 | ios/AppStore_com.atlan.collect.dev.mobileprovision 173 | ios/XY6BPYQ63G.cer 174 | ios/WRJFA4L2C7.cer 175 | ## Various settings 176 | 177 | ## Other 178 | 179 | ## Obj-C/Swift specific 180 | 181 | ## Playgrounds 182 | timeline.xctimeline 183 | playground.xcworkspace 184 | 185 | # Swift Package Manager 186 | # 187 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 188 | # Packages/ 189 | # Package.pins 190 | .build/ 191 | 192 | # CocoaPods - Refactored to standalone file 193 | 194 | # Carthage - Refactored to standalone file 195 | 196 | # fastlane 197 | # 198 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 199 | # screenshots whenever they are needed. 200 | # For more information about the recommended setup visit: 201 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 202 | 203 | 204 | ### Xcode ### 205 | # Xcode 206 | # 207 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 208 | # ios/Flutter/App.framework/ 209 | # ios/Runner.xcworkspace/xcshareddata/ 210 | ## Build generated 211 | 212 | ## Various settings 213 | 214 | ## Other 215 | 216 | ### Xcode Patch ### 217 | *.xcodeproj/* 218 | !*.xcodeproj/project.pbxproj 219 | !*.xcodeproj/xcshareddata/ 220 | !*.xcworkspace/contents.xcworkspacedata 221 | /*.gcno 222 | 223 | # Build files 224 | build/ 225 | flutter_*.png 226 | linked_*.ds 227 | unlinked.ds 228 | unlinked_spec.ds 229 | 230 | # Android related 231 | **/android/**/gradle-wrapper.jar 232 | **/android/.gradle 233 | **/android/captures/ 234 | **/android/gradlew 235 | **/android/gradlew.bat 236 | **/android/local.properties 237 | **/android/**/GeneratedPluginRegistrant.java 238 | **/android/key.properties 239 | *.jks 240 | 241 | # iOS/XCode related 242 | **/ios/**/*.mode1v3 243 | **/ios/**/*.mode2v3 244 | **/ios/**/*.moved-aside 245 | **/ios/**/*.pbxuser 246 | **/ios/**/*.perspectivev3 247 | **/ios/**/*sync/ 248 | **/ios/**/.sconsign.dblite 249 | **/ios/**/.tags* 250 | **/ios/**/.vagrant/ 251 | **/ios/**/DerivedData/ 252 | **/ios/**/Icon? 253 | **/ios/**/Pods/ 254 | **/ios/**/.symlinks/ 255 | **/ios/**/profile 256 | **/ios/**/xcuserdata 257 | **/ios/.generated/ 258 | **/ios/Flutter/App.framework 259 | **/ios/Flutter/Flutter.framework 260 | **/ios/Flutter/Generated.xcconfig 261 | **/ios/Flutter/app.flx 262 | **/ios/Flutter/app.zip 263 | **/ios/Flutter/flutter_assets/ 264 | **/ios/ServiceDefinitions.json 265 | **/ios/Runner/GeneratedPluginRegistrant.* 266 | 267 | # Exceptions to above rules. 268 | !**/ios/**/default.mode1v3 269 | !**/ios/**/default.mode2v3 270 | !**/ios/**/default.pbxuser 271 | !**/ios/**/default.perspectivev3 272 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 273 | 274 | 275 | .flutter-plugins 276 | android/local.properties 277 | ios/Flutter/Generated.xcconfig 278 | # ios/Runner.xcodeproj/project.pbxproj 279 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.10" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.3.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.5" 32 | camera: 33 | dependency: "direct main" 34 | description: 35 | name: camera 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.5.5+1" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.2" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.14.11" 53 | convert: 54 | dependency: transitive 55 | description: 56 | name: convert 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.1" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.3" 67 | file: 68 | dependency: transitive 69 | description: 70 | name: file 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "5.1.0" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_driver: 80 | dependency: "direct dev" 81 | description: flutter 82 | source: sdk 83 | version: "0.0.0" 84 | flutter_image_compress: 85 | dependency: "direct main" 86 | description: 87 | name: flutter_image_compress 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.6.3" 91 | flutter_test: 92 | dependency: "direct dev" 93 | description: flutter 94 | source: sdk 95 | version: "0.0.0" 96 | fuchsia_remote_debug_protocol: 97 | dependency: transitive 98 | description: flutter 99 | source: sdk 100 | version: "0.0.0" 101 | image: 102 | dependency: transitive 103 | description: 104 | name: image 105 | url: "https://pub.dartlang.org" 106 | source: hosted 107 | version: "2.1.4" 108 | intl: 109 | dependency: transitive 110 | description: 111 | name: intl 112 | url: "https://pub.dartlang.org" 113 | source: hosted 114 | version: "0.16.0" 115 | json_rpc_2: 116 | dependency: transitive 117 | description: 118 | name: json_rpc_2 119 | url: "https://pub.dartlang.org" 120 | source: hosted 121 | version: "2.1.0" 122 | matcher: 123 | dependency: transitive 124 | description: 125 | name: matcher 126 | url: "https://pub.dartlang.org" 127 | source: hosted 128 | version: "0.12.5" 129 | meta: 130 | dependency: transitive 131 | description: 132 | name: meta 133 | url: "https://pub.dartlang.org" 134 | source: hosted 135 | version: "1.1.7" 136 | path: 137 | dependency: transitive 138 | description: 139 | name: path 140 | url: "https://pub.dartlang.org" 141 | source: hosted 142 | version: "1.6.4" 143 | pedantic: 144 | dependency: transitive 145 | description: 146 | name: pedantic 147 | url: "https://pub.dartlang.org" 148 | source: hosted 149 | version: "1.8.0+1" 150 | petitparser: 151 | dependency: transitive 152 | description: 153 | name: petitparser 154 | url: "https://pub.dartlang.org" 155 | source: hosted 156 | version: "2.4.0" 157 | platform: 158 | dependency: transitive 159 | description: 160 | name: platform 161 | url: "https://pub.dartlang.org" 162 | source: hosted 163 | version: "2.2.1" 164 | process: 165 | dependency: transitive 166 | description: 167 | name: process 168 | url: "https://pub.dartlang.org" 169 | source: hosted 170 | version: "3.0.12" 171 | pub_semver: 172 | dependency: transitive 173 | description: 174 | name: pub_semver 175 | url: "https://pub.dartlang.org" 176 | source: hosted 177 | version: "1.4.2" 178 | quiver: 179 | dependency: transitive 180 | description: 181 | name: quiver 182 | url: "https://pub.dartlang.org" 183 | source: hosted 184 | version: "2.0.5" 185 | sky_engine: 186 | dependency: transitive 187 | description: flutter 188 | source: sdk 189 | version: "0.0.99" 190 | source_span: 191 | dependency: transitive 192 | description: 193 | name: source_span 194 | url: "https://pub.dartlang.org" 195 | source: hosted 196 | version: "1.5.5" 197 | stack_trace: 198 | dependency: transitive 199 | description: 200 | name: stack_trace 201 | url: "https://pub.dartlang.org" 202 | source: hosted 203 | version: "1.9.3" 204 | stream_channel: 205 | dependency: transitive 206 | description: 207 | name: stream_channel 208 | url: "https://pub.dartlang.org" 209 | source: hosted 210 | version: "2.0.0" 211 | string_scanner: 212 | dependency: transitive 213 | description: 214 | name: string_scanner 215 | url: "https://pub.dartlang.org" 216 | source: hosted 217 | version: "1.0.5" 218 | term_glyph: 219 | dependency: transitive 220 | description: 221 | name: term_glyph 222 | url: "https://pub.dartlang.org" 223 | source: hosted 224 | version: "1.1.0" 225 | test_api: 226 | dependency: transitive 227 | description: 228 | name: test_api 229 | url: "https://pub.dartlang.org" 230 | source: hosted 231 | version: "0.2.5" 232 | typed_data: 233 | dependency: transitive 234 | description: 235 | name: typed_data 236 | url: "https://pub.dartlang.org" 237 | source: hosted 238 | version: "1.1.6" 239 | vector_math: 240 | dependency: transitive 241 | description: 242 | name: vector_math 243 | url: "https://pub.dartlang.org" 244 | source: hosted 245 | version: "2.0.8" 246 | vm_service_client: 247 | dependency: transitive 248 | description: 249 | name: vm_service_client 250 | url: "https://pub.dartlang.org" 251 | source: hosted 252 | version: "0.2.6+2" 253 | web_socket_channel: 254 | dependency: transitive 255 | description: 256 | name: web_socket_channel 257 | url: "https://pub.dartlang.org" 258 | source: hosted 259 | version: "1.1.0" 260 | xml: 261 | dependency: transitive 262 | description: 263 | name: xml 264 | url: "https://pub.dartlang.org" 265 | source: hosted 266 | version: "3.5.0" 267 | sdks: 268 | dart: ">=2.4.0 <3.0.0" 269 | flutter: ">=1.2.0 <2.0.0" 270 | -------------------------------------------------------------------------------- /lib/darwin_camera.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:camera/camera.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import './core/core.dart'; 7 | export './core/core.dart'; 8 | export 'package:camera/camera.dart'; 9 | 10 | class DarwinCamera extends StatefulWidget { 11 | // 12 | /// Flag to enable/disable image compression. 13 | final bool enableCompression; 14 | 15 | /// 16 | /// Disables native back functionality provided by iOS using the swipe gestures. 17 | final bool disableNativeBackFunctionality; 18 | 19 | /// 20 | /// List of cameras availale in the device. 21 | /// 22 | /// How to get the list available cameras? 23 | /// `List cameraDescription = await availableCameras();` 24 | final List cameraDescription; 25 | 26 | /// 27 | /// Path where the image file will be saved. 28 | final String filePath; 29 | 30 | /// 31 | /// Resolution of the image captured 32 | /// Possible values: 33 | /// 1. ResolutionPreset.high 34 | /// 2. ResolutionPreset.medium 35 | /// 3. ResolutionPreset.low 36 | final ResolutionPreset resolution; 37 | 38 | /// 39 | /// Open front camera instead of back camera on launch. 40 | final bool defaultToFrontFacing; 41 | 42 | /// 43 | /// Decides the quality of final image captured. 44 | /// Possible values `0 - 100` 45 | final int quality; 46 | 47 | DarwinCamera({ 48 | Key key, 49 | @required this.cameraDescription, 50 | @required this.filePath, 51 | this.resolution = ResolutionPreset.high, 52 | this.enableCompression = false, 53 | this.disableNativeBackFunctionality = false, 54 | this.defaultToFrontFacing = false, 55 | this.quality = 90, 56 | }) : assert(cameraDescription != null), 57 | assert(filePath != null), 58 | assert(quality >= 0 && quality <= 100), 59 | super(key: key); 60 | 61 | _DarwinCameraState createState() => _DarwinCameraState(); 62 | } 63 | 64 | class _DarwinCameraState extends State 65 | with TickerProviderStateMixin { 66 | /// 67 | CameraState cameraState; 68 | 69 | /// 70 | CameraController cameraController; 71 | CameraDescription cameraDescription; 72 | 73 | /// 74 | int cameraIndex; 75 | 76 | /// 77 | File file; 78 | 79 | @override 80 | void initState() { 81 | super.initState(); 82 | initVariables(); 83 | initCamera(); 84 | } 85 | 86 | @override 87 | void dispose() { 88 | super.dispose(); 89 | cameraController.dispose(); 90 | } 91 | 92 | /// 93 | initVariables() { 94 | cameraState = CameraState.NOT_CAPTURING; 95 | file = File(widget.filePath); 96 | 97 | /// 98 | int defaultCameraIndex = widget.defaultToFrontFacing ? 1 : 0; 99 | selectCamera(defaultCameraIndex, reInitialize: false); 100 | } 101 | 102 | selectCamera(int index, {bool reInitialize}) { 103 | cameraIndex = index; 104 | cameraDescription = widget.cameraDescription[cameraIndex]; 105 | cameraController = CameraController(cameraDescription, widget.resolution); 106 | if (reInitialize) { 107 | initCamera(); 108 | } 109 | } 110 | 111 | /// 112 | initCamera() { 113 | cameraController.initialize().then((onValue) { 114 | /// 115 | /// 116 | /// !DANGER: Do not remove this piece of code. 117 | /// Why? 118 | /// Removing this code will make the library stuck in loading state. 119 | /// After `mounting` we call `setState` so that the widget rebuild and 120 | /// we see a stream of camera instead of loader. 121 | if (!mounted) { 122 | return; 123 | } 124 | setState(() {}); 125 | }); 126 | } 127 | 128 | captureImage() async { 129 | // print("[+] CAPTURE IMAGE"); 130 | 131 | setCameraState(CameraState.CAPTURING); 132 | 133 | /// 134 | try { 135 | String savedFilePath; 136 | savedFilePath = await DarwinCameraHelper.captureImage( 137 | cameraController, 138 | widget.filePath, 139 | enableCompression: widget.enableCompression, 140 | ); 141 | file = File(savedFilePath); 142 | setCameraState(CameraState.CAPTURED); 143 | } catch (e) { 144 | print(e); 145 | setCameraState(CameraState.NOT_CAPTURING); 146 | } 147 | } 148 | 149 | setCameraState(CameraState newState) { 150 | /// 151 | setState(() { 152 | cameraState = newState; 153 | }); 154 | } 155 | 156 | toggleCamera() { 157 | // print("[+] TOGGLE CAMERA"); 158 | int nextCameraIndex; 159 | if (cameraIndex == 0) { 160 | nextCameraIndex = 1; 161 | } else { 162 | nextCameraIndex = 0; 163 | } 164 | setState(() { 165 | selectCamera(nextCameraIndex, reInitialize: true); 166 | }); 167 | } 168 | 169 | @override 170 | Widget build(BuildContext context) { 171 | bool isCameraInitialized = cameraController.value.isInitialized; 172 | bool areMultipleCamerasAvailable = widget.cameraDescription.length > 1; 173 | // print("REBUILD CAMERA STREAM"); 174 | if (isCameraInitialized) { 175 | return Stack( 176 | children: [ 177 | getRenderCameraStreamWidget( 178 | showCameraToggle: areMultipleCamerasAvailable, 179 | ), 180 | 181 | /// 182 | /// !important We show captured image on the top of camera preview stream. 183 | /// Else it will throw file path not found error. 184 | Align( 185 | alignment: Alignment.topCenter, 186 | child: Visibility( 187 | visible: cameraState == CameraState.CAPTURED, 188 | child: getCapturedImageWidget(), 189 | ), 190 | ) 191 | ], 192 | ); 193 | } else { 194 | return LoaderOverlay( 195 | visible: true, 196 | ); 197 | } 198 | } 199 | 200 | Widget getRenderCameraStreamWidget({ 201 | bool showCameraToggle, 202 | }) { 203 | return RenderCameraStream( 204 | key: ValueKey("CameraStream"), 205 | cameraController: cameraController, 206 | showHeader: true, 207 | disableNativeBackFunctionality: widget.disableNativeBackFunctionality, 208 | onBackPress: () { 209 | Navigator.pop(context); 210 | }, 211 | showFooter: true, 212 | leftFooterButton: CancelButton( 213 | onTap: null, 214 | opacity: 0, 215 | ), 216 | centerFooterButton: CaptureButton( 217 | key: ValueKey("CaptureButton"), 218 | buttonPosition: captureButtonPosition, 219 | buttonSize: captureButtonSize, 220 | onTap: captureImage, 221 | ), 222 | rightFooterButton: ToggleCameraButton( 223 | key: ValueKey("CameraToggleButton"), 224 | onTap: toggleCamera, 225 | opacity: showCameraToggle ? 1.0 : 0.0, 226 | ), 227 | ); 228 | } 229 | 230 | Widget getCapturedImageWidget() { 231 | // print(file.path); 232 | // print(file.path); 233 | // print(file.path); 234 | // print(file.path); 235 | return RenderCapturedImage( 236 | key: ValueKey("RenderCapturedImageWidget"), 237 | file: file, 238 | leftFooterButton: CancelButton( 239 | key: ValueKey("CapturedImageCancelButton"), 240 | opacity: 1, 241 | onTap: () { 242 | setCameraState(CameraState.NOT_CAPTURING); 243 | }, 244 | ), 245 | centerFooterButton: ConfirmButton( 246 | key: ValueKey("ConfirmImageButton"), 247 | onTap: () { 248 | DarwinCameraHelper.returnResult(context, file: file); 249 | }, 250 | ), 251 | rightFooterButton: CancelButton( 252 | onTap: null, 253 | opacity: 0, 254 | ), 255 | ); 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'dart:async'; 5 | 6 | import 'package:darwin_camera/darwin_camera.dart'; 7 | 8 | import 'package:path_provider/path_provider.dart'; 9 | import 'package:permission_handler/permission_handler.dart'; 10 | 11 | void main() => runApp(MyApp()); 12 | 13 | class MyApp extends StatefulWidget { 14 | @override 15 | _MyAppState createState() => _MyAppState(); 16 | } 17 | 18 | class _MyAppState extends State { 19 | 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | } 25 | 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return MaterialApp( 30 | home: Scaffold( 31 | appBar: AppBar( 32 | title: const Text('Darwin Camera Plugin'), 33 | ), 34 | body: DarwinCameraTutorial(), 35 | ), 36 | ); 37 | } 38 | } 39 | 40 | class DarwinCameraTutorial extends StatefulWidget { 41 | const DarwinCameraTutorial({Key key}) : super(key: key); 42 | 43 | @override 44 | _DarwinCameraTutorialState createState() => _DarwinCameraTutorialState(); 45 | } 46 | 47 | class _DarwinCameraTutorialState extends State { 48 | File imageFile; 49 | bool isImageCaptured; 50 | 51 | @override 52 | void initState() { 53 | super.initState(); 54 | 55 | isImageCaptured = false; 56 | } 57 | 58 | openCamera(BuildContext context) async { 59 | PermissionHandler permissionHandler = PermissionHandler(); 60 | 61 | await checkForPermissionBasedOnPermissionGroup( 62 | permissionHandler, 63 | PermissionGroup.camera, 64 | ); 65 | 66 | /// 67 | /// Microphone permission is required for android devices. 68 | /// if permission isn't given before opening camera. 69 | /// The app will crash. 70 | /// 71 | /// For iOS devices, it's not neccessary. You can skip microphone permission. 72 | /// Required for android devices. 73 | await checkForPermissionBasedOnPermissionGroup( 74 | permissionHandler, 75 | PermissionGroup.microphone, 76 | ); 77 | 78 | /// 79 | String filePath = await FileUtils.getDefaultFilePath(); 80 | String uuid = DateTime.now().millisecondsSinceEpoch.toString(); 81 | 82 | /// 83 | filePath = '$filePath/$uuid.png'; 84 | 85 | List cameraDescription = await availableCameras(); 86 | 87 | //// 88 | DarwinCameraResult result = await Navigator.push( 89 | context, 90 | MaterialPageRoute( 91 | builder: (context) => DarwinCamera( 92 | cameraDescription: cameraDescription, 93 | filePath: filePath, 94 | resolution: ResolutionPreset.high, 95 | defaultToFrontFacing: false, 96 | quality: 90, 97 | ), 98 | ), 99 | ); 100 | 101 | /// 102 | /// 103 | if (result != null && result.isFileAvailable) { 104 | setState(() { 105 | isImageCaptured = true; 106 | imageFile = result.file; 107 | }); 108 | print(result.file); 109 | print(result.file.path); 110 | } 111 | 112 | /// 113 | } 114 | 115 | @override 116 | Widget build(BuildContext context) { 117 | return Container( 118 | width: double.infinity, 119 | child: Column( 120 | crossAxisAlignment: CrossAxisAlignment.stretch, 121 | children: [ 122 | SizedBox( 123 | height: 40.0, 124 | ), 125 | Padding( 126 | padding: EdgeInsets.all(16), 127 | child: ButtonWithImage( 128 | key: ValueKey("OpenDarwinCameraButton"), 129 | title: "Open Darwin Camera", 130 | iconData: Icons.camera_alt, 131 | onTap: () { 132 | print("[+] OPEN CAMERA"); 133 | openCamera(context); 134 | }, 135 | ), 136 | ), 137 | if (isImageCaptured) 138 | Container( 139 | margin: padding_a_xs, 140 | padding: padding_a_xxs, 141 | decoration: BoxDecoration( 142 | color: DarwinPrimaryLight, 143 | borderRadius: BorderRadius.circular(grid_spacer * 2), 144 | ), 145 | child: ClipRRect( 146 | borderRadius: BorderRadius.circular(grid_spacer), 147 | child: Image.file( 148 | imageFile, 149 | key: ValueKey("CapturedImagePreview"), 150 | fit: BoxFit.fitHeight, 151 | alignment: Alignment.center, 152 | height: 300, 153 | ), 154 | ), 155 | ) 156 | ], 157 | ), 158 | ); 159 | } 160 | } 161 | 162 | Future checkForPermissionBasedOnPermissionGroup( 163 | PermissionHandler permissionHandler, 164 | PermissionGroup permissionType, 165 | ) async { 166 | /// 167 | PermissionStatus permission; 168 | permission = await permissionHandler.checkPermissionStatus(permissionType); 169 | if (permission == PermissionStatus.granted) { 170 | // takeImageFromCameraAndSave(); 171 | return true; 172 | } 173 | var status = await permissionHandler.requestPermissions([permissionType]); 174 | permission = status[permissionType]; 175 | 176 | if (permission == PermissionStatus.granted) { 177 | // takeImageFromCameraAndSave(); 178 | return true; 179 | } else { 180 | /// 181 | /// ASK USER TO GO TO SETTINGS TO GIVE PERMISSION; 182 | 183 | return false; 184 | } 185 | } 186 | 187 | class FileUtils { 188 | static Future getDefaultFilePath() async { 189 | try { 190 | Directory appDocDir = await getApplicationDocumentsDirectory(); 191 | String mediaDirectory = appDocDir.path + "/media"; 192 | Directory(mediaDirectory).create(recursive: true); 193 | return mediaDirectory; 194 | } catch (error, stacktrace) { 195 | print('could not create folder for media assets'); 196 | print(error); 197 | print(stacktrace); 198 | return null; 199 | } 200 | } 201 | } 202 | 203 | class ButtonWithImage extends StatelessWidget { 204 | final Key key; 205 | final VoidCallback onTap; 206 | final EdgeInsets padding; 207 | final Icon icon; 208 | final IconData iconData; 209 | final String title; 210 | 211 | ButtonWithImage({ 212 | this.key, 213 | @required this.onTap, 214 | this.padding, 215 | this.icon, 216 | this.iconData, 217 | this.title, 218 | }); 219 | 220 | @override 221 | Widget build(BuildContext context) { 222 | return Container( 223 | decoration: BoxDecoration( 224 | color: DarwinPrimaryLight, 225 | borderRadius: BorderRadius.circular(grid_spacer * 2), 226 | ), 227 | child: InkWell( 228 | onTap: onTap, 229 | child: Center( 230 | child: Container( 231 | margin: margin_a_s, 232 | child: Row( 233 | mainAxisAlignment: MainAxisAlignment.start, 234 | children: [ 235 | Icon( 236 | iconData, 237 | color: DarwinPrimary, 238 | size: grid_spacer * 5, 239 | ), 240 | SizedBox( 241 | width: grid_spacer * 1.5, 242 | ), 243 | Text( 244 | title.toUpperCase(), 245 | style: Theme.of(context).textTheme.display1.copyWith( 246 | color: DarwinPrimary, 247 | height: 1.2, 248 | fontSize: 20, 249 | ), 250 | textAlign: TextAlign.left, 251 | ), 252 | ], 253 | ), 254 | ), 255 | ), 256 | ), 257 | ); 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /lib/theme/dimensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const double grid_spacer = 8.0; 4 | 5 | // --------------------------------- 6 | // Margins (All) 7 | // --------------------------------- 8 | const margin_none = EdgeInsets.all(0); 9 | const margin_a_xxs = EdgeInsets.all(grid_spacer); 10 | const margin_a_xs = EdgeInsets.all(grid_spacer * 2); 11 | const margin_a_s = EdgeInsets.all(grid_spacer * 3); 12 | const margin_a_m = EdgeInsets.all(grid_spacer * 4); 13 | const margin_a_l = EdgeInsets.all(grid_spacer * 5); 14 | const margin_a_xl = EdgeInsets.all(grid_spacer * 6); 15 | const margin_a_xxl = EdgeInsets.all(grid_spacer * 7); 16 | 17 | // Margins (X-Axis) 18 | const margin_x_none = EdgeInsets.symmetric(horizontal: 0); 19 | const margin_x_xxs = EdgeInsets.symmetric(horizontal: grid_spacer); 20 | const margin_x_xs = EdgeInsets.symmetric(horizontal: grid_spacer * 2); 21 | const margin_x_s = EdgeInsets.symmetric(horizontal: grid_spacer * 3); 22 | const margin_x_m = EdgeInsets.symmetric(horizontal: grid_spacer * 4); 23 | const margin_x_l = EdgeInsets.symmetric(horizontal: grid_spacer * 5); 24 | const margin_x_xl = EdgeInsets.symmetric(horizontal: grid_spacer * 6); 25 | const margin_x_xxl = EdgeInsets.symmetric(horizontal: grid_spacer * 7); 26 | 27 | // Margins (Y-Axis) 28 | const margin_y_none = EdgeInsets.symmetric(vertical: 0); 29 | const margin_y_xxs = EdgeInsets.symmetric(vertical: grid_spacer); 30 | const margin_y_xs = EdgeInsets.symmetric(vertical: grid_spacer * 2); 31 | const margin_y_s = EdgeInsets.symmetric(vertical: grid_spacer * 3); 32 | const margin_y_m = EdgeInsets.symmetric(vertical: grid_spacer * 4); 33 | const margin_y_l = EdgeInsets.symmetric(vertical: grid_spacer * 5); 34 | const margin_y_xl = EdgeInsets.symmetric(vertical: grid_spacer * 6); 35 | const margin_y_xxl = EdgeInsets.symmetric(vertical: grid_spacer * 7); 36 | 37 | // Margins (Top) 38 | const margin_top_none = EdgeInsets.only(top: 0); 39 | const margin_top_xxs = EdgeInsets.fromLTRB(0, grid_spacer, 0, 0); 40 | const margin_top_xs = EdgeInsets.fromLTRB(0, grid_spacer * 2, 0, 0); 41 | const margin_top_s = EdgeInsets.fromLTRB(0, grid_spacer * 3, 0, 0); 42 | const margin_top_m = EdgeInsets.fromLTRB(0, grid_spacer * 4, 0, 0); 43 | const margin_top_l = EdgeInsets.fromLTRB(0, grid_spacer * 5, 0, 0); 44 | const margin_top_xl = EdgeInsets.fromLTRB(0, grid_spacer * 6, 0, 0); 45 | const margin_top_xxl = EdgeInsets.fromLTRB(0, grid_spacer * 7, 0, 0); 46 | 47 | // Margins (Right) 48 | const margin_right_none = EdgeInsets.only(right: 0); 49 | const margin_right_xxs = EdgeInsets.fromLTRB(0, 0, grid_spacer, 0); 50 | const margin_right_xs = EdgeInsets.fromLTRB(0, 0, grid_spacer * 2, 0); 51 | const margin_right_s = EdgeInsets.fromLTRB(0, 0, grid_spacer * 3, 0); 52 | const margin_right_m = EdgeInsets.fromLTRB(0, 0, grid_spacer * 4, 0); 53 | const margin_right_l = EdgeInsets.fromLTRB(0, 0, grid_spacer * 5, 0); 54 | const margin_right_xl = EdgeInsets.fromLTRB(0, 0, grid_spacer * 6, 0); 55 | const margin_right_xxl = EdgeInsets.fromLTRB(0, 0, grid_spacer * 7, 0); 56 | 57 | // Margins (Bottom) 58 | const margin_bottom_none = EdgeInsets.only(bottom: 0); 59 | const margin_bottom_xxs = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer); 60 | const margin_bottom_xs = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 2); 61 | const margin_bottom_s = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 3); 62 | const margin_bottom_m = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 4); 63 | const margin_bottom_l = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 5); 64 | const margin_bottom_xl = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 6); 65 | const margin_bottom_xxl = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 7); 66 | 67 | // Margins (Left) 68 | const margin_left_none = EdgeInsets.only(left: 0); 69 | const margin_left_xxs = EdgeInsets.fromLTRB(grid_spacer, 0, 0, 0); 70 | const margin_left_xs = EdgeInsets.fromLTRB(grid_spacer * 2, 0, 0, 0); 71 | const margin_left_s = EdgeInsets.fromLTRB(grid_spacer * 3, 0, 0, 0); 72 | const margin_left_m = EdgeInsets.fromLTRB(grid_spacer * 4, 0, 0, 0); 73 | const margin_left_l = EdgeInsets.fromLTRB(grid_spacer * 5, 0, 0, 0); 74 | const margin_left_xl = EdgeInsets.fromLTRB(grid_spacer * 6, 0, 0, 0); 75 | const margin_left_xxl = EdgeInsets.fromLTRB(grid_spacer * 7, 0, 0, 0); 76 | 77 | 78 | // --------------------------------- 79 | // Paddings (All) 80 | // --------------------------------- 81 | 82 | 83 | const padding_none = EdgeInsets.all(0); 84 | /// grid_spacer * 0.5 85 | const padding_a_xxxs = EdgeInsets.all(grid_spacer * 0.5); 86 | /// grid_spacer * 1 87 | const padding_a_xxs = EdgeInsets.all(grid_spacer); 88 | /// grid_spacer * 2 89 | const padding_a_xs = EdgeInsets.all(grid_spacer * 2); 90 | /// grid_spacer * 3 91 | const padding_a_s = EdgeInsets.all(grid_spacer * 3); 92 | /// grid_spacer * 4 93 | const padding_a_m = EdgeInsets.all(grid_spacer * 4); 94 | /// grid_spacer * 5 95 | const padding_a_l = EdgeInsets.all(grid_spacer * 5); 96 | /// grid_spacer * 6 97 | const padding_a_xl = EdgeInsets.all(grid_spacer * 6); 98 | /// grid_spacer * 7 99 | const padding_a_xxl = EdgeInsets.all(grid_spacer * 7); 100 | 101 | // Paddings (X-Axis) 102 | const padding_x_none = EdgeInsets.symmetric(horizontal: 0); 103 | /// grid_spacer * 1 104 | const padding_x_xxs = EdgeInsets.symmetric(horizontal: grid_spacer); 105 | /// grid_spacer * 2 106 | const padding_x_xs = EdgeInsets.symmetric(horizontal: grid_spacer * 2); 107 | /// grid_spacer * 3 108 | const padding_x_s = EdgeInsets.symmetric(horizontal: grid_spacer * 3); 109 | /// grid_spacer * 4 110 | const padding_x_m = EdgeInsets.symmetric(horizontal: grid_spacer * 4); 111 | /// grid_spacer * 5 112 | const padding_x_l = EdgeInsets.symmetric(horizontal: grid_spacer * 5); 113 | /// grid_spacer * 6 114 | const padding_x_xl = EdgeInsets.symmetric(horizontal: grid_spacer * 6); 115 | /// grid_spacer * 7 116 | const padding_x_xxl = EdgeInsets.symmetric(horizontal: grid_spacer * 7); 117 | 118 | // Paddings (Y-Axis) 119 | const padding_y_none = EdgeInsets.symmetric(vertical: 0); 120 | /// grid_spacer * 0.5 121 | const padding_y_xxxs = EdgeInsets.symmetric(vertical: grid_spacer * 0.5); 122 | /// grid_spacer * 1 123 | const padding_y_xxs = EdgeInsets.symmetric(vertical: grid_spacer); 124 | /// grid_spacer * 2 125 | const padding_y_xs = EdgeInsets.symmetric(vertical: grid_spacer * 2); 126 | /// grid_spacer * 3 127 | const padding_y_s = EdgeInsets.symmetric(vertical: grid_spacer * 3); 128 | /// grid_spacer * 4 129 | const padding_y_m = EdgeInsets.symmetric(vertical: grid_spacer * 4); 130 | /// grid_spacer * 5 131 | const padding_y_l = EdgeInsets.symmetric(vertical: grid_spacer * 5); 132 | /// grid_spacer * 6 133 | const padding_y_xl = EdgeInsets.symmetric(vertical: grid_spacer * 6); 134 | /// grid_spacer * 7 135 | const padding_y_xxl = EdgeInsets.symmetric(vertical: grid_spacer * 7); 136 | 137 | // Paddings (Top) 138 | const padding_top_none = EdgeInsets.only(top: 0); 139 | /// grid_spacer * 1 140 | const padding_top_xxs = EdgeInsets.fromLTRB(0, grid_spacer, 0, 0); 141 | const padding_top_xs = EdgeInsets.fromLTRB(0, grid_spacer * 2, 0, 0); 142 | /// grid_spacer * 2 143 | const padding_top_s = EdgeInsets.fromLTRB(0, grid_spacer * 3, 0, 0); 144 | /// grid_spacer * 3 145 | const padding_top_m = EdgeInsets.fromLTRB(0, grid_spacer * 4, 0, 0); 146 | /// grid_spacer * 4 147 | const padding_top_l = EdgeInsets.fromLTRB(0, grid_spacer * 5, 0, 0); 148 | /// grid_spacer * 5 149 | const padding_top_xl = EdgeInsets.fromLTRB(0, grid_spacer * 6, 0, 0); 150 | /// grid_spacer * 6 151 | const padding_top_xxl = EdgeInsets.fromLTRB(0, grid_spacer * 7, 0, 0); 152 | /// grid_spacer * 7 153 | 154 | // Paddings (Right) 155 | const padding_right_none = EdgeInsets.only(right: 0); 156 | /// grid_spacer * 1 157 | const padding_right_xxs = EdgeInsets.fromLTRB(0, 0, grid_spacer, 0); 158 | /// grid_spacer * 2 159 | const padding_right_xs = EdgeInsets.fromLTRB(0, 0, grid_spacer * 2, 0); 160 | /// grid_spacer * 3 161 | const padding_right_s = EdgeInsets.fromLTRB(0, 0, grid_spacer * 3, 0); 162 | /// grid_spacer * 4 163 | const padding_right_m = EdgeInsets.fromLTRB(0, 0, grid_spacer * 4, 0); 164 | /// grid_spacer * 5 165 | const padding_right_l = EdgeInsets.fromLTRB(0, 0, grid_spacer * 5, 0); 166 | /// grid_spacer * 6 167 | const padding_right_xl = EdgeInsets.fromLTRB(0, 0, grid_spacer * 6, 0); 168 | /// grid_spacer * 7 169 | const padding_right_xxl = EdgeInsets.fromLTRB(0, 0, grid_spacer * 7, 0); 170 | 171 | // Paddings (Bottom) 172 | const padding_bottom_none = EdgeInsets.only(bottom: 0); 173 | /// grid_spacer * 1 174 | const padding_bottom_xxs = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer); 175 | /// grid_spacer * 2 176 | const padding_bottom_xs = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 2); 177 | /// grid_spacer * 3 178 | const padding_bottom_s = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 3); 179 | /// grid_spacer * 4 180 | const padding_bottom_m = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 4); 181 | /// grid_spacer * 5 182 | const padding_bottom_l = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 5); 183 | /// grid_spacer * 6 184 | const padding_bottom_xl = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 6); 185 | /// grid_spacer * 7 186 | const padding_bottom_xxl = EdgeInsets.fromLTRB(0, 0, 0, grid_spacer * 7); 187 | 188 | // Paddings (Left) 189 | const padding_top_left = EdgeInsets.only(left: 0); 190 | /// grid_spacer / 2 191 | const padding_left_xxxs = EdgeInsets.fromLTRB(grid_spacer/2, 0, 0, 0); 192 | /// grid_spacer * 1 193 | const padding_left_xxs = EdgeInsets.fromLTRB(grid_spacer, 0, 0, 0); 194 | /// grid_spacer * 2 195 | const padding_left_xs = EdgeInsets.fromLTRB(grid_spacer * 2, 0, 0, 0); 196 | /// grid_spacer * 3 197 | const padding_left_s = EdgeInsets.fromLTRB(grid_spacer * 3, 0, 0, 0); 198 | /// grid_spacer * 4 199 | const padding_left_m = EdgeInsets.fromLTRB(grid_spacer * 4, 0, 0, 0); 200 | /// grid_spacer * 5 201 | const padding_left_l = EdgeInsets.fromLTRB(grid_spacer * 5, 0, 0, 0); 202 | /// grid_spacer * 6 203 | const padding_left_xl = EdgeInsets.fromLTRB(grid_spacer * 6, 0, 0, 0); 204 | /// grid_spacer * 7 205 | const padding_left_xxl = EdgeInsets.fromLTRB(grid_spacer * 7, 0, 0, 0); 206 | 207 | 208 | 209 | // --------------------------------- 210 | // Buttons 211 | // --------------------------------- 212 | const padding_button_s = EdgeInsets.symmetric(horizontal: grid_spacer * 2); 213 | const padding_button_m = EdgeInsets.symmetric(horizontal: grid_spacer * 2); 214 | const padding_button_l = EdgeInsets.symmetric(horizontal: grid_spacer * 2); -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | analyzer: 5 | dependency: transitive 6 | description: 7 | name: analyzer 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.36.4" 11 | archive: 12 | dependency: transitive 13 | description: 14 | name: archive 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.0.10" 18 | args: 19 | dependency: transitive 20 | description: 21 | name: args 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.5.2" 25 | async: 26 | dependency: transitive 27 | description: 28 | name: async 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.3.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.0.5" 39 | camera: 40 | dependency: "direct main" 41 | description: 42 | name: camera 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "0.5.5+1" 46 | charcode: 47 | dependency: transitive 48 | description: 49 | name: charcode 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.1.2" 53 | collection: 54 | dependency: transitive 55 | description: 56 | name: collection 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.14.11" 60 | convert: 61 | dependency: transitive 62 | description: 63 | name: convert 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.1" 67 | crypto: 68 | dependency: transitive 69 | description: 70 | name: crypto 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.1.3" 74 | csslib: 75 | dependency: transitive 76 | description: 77 | name: csslib 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.16.1" 81 | cupertino_icons: 82 | dependency: "direct main" 83 | description: 84 | name: cupertino_icons 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "0.1.2" 88 | darwin_camera: 89 | dependency: "direct dev" 90 | description: 91 | path: ".." 92 | relative: true 93 | source: path 94 | version: "0.0.2" 95 | file: 96 | dependency: transitive 97 | description: 98 | name: file 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "5.1.0" 102 | flutter: 103 | dependency: "direct main" 104 | description: flutter 105 | source: sdk 106 | version: "0.0.0" 107 | flutter_driver: 108 | dependency: "direct dev" 109 | description: flutter 110 | source: sdk 111 | version: "0.0.0" 112 | flutter_image_compress: 113 | dependency: transitive 114 | description: 115 | name: flutter_image_compress 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "0.6.3" 119 | flutter_test: 120 | dependency: transitive 121 | description: flutter 122 | source: sdk 123 | version: "0.0.0" 124 | front_end: 125 | dependency: transitive 126 | description: 127 | name: front_end 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "0.1.19" 131 | fuchsia_remote_debug_protocol: 132 | dependency: transitive 133 | description: flutter 134 | source: sdk 135 | version: "0.0.0" 136 | glob: 137 | dependency: transitive 138 | description: 139 | name: glob 140 | url: "https://pub.dartlang.org" 141 | source: hosted 142 | version: "1.2.0" 143 | html: 144 | dependency: transitive 145 | description: 146 | name: html 147 | url: "https://pub.dartlang.org" 148 | source: hosted 149 | version: "0.14.0+3" 150 | http: 151 | dependency: transitive 152 | description: 153 | name: http 154 | url: "https://pub.dartlang.org" 155 | source: hosted 156 | version: "0.12.0+2" 157 | http_multi_server: 158 | dependency: transitive 159 | description: 160 | name: http_multi_server 161 | url: "https://pub.dartlang.org" 162 | source: hosted 163 | version: "2.1.0" 164 | http_parser: 165 | dependency: transitive 166 | description: 167 | name: http_parser 168 | url: "https://pub.dartlang.org" 169 | source: hosted 170 | version: "3.1.3" 171 | image: 172 | dependency: transitive 173 | description: 174 | name: image 175 | url: "https://pub.dartlang.org" 176 | source: hosted 177 | version: "2.1.4" 178 | intl: 179 | dependency: transitive 180 | description: 181 | name: intl 182 | url: "https://pub.dartlang.org" 183 | source: hosted 184 | version: "0.16.0" 185 | io: 186 | dependency: transitive 187 | description: 188 | name: io 189 | url: "https://pub.dartlang.org" 190 | source: hosted 191 | version: "0.3.3" 192 | js: 193 | dependency: transitive 194 | description: 195 | name: js 196 | url: "https://pub.dartlang.org" 197 | source: hosted 198 | version: "0.6.1+1" 199 | json_rpc_2: 200 | dependency: transitive 201 | description: 202 | name: json_rpc_2 203 | url: "https://pub.dartlang.org" 204 | source: hosted 205 | version: "2.1.0" 206 | kernel: 207 | dependency: transitive 208 | description: 209 | name: kernel 210 | url: "https://pub.dartlang.org" 211 | source: hosted 212 | version: "0.3.19" 213 | matcher: 214 | dependency: transitive 215 | description: 216 | name: matcher 217 | url: "https://pub.dartlang.org" 218 | source: hosted 219 | version: "0.12.5" 220 | meta: 221 | dependency: transitive 222 | description: 223 | name: meta 224 | url: "https://pub.dartlang.org" 225 | source: hosted 226 | version: "1.1.7" 227 | mime: 228 | dependency: transitive 229 | description: 230 | name: mime 231 | url: "https://pub.dartlang.org" 232 | source: hosted 233 | version: "0.9.6+3" 234 | multi_server_socket: 235 | dependency: transitive 236 | description: 237 | name: multi_server_socket 238 | url: "https://pub.dartlang.org" 239 | source: hosted 240 | version: "1.0.2" 241 | node_interop: 242 | dependency: transitive 243 | description: 244 | name: node_interop 245 | url: "https://pub.dartlang.org" 246 | source: hosted 247 | version: "1.0.3" 248 | node_io: 249 | dependency: transitive 250 | description: 251 | name: node_io 252 | url: "https://pub.dartlang.org" 253 | source: hosted 254 | version: "1.0.1+2" 255 | node_preamble: 256 | dependency: transitive 257 | description: 258 | name: node_preamble 259 | url: "https://pub.dartlang.org" 260 | source: hosted 261 | version: "1.4.8" 262 | package_config: 263 | dependency: transitive 264 | description: 265 | name: package_config 266 | url: "https://pub.dartlang.org" 267 | source: hosted 268 | version: "1.1.0" 269 | package_resolver: 270 | dependency: transitive 271 | description: 272 | name: package_resolver 273 | url: "https://pub.dartlang.org" 274 | source: hosted 275 | version: "1.0.10" 276 | path: 277 | dependency: transitive 278 | description: 279 | name: path 280 | url: "https://pub.dartlang.org" 281 | source: hosted 282 | version: "1.6.4" 283 | path_provider: 284 | dependency: "direct main" 285 | description: 286 | name: path_provider 287 | url: "https://pub.dartlang.org" 288 | source: hosted 289 | version: "0.5.0+1" 290 | pedantic: 291 | dependency: transitive 292 | description: 293 | name: pedantic 294 | url: "https://pub.dartlang.org" 295 | source: hosted 296 | version: "1.8.0+1" 297 | permission_handler: 298 | dependency: "direct main" 299 | description: 300 | name: permission_handler 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "3.3.0" 304 | petitparser: 305 | dependency: transitive 306 | description: 307 | name: petitparser 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "2.4.0" 311 | platform: 312 | dependency: transitive 313 | description: 314 | name: platform 315 | url: "https://pub.dartlang.org" 316 | source: hosted 317 | version: "2.2.1" 318 | pool: 319 | dependency: transitive 320 | description: 321 | name: pool 322 | url: "https://pub.dartlang.org" 323 | source: hosted 324 | version: "1.4.0" 325 | process: 326 | dependency: transitive 327 | description: 328 | name: process 329 | url: "https://pub.dartlang.org" 330 | source: hosted 331 | version: "3.0.12" 332 | pub_semver: 333 | dependency: transitive 334 | description: 335 | name: pub_semver 336 | url: "https://pub.dartlang.org" 337 | source: hosted 338 | version: "1.4.2" 339 | quiver: 340 | dependency: transitive 341 | description: 342 | name: quiver 343 | url: "https://pub.dartlang.org" 344 | source: hosted 345 | version: "2.0.5" 346 | shelf: 347 | dependency: transitive 348 | description: 349 | name: shelf 350 | url: "https://pub.dartlang.org" 351 | source: hosted 352 | version: "0.7.5" 353 | shelf_packages_handler: 354 | dependency: transitive 355 | description: 356 | name: shelf_packages_handler 357 | url: "https://pub.dartlang.org" 358 | source: hosted 359 | version: "1.0.4" 360 | shelf_static: 361 | dependency: transitive 362 | description: 363 | name: shelf_static 364 | url: "https://pub.dartlang.org" 365 | source: hosted 366 | version: "0.2.8" 367 | shelf_web_socket: 368 | dependency: transitive 369 | description: 370 | name: shelf_web_socket 371 | url: "https://pub.dartlang.org" 372 | source: hosted 373 | version: "0.2.3" 374 | sky_engine: 375 | dependency: transitive 376 | description: flutter 377 | source: sdk 378 | version: "0.0.99" 379 | source_map_stack_trace: 380 | dependency: transitive 381 | description: 382 | name: source_map_stack_trace 383 | url: "https://pub.dartlang.org" 384 | source: hosted 385 | version: "1.1.5" 386 | source_maps: 387 | dependency: transitive 388 | description: 389 | name: source_maps 390 | url: "https://pub.dartlang.org" 391 | source: hosted 392 | version: "0.10.8" 393 | source_span: 394 | dependency: transitive 395 | description: 396 | name: source_span 397 | url: "https://pub.dartlang.org" 398 | source: hosted 399 | version: "1.5.5" 400 | stack_trace: 401 | dependency: transitive 402 | description: 403 | name: stack_trace 404 | url: "https://pub.dartlang.org" 405 | source: hosted 406 | version: "1.9.3" 407 | stream_channel: 408 | dependency: transitive 409 | description: 410 | name: stream_channel 411 | url: "https://pub.dartlang.org" 412 | source: hosted 413 | version: "2.0.0" 414 | string_scanner: 415 | dependency: transitive 416 | description: 417 | name: string_scanner 418 | url: "https://pub.dartlang.org" 419 | source: hosted 420 | version: "1.0.5" 421 | term_glyph: 422 | dependency: transitive 423 | description: 424 | name: term_glyph 425 | url: "https://pub.dartlang.org" 426 | source: hosted 427 | version: "1.1.0" 428 | test: 429 | dependency: "direct dev" 430 | description: 431 | name: test 432 | url: "https://pub.dartlang.org" 433 | source: hosted 434 | version: "1.6.3" 435 | test_api: 436 | dependency: transitive 437 | description: 438 | name: test_api 439 | url: "https://pub.dartlang.org" 440 | source: hosted 441 | version: "0.2.5" 442 | test_core: 443 | dependency: transitive 444 | description: 445 | name: test_core 446 | url: "https://pub.dartlang.org" 447 | source: hosted 448 | version: "0.2.5" 449 | typed_data: 450 | dependency: transitive 451 | description: 452 | name: typed_data 453 | url: "https://pub.dartlang.org" 454 | source: hosted 455 | version: "1.1.6" 456 | vector_math: 457 | dependency: transitive 458 | description: 459 | name: vector_math 460 | url: "https://pub.dartlang.org" 461 | source: hosted 462 | version: "2.0.8" 463 | vm_service_client: 464 | dependency: transitive 465 | description: 466 | name: vm_service_client 467 | url: "https://pub.dartlang.org" 468 | source: hosted 469 | version: "0.2.6+2" 470 | watcher: 471 | dependency: transitive 472 | description: 473 | name: watcher 474 | url: "https://pub.dartlang.org" 475 | source: hosted 476 | version: "0.9.7+12" 477 | web_socket_channel: 478 | dependency: transitive 479 | description: 480 | name: web_socket_channel 481 | url: "https://pub.dartlang.org" 482 | source: hosted 483 | version: "1.1.0" 484 | xml: 485 | dependency: transitive 486 | description: 487 | name: xml 488 | url: "https://pub.dartlang.org" 489 | source: hosted 490 | version: "3.5.0" 491 | yaml: 492 | dependency: transitive 493 | description: 494 | name: yaml 495 | url: "https://pub.dartlang.org" 496 | source: hosted 497 | version: "2.2.0" 498 | sdks: 499 | dart: ">=2.4.0 <3.0.0" 500 | flutter: ">=1.2.0 <2.0.0" 501 | -------------------------------------------------------------------------------- /lib/core/ui.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:camera/camera.dart'; 4 | import 'package:darwin_camera/core/core.dart'; 5 | import 'package:darwin_camera/core/helper.dart'; 6 | import 'package:flutter/material.dart'; 7 | 8 | double captureButtonInnerBorderRadius = grid_spacer * 10; 9 | double captureButtonInnerShutterSize = grid_spacer * 8; 10 | double captureButtonPosition = grid_spacer; 11 | double captureButtonSize = grid_spacer * 10; 12 | 13 | enum CameraState { NOT_CAPTURING, CAPTURING, CAPTURED } 14 | 15 | class RenderCameraStream extends StatelessWidget { 16 | final CameraController cameraController; 17 | final bool showHeader; 18 | final bool showFooter; 19 | final bool disableNativeBackFunctionality; 20 | final Widget leftFooterButton; 21 | final Widget centerFooterButton; 22 | final Widget rightFooterButton; 23 | final Function onBackPress; 24 | 25 | const RenderCameraStream({ 26 | Key key, 27 | 28 | /// 29 | @required this.cameraController, 30 | @required this.showHeader, 31 | this.disableNativeBackFunctionality = false, 32 | this.onBackPress, 33 | 34 | /// 35 | @required this.showFooter, 36 | @required this.leftFooterButton, 37 | @required this.centerFooterButton, 38 | @required this.rightFooterButton, 39 | }) : super(key: key); 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return WillPopScope( 44 | onWillPop: this.disableNativeBackFunctionality 45 | ? () async { 46 | return false; 47 | } 48 | : null, 49 | child: Stack( 50 | children: [ 51 | getCameraStream(context), 52 | getHeader(showHeader), 53 | getFooter(showFooter), 54 | ], 55 | ), 56 | ); 57 | } 58 | 59 | /// 60 | /// This will render stream on camera on the screen. 61 | /// Scaling is important here as the default camera stream 62 | /// isn't perfect. 63 | Widget getCameraStream(BuildContext context) { 64 | Size size = MediaQuery.of(context).size; 65 | final double cameraAspectRatio = cameraController.value.aspectRatio; 66 | 67 | /// 68 | return ClipRect( 69 | child: Container( 70 | child: Center( 71 | child: AspectRatio( 72 | aspectRatio: cameraAspectRatio, 73 | child: CameraPreview(cameraController), 74 | // (cameraMode == CameraMode.BARCODE) 75 | // ? Container() 76 | // : previewCamera(cameraState), 77 | ), 78 | ), 79 | /// 80 | /// FIX: Provide multiple presets and aspects ratio to the users. 81 | // Transform.scale( 82 | // scale: cameraAspectRatio / size.aspectRatio, 83 | // child: Center( 84 | // child: AspectRatio( 85 | // aspectRatio: cameraAspectRatio, 86 | // child: CameraPreview(cameraController), 87 | // // (cameraMode == CameraMode.BARCODE) 88 | // // ? Container() 89 | // // : previewCamera(cameraState), 90 | // ), 91 | // ), 92 | // ), 93 | ), 94 | ); 95 | } 96 | 97 | /// 98 | /// Header is aligned in the top center 99 | /// It will show back button onf this page 100 | Widget getHeader(bool showHeader) { 101 | return Visibility( 102 | child: Align( 103 | alignment: Alignment.topCenter, 104 | child: Container( 105 | decoration: BoxDecoration( 106 | gradient: DarwinCameraHelper.backgroundGradient( 107 | Alignment.topCenter, 108 | Alignment.bottomCenter, 109 | ), 110 | ), 111 | padding: padding_x_s + padding_top_s + padding_bottom_xl, 112 | child: SafeArea( 113 | child: Row( 114 | children: [ 115 | CancelButton( 116 | key: ValueKey("HeaderCancelButton"), 117 | opacity: 1, 118 | padding: padding_a_xs, 119 | onTap: () { 120 | if (onBackPress != null) { 121 | onBackPress(); 122 | } 123 | }, 124 | ), 125 | ], 126 | ), 127 | ), 128 | ), 129 | ), 130 | ); 131 | } 132 | 133 | Widget getFooter(bool showFooter) { 134 | return Visibility( 135 | visible: showFooter, 136 | child: CameraFooter( 137 | leftButton: leftFooterButton, 138 | centerButton: centerFooterButton, 139 | rightButton: rightFooterButton, 140 | ), 141 | ); 142 | } 143 | } 144 | 145 | class RenderCapturedImage extends StatelessWidget { 146 | final File file; 147 | 148 | /// 149 | final Widget leftFooterButton; 150 | final Widget centerFooterButton; 151 | final Widget rightFooterButton; 152 | 153 | /// 154 | const RenderCapturedImage({ 155 | Key key, 156 | @required this.file, 157 | @required this.leftFooterButton, 158 | @required this.centerFooterButton, 159 | @required this.rightFooterButton, 160 | }) : super(key: key); 161 | 162 | @override 163 | Widget build(BuildContext context) { 164 | return Stack( 165 | children: [ 166 | Positioned.fill( 167 | child: Container( 168 | color: DarwinBlack, 169 | height: double.infinity, 170 | child: Image.file( 171 | file, 172 | fit: BoxFit.contain, 173 | width: double.infinity, 174 | alignment: Alignment.center, 175 | ), 176 | ), 177 | ), 178 | CameraFooter( 179 | leftButton: leftFooterButton, 180 | centerButton: centerFooterButton, 181 | rightButton: rightFooterButton, 182 | ), 183 | ], 184 | ); 185 | } 186 | } 187 | 188 | class CameraFooter extends StatelessWidget { 189 | final Widget leftButton; 190 | final Widget centerButton; 191 | final Widget rightButton; 192 | 193 | CameraFooter({ 194 | Key key, 195 | @required this.leftButton, 196 | @required this.centerButton, 197 | @required this.rightButton, 198 | }) : super(key: key); 199 | 200 | @override 201 | Widget build(BuildContext context) { 202 | return Align( 203 | alignment: Alignment.bottomCenter, 204 | child: Container( 205 | decoration: BoxDecoration( 206 | gradient: DarwinCameraHelper.backgroundGradient( 207 | Alignment.bottomCenter, 208 | Alignment.topCenter, 209 | ), 210 | ), 211 | padding: padding_x_s + padding_top_xl + padding_bottom_l, 212 | child: SafeArea( 213 | child: Row( 214 | mainAxisAlignment: MainAxisAlignment.spaceAround, 215 | children: [leftButton, centerButton, rightButton], 216 | ), 217 | ), 218 | ), 219 | ); 220 | } 221 | } 222 | 223 | class CancelButton extends StatelessWidget { 224 | /// 225 | final Function onTap; 226 | final double opacity; 227 | final EdgeInsets padding; 228 | 229 | /// 230 | CancelButton({ 231 | Key key, 232 | @required this.onTap, 233 | @required this.opacity, 234 | this.padding = padding_a_s, 235 | }) : super(key: key); 236 | 237 | @override 238 | Widget build(BuildContext context) { 239 | return GestureDetector( 240 | onTap: () { 241 | if (onTap != null) { 242 | onTap(); 243 | } 244 | }, 245 | child: Container( 246 | padding: padding, 247 | child: Opacity( 248 | opacity: opacity, 249 | child: Icon( 250 | Icons.cancel, 251 | color: DarwinWhite, 252 | size: grid_spacer * 4, 253 | ), 254 | ), 255 | ), 256 | ); 257 | } 258 | } 259 | //============================================================= 260 | // 261 | // #### ### ##### ###### ## ## ##### ##### 262 | // ## ## ## ## ## ## ## ## ## ## ## 263 | // ## ## ## ##### ## ## ## ##### ##### 264 | // ## ####### ## ## ## ## ## ## ## 265 | // #### ## ## ## ## ##### ## ## ##### 266 | // 267 | // 268 | // ##### ## ## ###### ###### ##### ## ## 269 | // ## ## ## ## ## ## ## ## #### ## 270 | // ##### ## ## ## ## ## ## ## ## ## 271 | // ## ## ## ## ## ## ## ## ## ### 272 | // ##### ##### ## ## ##### ## ## 273 | // 274 | //========================================================= 275 | 276 | class CaptureButton extends StatelessWidget { 277 | final double buttonSize; 278 | final double buttonPosition; 279 | final Function onTap; 280 | 281 | CaptureButton({ 282 | Key key, 283 | @required this.buttonSize, 284 | @required this.buttonPosition, 285 | @required this.onTap, 286 | }) : super(key: key); 287 | 288 | @override 289 | Widget build(BuildContext context) { 290 | return GestureDetector( 291 | child: getButtonBody(), 292 | onTap: onTap, 293 | ); 294 | } 295 | 296 | Widget getButtonBody() { 297 | return Container( 298 | height: grid_spacer * 14, 299 | width: grid_spacer * 14, 300 | alignment: Alignment.center, 301 | child: Stack( 302 | children: [ 303 | AnimatedContainer( 304 | alignment: Alignment.center, 305 | duration: Duration(milliseconds: 100), 306 | width: buttonSize, 307 | height: buttonSize, 308 | decoration: BoxDecoration( 309 | color: DarwinWhite.withOpacity(0.25), 310 | borderRadius: BorderRadius.circular(grid_spacer * 12), 311 | ), 312 | ), 313 | AnimatedPositioned( 314 | duration: Duration(milliseconds: 100), 315 | top: buttonPosition, 316 | left: buttonPosition, 317 | child: AnimatedContainer( 318 | duration: Duration(milliseconds: 100), 319 | width: grid_spacer * 8, 320 | height: grid_spacer * 8, 321 | decoration: BoxDecoration( 322 | color: DarwinWhite, 323 | borderRadius: BorderRadius.circular(grid_spacer * 10), 324 | ), 325 | ), 326 | ), 327 | ], 328 | ), 329 | ); 330 | } 331 | } 332 | 333 | //=============================================================== 334 | // 335 | // #### ##### ## ## ##### ## ##### ### ### 336 | // ## ## ## #### ## ## ## ## ## ## # # ## 337 | // ## ## ## ## ## ## ##### ## ##### ## ## ## 338 | // ## ## ## ## ### ## ## ## ## ## ## 339 | // #### ##### ## ## ## ## ## ## ## ## 340 | // 341 | // 342 | // ##### ## ## ###### ###### ##### ## ## 343 | // ## ## ## ## ## ## ## ## #### ## 344 | // ##### ## ## ## ## ## ## ## ## ## 345 | // ## ## ## ## ## ## ## ## ## ### 346 | // ##### ##### ## ## ##### ## ## 347 | // 348 | //========================================================= 349 | 350 | class ConfirmButton extends StatelessWidget { 351 | final Function onTap; 352 | const ConfirmButton({ 353 | Key key, 354 | @required this.onTap, 355 | }) : super(key: key); 356 | 357 | @override 358 | Widget build(BuildContext context) { 359 | return GestureDetector( 360 | child: Container( 361 | width: grid_spacer * 14, 362 | height: grid_spacer * 14, 363 | alignment: Alignment.center, 364 | child: Container( 365 | width: grid_spacer * 10, 366 | height: grid_spacer * 10, 367 | decoration: BoxDecoration( 368 | borderRadius: BorderRadius.circular(grid_spacer * 12), 369 | color: DarwinSuccess, 370 | ), 371 | child: Icon( 372 | Icons.check, 373 | color: DarwinWhite, 374 | size: grid_spacer * 4, 375 | ), 376 | ), 377 | ), 378 | onTap: () { 379 | if (onTap != null) { 380 | onTap(); 381 | } 382 | }, 383 | ); 384 | } 385 | } 386 | 387 | //================================================================================================================= 388 | // 389 | // ###### ##### #### #### ## ##### #### ### ### ### ##### ##### ### 390 | // ## ## ## ## ## ## ## ## ## ## ## # # ## ## ## ## ## ## 391 | // ## ## ## ## ### ## ### ## ##### ## ## ## ## ## ## ##### ##### ## ## 392 | // ## ## ## ## ## ## ## ## ## ## ####### ## ## ## ## ## ####### 393 | // ## ##### #### #### ###### ##### #### ## ## ## ## ##### ## ## ## ## 394 | // 395 | // 396 | // ##### ## ## ###### ###### ##### ## ## 397 | // ## ## ## ## ## ## ## ## #### ## 398 | // ##### ## ## ## ## ## ## ## ## ## 399 | // ## ## ## ## ## ## ## ## ## ### 400 | // ##### ##### ## ## ##### ## ## 401 | // 402 | //========================================================= 403 | 404 | /// 405 | /// 406 | /// This widget will send event to toggle camera. 407 | class ToggleCameraButton extends StatelessWidget { 408 | final Function onTap; 409 | final double opacity; 410 | const ToggleCameraButton({ 411 | Key key, 412 | @required this.onTap, 413 | this.opacity = 1.0, 414 | }) : super(key: key); 415 | 416 | @override 417 | Widget build(BuildContext context) { 418 | return GestureDetector( 419 | child: Container( 420 | padding: padding_a_s, 421 | child: Opacity( 422 | opacity: opacity, 423 | child: Icon( 424 | Icons.refresh, 425 | color: DarwinWhite, 426 | size: grid_spacer * 4, 427 | ), 428 | ), 429 | ), 430 | onTap: onTap, 431 | ); 432 | } 433 | } 434 | 435 | class LoaderOverlay extends StatelessWidget { 436 | bool isVisible; 437 | 438 | LoaderOverlay({Key key, bool visible, String helperText}) : super(key: key); 439 | 440 | @override 441 | Widget build(BuildContext context) { 442 | return Container(); 443 | } 444 | } 445 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 18 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 19 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 20 | 9CEE9793234FD7DD003C9BCE /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9CEE9792234FD7DD003C9BCE /* GoogleService-Info.plist */; }; 21 | F65ECAA6284B910717BDCA38 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 966DFEBECEFD913317D1EA43 /* Pods_Runner.framework */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 4C00294C23BB824662CA14F0 /* 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 = ""; }; 45 | 5A442C1BFB0A3980452E9FC6 /* 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 = ""; }; 46 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 47 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 49 | 8656AE68BE71B0E8B0A0B7DC /* 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 = ""; }; 50 | 966DFEBECEFD913317D1EA43 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 52 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 53 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 54 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | 9CEE9792234FD7DD003C9BCE /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../GoogleService-Info.plist"; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 68 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 69 | F65ECAA6284B910717BDCA38 /* Pods_Runner.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 0EA18DE294B10819FECD7D2F /* Frameworks */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 966DFEBECEFD913317D1EA43 /* Pods_Runner.framework */, 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | 0ECCE480D7DB41D5E813E2D3 /* Pods */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 8656AE68BE71B0E8B0A0B7DC /* Pods-Runner.debug.xcconfig */, 88 | 4C00294C23BB824662CA14F0 /* Pods-Runner.release.xcconfig */, 89 | 5A442C1BFB0A3980452E9FC6 /* Pods-Runner.profile.xcconfig */, 90 | ); 91 | path = Pods; 92 | sourceTree = ""; 93 | }; 94 | 9740EEB11CF90186004384FC /* Flutter */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 3B80C3931E831B6300D905FE /* App.framework */, 98 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 99 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 100 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 101 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 102 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 103 | ); 104 | name = Flutter; 105 | sourceTree = ""; 106 | }; 107 | 97C146E51CF9000F007C117D = { 108 | isa = PBXGroup; 109 | children = ( 110 | 9740EEB11CF90186004384FC /* Flutter */, 111 | 97C146F01CF9000F007C117D /* Runner */, 112 | 97C146EF1CF9000F007C117D /* Products */, 113 | 0ECCE480D7DB41D5E813E2D3 /* Pods */, 114 | 0EA18DE294B10819FECD7D2F /* Frameworks */, 115 | ); 116 | sourceTree = ""; 117 | }; 118 | 97C146EF1CF9000F007C117D /* Products */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146EE1CF9000F007C117D /* Runner.app */, 122 | ); 123 | name = Products; 124 | sourceTree = ""; 125 | }; 126 | 97C146F01CF9000F007C117D /* Runner */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 130 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 131 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 132 | 97C147021CF9000F007C117D /* Info.plist */, 133 | 97C146F11CF9000F007C117D /* Supporting Files */, 134 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 135 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 136 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 137 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 138 | 9CEE9792234FD7DD003C9BCE /* GoogleService-Info.plist */, 139 | ); 140 | path = Runner; 141 | sourceTree = ""; 142 | }; 143 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | ); 147 | name = "Supporting Files"; 148 | sourceTree = ""; 149 | }; 150 | /* End PBXGroup section */ 151 | 152 | /* Begin PBXNativeTarget section */ 153 | 97C146ED1CF9000F007C117D /* Runner */ = { 154 | isa = PBXNativeTarget; 155 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 156 | buildPhases = ( 157 | 43039F2C4BF2A1BF2728241B /* [CP] Check Pods Manifest.lock */, 158 | 9740EEB61CF901F6004384FC /* Run Script */, 159 | 97C146EA1CF9000F007C117D /* Sources */, 160 | 97C146EB1CF9000F007C117D /* Frameworks */, 161 | 97C146EC1CF9000F007C117D /* Resources */, 162 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 163 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 164 | F6576D255A51E78F1D905BCF /* [CP] Embed Pods Frameworks */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | ); 170 | name = Runner; 171 | productName = Runner; 172 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 173 | productType = "com.apple.product-type.application"; 174 | }; 175 | /* End PBXNativeTarget section */ 176 | 177 | /* Begin PBXProject section */ 178 | 97C146E61CF9000F007C117D /* Project object */ = { 179 | isa = PBXProject; 180 | attributes = { 181 | LastUpgradeCheck = 1020; 182 | ORGANIZATIONNAME = "The Chromium Authors"; 183 | TargetAttributes = { 184 | 97C146ED1CF9000F007C117D = { 185 | CreatedOnToolsVersion = 7.3.1; 186 | DevelopmentTeam = ZB8CXUVLNG; 187 | LastSwiftMigration = 0910; 188 | ProvisioningStyle = Automatic; 189 | }; 190 | }; 191 | }; 192 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 193 | compatibilityVersion = "Xcode 3.2"; 194 | developmentRegion = en; 195 | hasScannedForEncodings = 0; 196 | knownRegions = ( 197 | en, 198 | Base, 199 | ); 200 | mainGroup = 97C146E51CF9000F007C117D; 201 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 202 | projectDirPath = ""; 203 | projectRoot = ""; 204 | targets = ( 205 | 97C146ED1CF9000F007C117D /* Runner */, 206 | ); 207 | }; 208 | /* End PBXProject section */ 209 | 210 | /* Begin PBXResourcesBuildPhase section */ 211 | 97C146EC1CF9000F007C117D /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 216 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 217 | 9CEE9793234FD7DD003C9BCE /* GoogleService-Info.plist in Resources */, 218 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 219 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXResourcesBuildPhase section */ 224 | 225 | /* Begin PBXShellScriptBuildPhase section */ 226 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 227 | isa = PBXShellScriptBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | inputPaths = ( 232 | ); 233 | name = "Thin Binary"; 234 | outputPaths = ( 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | shellPath = /bin/sh; 238 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 239 | }; 240 | 43039F2C4BF2A1BF2728241B /* [CP] Check Pods Manifest.lock */ = { 241 | isa = PBXShellScriptBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | ); 245 | inputFileListPaths = ( 246 | ); 247 | inputPaths = ( 248 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 249 | "${PODS_ROOT}/Manifest.lock", 250 | ); 251 | name = "[CP] Check Pods Manifest.lock"; 252 | outputFileListPaths = ( 253 | ); 254 | outputPaths = ( 255 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | shellPath = /bin/sh; 259 | 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"; 260 | showEnvVarsInLog = 0; 261 | }; 262 | 9740EEB61CF901F6004384FC /* Run Script */ = { 263 | isa = PBXShellScriptBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | ); 267 | inputPaths = ( 268 | ); 269 | name = "Run Script"; 270 | outputPaths = ( 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | shellPath = /bin/sh; 274 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 275 | }; 276 | F6576D255A51E78F1D905BCF /* [CP] Embed Pods Frameworks */ = { 277 | isa = PBXShellScriptBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | ); 281 | inputPaths = ( 282 | ); 283 | name = "[CP] Embed Pods Frameworks"; 284 | outputPaths = ( 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | shellPath = /bin/sh; 288 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 289 | showEnvVarsInLog = 0; 290 | }; 291 | /* End PBXShellScriptBuildPhase section */ 292 | 293 | /* Begin PBXSourcesBuildPhase section */ 294 | 97C146EA1CF9000F007C117D /* Sources */ = { 295 | isa = PBXSourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 299 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | /* End PBXSourcesBuildPhase section */ 304 | 305 | /* Begin PBXVariantGroup section */ 306 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | 97C146FB1CF9000F007C117D /* Base */, 310 | ); 311 | name = Main.storyboard; 312 | sourceTree = ""; 313 | }; 314 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 97C147001CF9000F007C117D /* Base */, 318 | ); 319 | name = LaunchScreen.storyboard; 320 | sourceTree = ""; 321 | }; 322 | /* End PBXVariantGroup section */ 323 | 324 | /* Begin XCBuildConfiguration section */ 325 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 326 | isa = XCBuildConfiguration; 327 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_ANALYZER_NONNULL = YES; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 336 | CLANG_WARN_BOOL_CONVERSION = YES; 337 | CLANG_WARN_COMMA = YES; 338 | CLANG_WARN_CONSTANT_CONVERSION = YES; 339 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INFINITE_RECURSION = YES; 344 | CLANG_WARN_INT_CONVERSION = YES; 345 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 346 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 347 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 348 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 349 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 350 | CLANG_WARN_STRICT_PROTOTYPES = YES; 351 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 357 | ENABLE_NS_ASSERTIONS = NO; 358 | ENABLE_STRICT_OBJC_MSGSEND = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_NO_COMMON_BLOCKS = YES; 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 368 | MTL_ENABLE_DEBUG_INFO = NO; 369 | SDKROOT = iphoneos; 370 | SUPPORTED_PLATFORMS = iphoneos; 371 | TARGETED_DEVICE_FAMILY = "1,2"; 372 | VALIDATE_PRODUCT = YES; 373 | }; 374 | name = Profile; 375 | }; 376 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 377 | isa = XCBuildConfiguration; 378 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 379 | buildSettings = { 380 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 381 | CLANG_ENABLE_MODULES = YES; 382 | CODE_SIGN_IDENTITY = "Apple Development"; 383 | CODE_SIGN_STYLE = Automatic; 384 | CURRENT_PROJECT_VERSION = 2; 385 | DEVELOPMENT_TEAM = ZB8CXUVLNG; 386 | ENABLE_BITCODE = NO; 387 | FRAMEWORK_SEARCH_PATHS = ( 388 | "$(inherited)", 389 | "$(PROJECT_DIR)/Flutter", 390 | ); 391 | INFOPLIST_FILE = Runner/Info.plist; 392 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 394 | LIBRARY_SEARCH_PATHS = ( 395 | "$(inherited)", 396 | "$(PROJECT_DIR)/Flutter", 397 | ); 398 | MARKETING_VERSION = 0.0.2; 399 | PRODUCT_BUNDLE_IDENTIFIER = com.atlan.darwinCamera.dap; 400 | PRODUCT_NAME = Runner; 401 | PROVISIONING_PROFILE_SPECIFIER = ""; 402 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 403 | SWIFT_VERSION = 4.0; 404 | VERSIONING_SYSTEM = "apple-generic"; 405 | }; 406 | name = Profile; 407 | }; 408 | 97C147031CF9000F007C117D /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 411 | buildSettings = { 412 | ALWAYS_SEARCH_USER_PATHS = NO; 413 | CLANG_ANALYZER_NONNULL = YES; 414 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 415 | CLANG_CXX_LIBRARY = "libc++"; 416 | CLANG_ENABLE_MODULES = YES; 417 | CLANG_ENABLE_OBJC_ARC = YES; 418 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 419 | CLANG_WARN_BOOL_CONVERSION = YES; 420 | CLANG_WARN_COMMA = YES; 421 | CLANG_WARN_CONSTANT_CONVERSION = YES; 422 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 423 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 424 | CLANG_WARN_EMPTY_BODY = YES; 425 | CLANG_WARN_ENUM_CONVERSION = YES; 426 | CLANG_WARN_INFINITE_RECURSION = YES; 427 | CLANG_WARN_INT_CONVERSION = YES; 428 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 429 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 430 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 431 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 432 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 433 | CLANG_WARN_STRICT_PROTOTYPES = YES; 434 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 435 | CLANG_WARN_UNREACHABLE_CODE = YES; 436 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 437 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 438 | COPY_PHASE_STRIP = NO; 439 | DEBUG_INFORMATION_FORMAT = dwarf; 440 | ENABLE_STRICT_OBJC_MSGSEND = YES; 441 | ENABLE_TESTABILITY = YES; 442 | GCC_C_LANGUAGE_STANDARD = gnu99; 443 | GCC_DYNAMIC_NO_PIC = NO; 444 | GCC_NO_COMMON_BLOCKS = YES; 445 | GCC_OPTIMIZATION_LEVEL = 0; 446 | GCC_PREPROCESSOR_DEFINITIONS = ( 447 | "DEBUG=1", 448 | "$(inherited)", 449 | ); 450 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 451 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 452 | GCC_WARN_UNDECLARED_SELECTOR = YES; 453 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 454 | GCC_WARN_UNUSED_FUNCTION = YES; 455 | GCC_WARN_UNUSED_VARIABLE = YES; 456 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 457 | MTL_ENABLE_DEBUG_INFO = YES; 458 | ONLY_ACTIVE_ARCH = YES; 459 | SDKROOT = iphoneos; 460 | TARGETED_DEVICE_FAMILY = "1,2"; 461 | }; 462 | name = Debug; 463 | }; 464 | 97C147041CF9000F007C117D /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 467 | buildSettings = { 468 | ALWAYS_SEARCH_USER_PATHS = NO; 469 | CLANG_ANALYZER_NONNULL = YES; 470 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 471 | CLANG_CXX_LIBRARY = "libc++"; 472 | CLANG_ENABLE_MODULES = YES; 473 | CLANG_ENABLE_OBJC_ARC = YES; 474 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 475 | CLANG_WARN_BOOL_CONVERSION = YES; 476 | CLANG_WARN_COMMA = YES; 477 | CLANG_WARN_CONSTANT_CONVERSION = YES; 478 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 479 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 480 | CLANG_WARN_EMPTY_BODY = YES; 481 | CLANG_WARN_ENUM_CONVERSION = YES; 482 | CLANG_WARN_INFINITE_RECURSION = YES; 483 | CLANG_WARN_INT_CONVERSION = YES; 484 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 485 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 486 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 487 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 488 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 489 | CLANG_WARN_STRICT_PROTOTYPES = YES; 490 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 491 | CLANG_WARN_UNREACHABLE_CODE = YES; 492 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 493 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 494 | COPY_PHASE_STRIP = NO; 495 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 496 | ENABLE_NS_ASSERTIONS = NO; 497 | ENABLE_STRICT_OBJC_MSGSEND = YES; 498 | GCC_C_LANGUAGE_STANDARD = gnu99; 499 | GCC_NO_COMMON_BLOCKS = YES; 500 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 501 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 502 | GCC_WARN_UNDECLARED_SELECTOR = YES; 503 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 504 | GCC_WARN_UNUSED_FUNCTION = YES; 505 | GCC_WARN_UNUSED_VARIABLE = YES; 506 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 507 | MTL_ENABLE_DEBUG_INFO = NO; 508 | SDKROOT = iphoneos; 509 | SUPPORTED_PLATFORMS = iphoneos; 510 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 511 | TARGETED_DEVICE_FAMILY = "1,2"; 512 | VALIDATE_PRODUCT = YES; 513 | }; 514 | name = Release; 515 | }; 516 | 97C147061CF9000F007C117D /* Debug */ = { 517 | isa = XCBuildConfiguration; 518 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 519 | buildSettings = { 520 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 521 | CLANG_ENABLE_MODULES = YES; 522 | CODE_SIGN_IDENTITY = "Apple Development"; 523 | CODE_SIGN_STYLE = Automatic; 524 | CURRENT_PROJECT_VERSION = 2; 525 | DEVELOPMENT_TEAM = ZB8CXUVLNG; 526 | ENABLE_BITCODE = NO; 527 | FRAMEWORK_SEARCH_PATHS = ( 528 | "$(inherited)", 529 | "$(PROJECT_DIR)/Flutter", 530 | ); 531 | INFOPLIST_FILE = Runner/Info.plist; 532 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 533 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 534 | LIBRARY_SEARCH_PATHS = ( 535 | "$(inherited)", 536 | "$(PROJECT_DIR)/Flutter", 537 | ); 538 | MARKETING_VERSION = 0.0.2; 539 | PRODUCT_BUNDLE_IDENTIFIER = com.atlan.darwinCamera.dap; 540 | PRODUCT_NAME = Runner; 541 | PROVISIONING_PROFILE_SPECIFIER = ""; 542 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 543 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 544 | SWIFT_VERSION = 4.0; 545 | VERSIONING_SYSTEM = "apple-generic"; 546 | }; 547 | name = Debug; 548 | }; 549 | 97C147071CF9000F007C117D /* Release */ = { 550 | isa = XCBuildConfiguration; 551 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 552 | buildSettings = { 553 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 554 | CLANG_ENABLE_MODULES = YES; 555 | CODE_SIGN_IDENTITY = "Apple Development"; 556 | CODE_SIGN_STYLE = Automatic; 557 | CURRENT_PROJECT_VERSION = 2; 558 | DEVELOPMENT_TEAM = ZB8CXUVLNG; 559 | ENABLE_BITCODE = NO; 560 | FRAMEWORK_SEARCH_PATHS = ( 561 | "$(inherited)", 562 | "$(PROJECT_DIR)/Flutter", 563 | ); 564 | INFOPLIST_FILE = Runner/Info.plist; 565 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 566 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 567 | LIBRARY_SEARCH_PATHS = ( 568 | "$(inherited)", 569 | "$(PROJECT_DIR)/Flutter", 570 | ); 571 | MARKETING_VERSION = 0.0.2; 572 | PRODUCT_BUNDLE_IDENTIFIER = com.atlan.darwinCamera.dap; 573 | PRODUCT_NAME = Runner; 574 | PROVISIONING_PROFILE_SPECIFIER = ""; 575 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 576 | SWIFT_VERSION = 4.0; 577 | VERSIONING_SYSTEM = "apple-generic"; 578 | }; 579 | name = Release; 580 | }; 581 | /* End XCBuildConfiguration section */ 582 | 583 | /* Begin XCConfigurationList section */ 584 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 585 | isa = XCConfigurationList; 586 | buildConfigurations = ( 587 | 97C147031CF9000F007C117D /* Debug */, 588 | 97C147041CF9000F007C117D /* Release */, 589 | 249021D3217E4FDB00AE95B9 /* Profile */, 590 | ); 591 | defaultConfigurationIsVisible = 0; 592 | defaultConfigurationName = Release; 593 | }; 594 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 595 | isa = XCConfigurationList; 596 | buildConfigurations = ( 597 | 97C147061CF9000F007C117D /* Debug */, 598 | 97C147071CF9000F007C117D /* Release */, 599 | 249021D4217E4FDB00AE95B9 /* Profile */, 600 | ); 601 | defaultConfigurationIsVisible = 0; 602 | defaultConfigurationName = Release; 603 | }; 604 | /* End XCConfigurationList section */ 605 | }; 606 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 607 | } 608 | --------------------------------------------------------------------------------