├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── matheusvillela │ │ └── flutter │ │ └── plugins │ │ └── qrcodereader │ │ ├── QRCodeReaderPlugin.java │ │ └── QRScanActivity.java │ └── res │ └── layout │ └── activity_qr_read.xml ├── example ├── .gitignore ├── README.md ├── android.iml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ ├── com │ │ │ │ └── matheusvillela │ │ │ │ │ └── flutter │ │ │ │ │ └── plugins │ │ │ │ │ └── qrcodereaderexample │ │ │ │ │ └── MainActivity.java │ │ │ └── io │ │ │ │ └── flutter │ │ │ │ └── plugins │ │ │ │ └── .gitignore │ │ │ └── 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 │ ├── build.gradle │ ├── gradle.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── flutter_assets │ │ │ ├── AssetManifest.json │ │ │ ├── FontManifest.json │ │ │ ├── LICENSE │ │ │ ├── fonts │ │ │ └── MaterialIcons-Regular.ttf │ │ │ ├── isolate_snapshot_data │ │ │ ├── kernel_blob.bin │ │ │ ├── platform_strong.dill │ │ │ └── vm_snapshot_data │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── 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-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── GeneratedPluginRegistrant.h │ │ ├── GeneratedPluginRegistrant.m │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.yaml └── qrcode_reader_example.iml ├── ios ├── Assets │ └── .gitkeep ├── Classes │ ├── QRCodeReaderPlugin.h │ └── QRCodeReaderPlugin.m └── qrcode_reader.podspec ├── lib └── qrcode_reader.dart └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea 4 | .packages 5 | .pub/ 6 | .dart_tools 7 | build/ 8 | ios/.generated/ 9 | packages 10 | pubspec.lock 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.3.2 2 | 3 | * iOS layout fixes 4 | 5 | ## 0.3.1 6 | 7 | * iOS orientation change fix 8 | 9 | ## 0.3.0 10 | 11 | * iOS support 12 | 13 | ## 0.2.0 14 | 15 | * Configurable permission behaviour 16 | 17 | ## 0.1.4 18 | 19 | * If the permission was granted the camera will open 20 | 21 | ## 0.1.3 22 | 23 | * When the app does not have the camera permission an error is sent in the result 24 | 25 | ## 0.1.2 26 | 27 | * Asking camera permissions 28 | 29 | ## 0.1.0 30 | 31 | * Initial Release 32 | 33 | 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) <2017> 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QRCode Reader plugin for Flutter 2 | 3 | A Flutter plugin for reading QR Codes with the camera. 4 | 5 | ### Example 6 | 7 | ``` dart 8 | import 'package:qrcode_reader/qrcode_reader.dart'; 9 | ``` 10 | 11 | ``` dart 12 | Future futureString = new QRCodeReader() 13 | .setAutoFocusIntervalInMs(200) // default 5000 14 | .setForceAutoFocus(true) // default false 15 | .setTorchEnabled(true) // default false 16 | .setHandlePermissions(true) // default true 17 | .setExecuteAfterPermissionGranted(true) // default true 18 | .setFrontCamera(false) // default false 19 | .scan(); 20 | ``` 21 | 22 | These options are Android only (with the exception of setFrontCamera(bool)), this is the simplest way of plugin usage: 23 | ``` dart 24 | Future futureString = new QRCodeReader().scan(); 25 | ``` 26 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | 10 | /gradle 11 | /gradlew 12 | /gradlew.bat 13 | /tmplibs -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.matheusvillela.flutter.plugins.qrcodereader' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | maven { 9 | url 'https://maven.google.com/' 10 | } 11 | maven { url "https://jitpack.io" } 12 | } 13 | 14 | dependencies { 15 | classpath 'com.android.tools.build:gradle:3.3.0' 16 | } 17 | } 18 | 19 | rootProject.allprojects { 20 | repositories { 21 | google() 22 | jcenter() 23 | maven { 24 | url "https://maven.google.com" 25 | } 26 | maven { 27 | url "https://jitpack.io" 28 | } 29 | } 30 | } 31 | 32 | apply plugin: 'com.android.library' 33 | 34 | android { 35 | compileSdkVersion 28 36 | 37 | defaultConfig { 38 | testInstrumentationRunner "androidx.support.test.runner.AndroidJUnitRunner" 39 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 40 | } 41 | lintOptions { 42 | disable 'InvalidPackage' 43 | } 44 | } 45 | 46 | dependencies { 47 | implementation('com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.3@aar') { 48 | transitive = true 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'qrcode_reader' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/matheusvillela/flutter/plugins/qrcodereader/QRCodeReaderPlugin.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) <2017> 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in all 11 | // copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | // SOFTWARE. 20 | 21 | package com.matheusvillela.flutter.plugins.qrcodereader; 22 | 23 | import android.Manifest; 24 | import android.annotation.TargetApi; 25 | import android.app.Activity; 26 | import android.content.Context; 27 | import android.content.Intent; 28 | import android.content.pm.PackageManager; 29 | import android.os.Build; 30 | import android.os.Process; 31 | 32 | import java.util.Map; 33 | 34 | import io.flutter.plugin.common.MethodCall; 35 | import io.flutter.plugin.common.MethodChannel; 36 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 37 | import io.flutter.plugin.common.MethodChannel.Result; 38 | import io.flutter.plugin.common.PluginRegistry; 39 | import io.flutter.plugin.common.PluginRegistry.ActivityResultListener; 40 | 41 | public class QRCodeReaderPlugin implements MethodCallHandler, ActivityResultListener, PluginRegistry.RequestPermissionsResultListener { 42 | private static final String CHANNEL = "qrcode_reader"; 43 | 44 | private static final int REQUEST_CODE_SCAN_ACTIVITY = 2777; 45 | private static final int REQUEST_CODE_CAMERA_PERMISSION = 3777; 46 | // private static QRCodeReaderPlugin instance; 47 | 48 | private Activity activity; 49 | private Result pendingResult; 50 | private Map arguments; 51 | private boolean executeAfterPermissionGranted; 52 | 53 | public QRCodeReaderPlugin(Activity activity) { 54 | this.activity = activity; 55 | } 56 | 57 | public static void registerWith(PluginRegistry.Registrar registrar) { 58 | // if (instance == null) { 59 | final MethodChannel channel = new MethodChannel(registrar.messenger(), CHANNEL); 60 | final QRCodeReaderPlugin instance = new QRCodeReaderPlugin(registrar.activity()); 61 | registrar.addActivityResultListener(instance); 62 | registrar.addRequestPermissionsResultListener(instance); 63 | channel.setMethodCallHandler(instance); 64 | // } 65 | } 66 | 67 | 68 | @Override 69 | public void onMethodCall(MethodCall call, Result result) { 70 | if (pendingResult != null) { 71 | result.error("ALREADY_ACTIVE", "QR Code reader is already active", null); 72 | return; 73 | } 74 | pendingResult = result; 75 | if (call.method.equals("readQRCode")) { 76 | if (!(call.arguments instanceof Map)) { 77 | throw new IllegalArgumentException("Plugin not passing a map as parameter: " + call.arguments); 78 | } 79 | arguments = (Map) call.arguments; 80 | boolean handlePermission = (boolean) arguments.get("handlePermissions"); 81 | this.executeAfterPermissionGranted = (boolean) arguments.get("executeAfterPermissionGranted"); 82 | 83 | if (checkSelfPermission(activity, 84 | Manifest.permission.CAMERA) 85 | != PackageManager.PERMISSION_GRANTED) { 86 | if (shouldShowRequestPermissionRationale(activity, 87 | Manifest.permission.CAMERA)) { 88 | // TODO: user should be explained why the app needs the permission 89 | if (handlePermission) { 90 | requestPermissions(); 91 | } else { 92 | setNoPermissionsError(); 93 | } 94 | } else { 95 | if (handlePermission) { 96 | requestPermissions(); 97 | } else { 98 | setNoPermissionsError(); 99 | } 100 | } 101 | } else { 102 | startView(); 103 | } 104 | } else { 105 | throw new IllegalArgumentException("Unknown method " + call.method); 106 | } 107 | } 108 | 109 | @TargetApi(Build.VERSION_CODES.M) 110 | private void requestPermissions() { 111 | activity.requestPermissions(new String[]{Manifest.permission.CAMERA}, REQUEST_CODE_CAMERA_PERMISSION); 112 | } 113 | 114 | private boolean shouldShowRequestPermissionRationale(Activity activity, 115 | String permission) { 116 | if (Build.VERSION.SDK_INT >= 23) { 117 | return activity.shouldShowRequestPermissionRationale(permission); 118 | } 119 | return false; 120 | } 121 | 122 | private int checkSelfPermission(Context context, String permission) { 123 | if (permission == null) { 124 | throw new IllegalArgumentException("permission is null"); 125 | } 126 | return context.checkPermission(permission, android.os.Process.myPid(), Process.myUid()); 127 | } 128 | 129 | 130 | private void startView() { 131 | Intent intent = new Intent(activity, QRScanActivity.class); 132 | intent.putExtra(QRScanActivity.EXTRA_FOCUS_INTERVAL, (int) arguments.get("autoFocusIntervalInMs")); 133 | intent.putExtra(QRScanActivity.EXTRA_FORCE_FOCUS, (boolean) arguments.get("forceAutoFocus")); 134 | intent.putExtra(QRScanActivity.EXTRA_TORCH_ENABLED, (boolean) arguments.get("torchEnabled")); 135 | intent.putExtra(QRScanActivity.EXTRA_FRONT_CAMERA, (boolean) arguments.get("frontCamera")); 136 | activity.startActivityForResult(intent, REQUEST_CODE_SCAN_ACTIVITY); 137 | } 138 | 139 | @Override 140 | public boolean onActivityResult(int requestCode, int resultCode, Intent data) { 141 | if (requestCode == REQUEST_CODE_SCAN_ACTIVITY && pendingResult != null) { 142 | if (resultCode == Activity.RESULT_OK) { 143 | String string = data.getStringExtra(QRScanActivity.EXTRA_RESULT); 144 | pendingResult.success(string); 145 | } else { 146 | pendingResult.success(null); 147 | } 148 | pendingResult = null; 149 | arguments = null; 150 | return true; 151 | } 152 | return false; 153 | } 154 | 155 | @Override 156 | public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { 157 | if (requestCode == REQUEST_CODE_CAMERA_PERMISSION) { 158 | for (int i = 0; i < permissions.length; i++) { 159 | String permission = permissions[i]; 160 | int grantResult = grantResults[i]; 161 | 162 | if (permission.equals(Manifest.permission.CAMERA)) { 163 | if (grantResult == PackageManager.PERMISSION_GRANTED) { 164 | if (executeAfterPermissionGranted) { 165 | startView(); 166 | } 167 | } else { 168 | setNoPermissionsError(); 169 | } 170 | } 171 | } 172 | } 173 | return false; 174 | } 175 | 176 | private void setNoPermissionsError() { 177 | pendingResult.error("permission", "you don't have the user permission to access the camera", null); 178 | pendingResult = null; 179 | arguments = null; 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /android/src/main/java/com/matheusvillela/flutter/plugins/qrcodereader/QRScanActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) <2017> 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in all 11 | // copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | // SOFTWARE. 20 | 21 | package com.matheusvillela.flutter.plugins.qrcodereader; 22 | 23 | import android.app.Activity; 24 | import android.content.Intent; 25 | import android.graphics.PointF; 26 | import android.os.Bundle; 27 | 28 | import com.dlazaro66.qrcodereaderview.QRCodeReaderView; 29 | 30 | public class QRScanActivity extends Activity implements QRCodeReaderView.OnQRCodeReadListener { 31 | 32 | private boolean qrRead; 33 | private QRCodeReaderView view; 34 | 35 | public static String EXTRA_RESULT = "extra_result"; 36 | 37 | public static String EXTRA_FOCUS_INTERVAL = "extra_focus_interval"; 38 | public static String EXTRA_FORCE_FOCUS = "extra_force_focus"; 39 | public static String EXTRA_TORCH_ENABLED = "extra_torch_enabled"; 40 | public static String EXTRA_FRONT_CAMERA = "extra_front_camera"; 41 | 42 | protected void onCreate(Bundle savedInstanceState) { 43 | super.onCreate(savedInstanceState); 44 | setContentView(R.layout.activity_qr_read); 45 | view = (QRCodeReaderView) findViewById(R.id.activity_qr_read_reader); 46 | Intent intent = getIntent(); 47 | view.setOnQRCodeReadListener(this); 48 | view.setQRDecodingEnabled(true); 49 | if (intent.getBooleanExtra(EXTRA_FORCE_FOCUS, false)) { 50 | view.forceAutoFocus(); 51 | } 52 | view.setAutofocusInterval(intent.getIntExtra(EXTRA_FOCUS_INTERVAL, 2000)); 53 | view.setTorchEnabled(intent.getBooleanExtra(EXTRA_TORCH_ENABLED, false)); 54 | if (intent.getBooleanExtra(EXTRA_FRONT_CAMERA, false)) { 55 | view.setFrontCamera(); 56 | } 57 | } 58 | 59 | @Override 60 | public void onQRCodeRead(String text, PointF[] points) { 61 | if (!qrRead) { 62 | synchronized (this) { 63 | qrRead = true; 64 | Intent data = new Intent(); 65 | data.putExtra(EXTRA_RESULT, text); 66 | setResult(Activity.RESULT_OK, data); 67 | finish(); 68 | } 69 | } 70 | } 71 | 72 | @Override 73 | protected void onResume() { 74 | super.onResume(); 75 | view.startCamera(); 76 | } 77 | 78 | @Override 79 | protected void onPause() { 80 | super.onPause(); 81 | view.stopCamera(); 82 | } 83 | } -------------------------------------------------------------------------------- /android/src/main/res/layout/activity_qr_read.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea 4 | .packages 5 | .pub/ 6 | build/ 7 | ios/Pods 8 | ios/Podfile.lock 9 | ios/.generated/ 10 | packages 11 | pubspec.lock 12 | .flutter-plugins 13 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # qrcode_reader_example 2 | 3 | Demonstrates how to use the qrcode_reader plugin. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](http://flutter.io/). 9 | -------------------------------------------------------------------------------- /example/android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | 10 | /gradle 11 | /gradlew 12 | /gradlew.bat 13 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withInputStream { stream -> 5 | localProperties.load(stream) 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 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 25 19 | buildToolsVersion '25.0.3' 20 | 21 | lintOptions { 22 | disable 'InvalidPackage' 23 | } 24 | 25 | defaultConfig { 26 | applicationId "com.matheusvillela.flutter.plugins.qrcodereaderexample" 27 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 28 | } 29 | 30 | buildTypes { 31 | release { 32 | // TODO: Add your own signing config for the release build. 33 | // Signing with the debug keys for now, so `flutter run --release` works. 34 | signingConfig signingConfigs.debug 35 | } 36 | } 37 | } 38 | 39 | flutter { 40 | source '../..' 41 | } 42 | 43 | dependencies { 44 | androidTestCompile 'com.android.support:support-annotations:25.0.0' 45 | androidTestCompile 'com.android.support.test:runner:0.5' 46 | androidTestCompile 'com.android.support.test:rules:0.5' 47 | } 48 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/matheusvillela/flutter/plugins/qrcodereaderexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) <2017> 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in all 11 | // copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | // SOFTWARE. 20 | 21 | package com.matheusvillela.flutter.plugins.qrcodereaderexample; 22 | 23 | import android.os.Bundle; 24 | import io.flutter.app.FlutterActivity; 25 | import io.flutter.plugins.GeneratedPluginRegistrant; 26 | 27 | public class MainActivity extends FlutterActivity { 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | GeneratedPluginRegistrant.registerWith(this); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/io/flutter/plugins/.gitignore: -------------------------------------------------------------------------------- 1 | GeneratedPluginRegistrant.java 2 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.1.4' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | jcenter() 15 | maven { 16 | url "https://jitpack.io" 17 | } 18 | maven { 19 | url "https://maven.google.com" 20 | } 21 | } 22 | } 23 | 24 | rootProject.buildDir = '../build' 25 | subprojects { 26 | project.buildDir = "${rootProject.buildDir}/${project.name}" 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | 33 | task wrapper(type: Wrapper) { 34 | gradleVersion = '4.4' 35 | } 36 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /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.withInputStream { stream -> plugins.load(stream) } 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 | -------------------------------------------------------------------------------- /example/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 | *.pbxuser 16 | *.mode1v3 17 | *.mode2v3 18 | *.perspectivev3 19 | 20 | !default.pbxuser 21 | !default.mode1v3 22 | !default.mode2v3 23 | !default.perspectivev3 24 | 25 | xcuserdata 26 | 27 | *.moved-aside 28 | 29 | *.pyc 30 | *sync/ 31 | Icon? 32 | .tags* 33 | 34 | /Flutter/app.flx 35 | /Flutter/app.zip 36 | /Flutter/App.framework 37 | /Flutter/Flutter.framework 38 | /Flutter/Generated.xcconfig 39 | /ServiceDefinitions.json 40 | 41 | Pods/ 42 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_assets/AssetManifest.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_assets/FontManifest.json: -------------------------------------------------------------------------------- 1 | [{"fonts":[{"asset":"fonts/MaterialIcons-Regular.ttf"}],"family":"MaterialIcons"}] -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_assets/fonts/MaterialIcons-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Flutter/flutter_assets/fonts/MaterialIcons-Regular.ttf -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_assets/isolate_snapshot_data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Flutter/flutter_assets/isolate_snapshot_data -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_assets/kernel_blob.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Flutter/flutter_assets/kernel_blob.bin -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_assets/platform_strong.dill: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Flutter/flutter_assets/platform_strong.dill -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_assets/vm_snapshot_data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Flutter/flutter_assets/vm_snapshot_data -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | if ENV['FLUTTER_FRAMEWORK_DIR'] == nil 5 | abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework') 6 | end 7 | 8 | target 'Runner' do 9 | # Pods for Runner 10 | 11 | # Flutter Pods 12 | pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR'] 13 | 14 | if File.exists? '../.flutter-plugins' 15 | flutter_root = File.expand_path('..') 16 | File.foreach('../.flutter-plugins') { |line| 17 | plugin = line.split(pattern='=') 18 | if plugin.length == 2 19 | name = plugin[0].strip() 20 | path = plugin[1].strip() 21 | resolved_path = File.expand_path("#{path}/ios", flutter_root) 22 | pod name, :path => resolved_path 23 | else 24 | puts "Invalid plugin specification: #{line}" 25 | end 26 | } 27 | end 28 | end 29 | 30 | post_install do |installer| 31 | installer.pods_project.targets.each do |target| 32 | target.build_configurations.each do |config| 33 | config.build_settings['ENABLE_BITCODE'] = 'NO' 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /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 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 5234A7DF2E5FFDF3F370049E /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7331AA51C23519866C1E3576 /* libPods-Runner.a */; }; 16 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 17 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 19 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 20 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 21 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 22 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 23 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 24 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXCopyFilesBuildPhase section */ 28 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 29 | isa = PBXCopyFilesBuildPhase; 30 | buildActionMask = 2147483647; 31 | dstPath = ""; 32 | dstSubfolderSpec = 10; 33 | files = ( 34 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 35 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 36 | ); 37 | name = "Embed Frameworks"; 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXCopyFilesBuildPhase section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 44 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 45 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 46 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 47 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 48 | 7331AA51C23519866C1E3576 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 50 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 53 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 54 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 55 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 57 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 59 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 60 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 69 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 70 | 5234A7DF2E5FFDF3F370049E /* libPods-Runner.a in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 2D4C08863EC6C04DE98261D8 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 7331AA51C23519866C1E3576 /* libPods-Runner.a */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 6AEEC775CA9CA78FEF630230 /* Pods */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | ); 89 | name = Pods; 90 | sourceTree = ""; 91 | }; 92 | 9740EEB11CF90186004384FC /* Flutter */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 3B80C3931E831B6300D905FE /* App.framework */, 96 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 97 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 98 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 99 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 100 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 101 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 102 | ); 103 | name = Flutter; 104 | sourceTree = ""; 105 | }; 106 | 97C146E51CF9000F007C117D = { 107 | isa = PBXGroup; 108 | children = ( 109 | 9740EEB11CF90186004384FC /* Flutter */, 110 | 97C146F01CF9000F007C117D /* Runner */, 111 | 97C146EF1CF9000F007C117D /* Products */, 112 | 6AEEC775CA9CA78FEF630230 /* Pods */, 113 | 2D4C08863EC6C04DE98261D8 /* Frameworks */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | 97C146EF1CF9000F007C117D /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 97C146EE1CF9000F007C117D /* Runner.app */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | 97C146F01CF9000F007C117D /* Runner */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 129 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 130 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 131 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 132 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 133 | 97C147021CF9000F007C117D /* Info.plist */, 134 | 97C146F11CF9000F007C117D /* Supporting Files */, 135 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 136 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 137 | ); 138 | path = Runner; 139 | sourceTree = ""; 140 | }; 141 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 97C146F21CF9000F007C117D /* main.m */, 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | /* End PBXGroup section */ 150 | 151 | /* Begin PBXNativeTarget section */ 152 | 97C146ED1CF9000F007C117D /* Runner */ = { 153 | isa = PBXNativeTarget; 154 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 155 | buildPhases = ( 156 | 9279819361B7981B50045B84 /* [CP] Check Pods Manifest.lock */, 157 | 9740EEB61CF901F6004384FC /* Run Script */, 158 | 97C146EA1CF9000F007C117D /* Sources */, 159 | 97C146EB1CF9000F007C117D /* Frameworks */, 160 | 97C146EC1CF9000F007C117D /* Resources */, 161 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 162 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 163 | 38854C8AD2EE65E68504D0BD /* [CP] Embed Pods Frameworks */, 164 | ); 165 | buildRules = ( 166 | ); 167 | dependencies = ( 168 | ); 169 | name = Runner; 170 | productName = Runner; 171 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 172 | productType = "com.apple.product-type.application"; 173 | }; 174 | /* End PBXNativeTarget section */ 175 | 176 | /* Begin PBXProject section */ 177 | 97C146E61CF9000F007C117D /* Project object */ = { 178 | isa = PBXProject; 179 | attributes = { 180 | LastUpgradeCheck = 0830; 181 | ORGANIZATIONNAME = "The Chromium Authors"; 182 | TargetAttributes = { 183 | 97C146ED1CF9000F007C117D = { 184 | CreatedOnToolsVersion = 7.3.1; 185 | DevelopmentTeam = TRVBMB3KPB; 186 | }; 187 | }; 188 | }; 189 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 190 | compatibilityVersion = "Xcode 3.2"; 191 | developmentRegion = English; 192 | hasScannedForEncodings = 0; 193 | knownRegions = ( 194 | en, 195 | Base, 196 | ); 197 | mainGroup = 97C146E51CF9000F007C117D; 198 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 199 | projectDirPath = ""; 200 | projectRoot = ""; 201 | targets = ( 202 | 97C146ED1CF9000F007C117D /* Runner */, 203 | ); 204 | }; 205 | /* End PBXProject section */ 206 | 207 | /* Begin PBXResourcesBuildPhase section */ 208 | 97C146EC1CF9000F007C117D /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 213 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 214 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 215 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 216 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 217 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 218 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | /* End PBXResourcesBuildPhase section */ 223 | 224 | /* Begin PBXShellScriptBuildPhase section */ 225 | 38854C8AD2EE65E68504D0BD /* [CP] Embed Pods Frameworks */ = { 226 | isa = PBXShellScriptBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | ); 230 | inputPaths = ( 231 | "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 232 | "${PODS_ROOT}/../../../../../../../../../Applications/Developing/flutter/bin/cache/artifacts/engine/ios/Flutter.framework", 233 | ); 234 | name = "[CP] Embed Pods Frameworks"; 235 | outputPaths = ( 236 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | shellPath = /bin/sh; 240 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 241 | showEnvVarsInLog = 0; 242 | }; 243 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 244 | isa = PBXShellScriptBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | ); 248 | inputPaths = ( 249 | ); 250 | name = "Thin Binary"; 251 | outputPaths = ( 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | shellPath = /bin/sh; 255 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 256 | }; 257 | 9279819361B7981B50045B84 /* [CP] Check Pods Manifest.lock */ = { 258 | isa = PBXShellScriptBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | ); 262 | inputPaths = ( 263 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 264 | "${PODS_ROOT}/Manifest.lock", 265 | ); 266 | name = "[CP] Check Pods Manifest.lock"; 267 | outputPaths = ( 268 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | shellPath = /bin/sh; 272 | 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"; 273 | showEnvVarsInLog = 0; 274 | }; 275 | 9740EEB61CF901F6004384FC /* Run Script */ = { 276 | isa = PBXShellScriptBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | ); 280 | inputPaths = ( 281 | ); 282 | name = "Run Script"; 283 | outputPaths = ( 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | shellPath = /bin/sh; 287 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 288 | }; 289 | /* End PBXShellScriptBuildPhase section */ 290 | 291 | /* Begin PBXSourcesBuildPhase section */ 292 | 97C146EA1CF9000F007C117D /* Sources */ = { 293 | isa = PBXSourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 297 | 97C146F31CF9000F007C117D /* main.m in Sources */, 298 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | /* End PBXSourcesBuildPhase section */ 303 | 304 | /* Begin PBXVariantGroup section */ 305 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 306 | isa = PBXVariantGroup; 307 | children = ( 308 | 97C146FB1CF9000F007C117D /* Base */, 309 | ); 310 | name = Main.storyboard; 311 | sourceTree = ""; 312 | }; 313 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 314 | isa = PBXVariantGroup; 315 | children = ( 316 | 97C147001CF9000F007C117D /* Base */, 317 | ); 318 | name = LaunchScreen.storyboard; 319 | sourceTree = ""; 320 | }; 321 | /* End PBXVariantGroup section */ 322 | 323 | /* Begin XCBuildConfiguration section */ 324 | 97C147031CF9000F007C117D /* Debug */ = { 325 | isa = XCBuildConfiguration; 326 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 327 | buildSettings = { 328 | ALWAYS_SEARCH_USER_PATHS = NO; 329 | CLANG_ANALYZER_NONNULL = YES; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 337 | CLANG_WARN_EMPTY_BODY = YES; 338 | CLANG_WARN_ENUM_CONVERSION = YES; 339 | CLANG_WARN_INFINITE_RECURSION = YES; 340 | CLANG_WARN_INT_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 343 | CLANG_WARN_UNREACHABLE_CODE = YES; 344 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 345 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 346 | COPY_PHASE_STRIP = NO; 347 | DEBUG_INFORMATION_FORMAT = dwarf; 348 | ENABLE_STRICT_OBJC_MSGSEND = YES; 349 | ENABLE_TESTABILITY = YES; 350 | GCC_C_LANGUAGE_STANDARD = gnu99; 351 | GCC_DYNAMIC_NO_PIC = NO; 352 | GCC_NO_COMMON_BLOCKS = YES; 353 | GCC_OPTIMIZATION_LEVEL = 0; 354 | GCC_PREPROCESSOR_DEFINITIONS = ( 355 | "DEBUG=1", 356 | "$(inherited)", 357 | ); 358 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 359 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 360 | GCC_WARN_UNDECLARED_SELECTOR = YES; 361 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 362 | GCC_WARN_UNUSED_FUNCTION = YES; 363 | GCC_WARN_UNUSED_VARIABLE = YES; 364 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 365 | MTL_ENABLE_DEBUG_INFO = YES; 366 | ONLY_ACTIVE_ARCH = YES; 367 | SDKROOT = iphoneos; 368 | TARGETED_DEVICE_FAMILY = "1,2"; 369 | }; 370 | name = Debug; 371 | }; 372 | 97C147041CF9000F007C117D /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 375 | buildSettings = { 376 | ALWAYS_SEARCH_USER_PATHS = NO; 377 | CLANG_ANALYZER_NONNULL = YES; 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 379 | CLANG_CXX_LIBRARY = "libc++"; 380 | CLANG_ENABLE_MODULES = YES; 381 | CLANG_ENABLE_OBJC_ARC = YES; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_CONSTANT_CONVERSION = YES; 384 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 385 | CLANG_WARN_EMPTY_BODY = YES; 386 | CLANG_WARN_ENUM_CONVERSION = YES; 387 | CLANG_WARN_INFINITE_RECURSION = YES; 388 | CLANG_WARN_INT_CONVERSION = YES; 389 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | TARGETED_DEVICE_FAMILY = "1,2"; 410 | VALIDATE_PRODUCT = YES; 411 | }; 412 | name = Release; 413 | }; 414 | 97C147061CF9000F007C117D /* Debug */ = { 415 | isa = XCBuildConfiguration; 416 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 417 | buildSettings = { 418 | ARCHS = "$(ARCHS_STANDARD)"; 419 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 420 | DEVELOPMENT_TEAM = TRVBMB3KPB; 421 | ENABLE_BITCODE = NO; 422 | FRAMEWORK_SEARCH_PATHS = ( 423 | "$(inherited)", 424 | "$(PROJECT_DIR)/Flutter", 425 | ); 426 | INFOPLIST_FILE = Runner/Info.plist; 427 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 428 | LIBRARY_SEARCH_PATHS = ( 429 | "$(inherited)", 430 | "$(PROJECT_DIR)/Flutter", 431 | ); 432 | PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.qrcodereaderExample; 433 | PRODUCT_NAME = "$(TARGET_NAME)"; 434 | }; 435 | name = Debug; 436 | }; 437 | 97C147071CF9000F007C117D /* Release */ = { 438 | isa = XCBuildConfiguration; 439 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 440 | buildSettings = { 441 | ARCHS = "$(ARCHS_STANDARD)"; 442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 443 | DEVELOPMENT_TEAM = TRVBMB3KPB; 444 | ENABLE_BITCODE = NO; 445 | FRAMEWORK_SEARCH_PATHS = ( 446 | "$(inherited)", 447 | "$(PROJECT_DIR)/Flutter", 448 | ); 449 | INFOPLIST_FILE = Runner/Info.plist; 450 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 451 | LIBRARY_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.qrcodereaderExample; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | }; 458 | name = Release; 459 | }; 460 | /* End XCBuildConfiguration section */ 461 | 462 | /* Begin XCConfigurationList section */ 463 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 464 | isa = XCConfigurationList; 465 | buildConfigurations = ( 466 | 97C147031CF9000F007C117D /* Debug */, 467 | 97C147041CF9000F007C117D /* Release */, 468 | ); 469 | defaultConfigurationIsVisible = 0; 470 | defaultConfigurationName = Release; 471 | }; 472 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147061CF9000F007C117D /* Debug */, 476 | 97C147071CF9000F007C117D /* Release */, 477 | ); 478 | defaultConfigurationIsVisible = 0; 479 | defaultConfigurationName = Release; 480 | }; 481 | /* End XCConfigurationList section */ 482 | }; 483 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 484 | } 485 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 7 | [GeneratedPluginRegistrant registerWithRegistry:self]; 8 | // Override point for customization after application launch. 9 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /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 | "idiom" : "ios-marketing", 113 | "size" : "1024x1024", 114 | "scale" : "1x" 115 | } 116 | ], 117 | "info" : { 118 | "version" : 1, 119 | "author" : "xcode" 120 | } 121 | } -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/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/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/GeneratedPluginRegistrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GeneratedPluginRegistrant_h 6 | #define GeneratedPluginRegistrant_h 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface GeneratedPluginRegistrant : NSObject 13 | + (void)registerWithRegistry:(NSObject*)registry; 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | #endif /* GeneratedPluginRegistrant_h */ 18 | -------------------------------------------------------------------------------- /example/ios/Runner/GeneratedPluginRegistrant.m: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #import "GeneratedPluginRegistrant.h" 6 | 7 | #if __has_include() 8 | #import 9 | #else 10 | @import qrcode_reader; 11 | #endif 12 | 13 | @implementation GeneratedPluginRegistrant 14 | 15 | + (void)registerWithRegistry:(NSObject*)registry { 16 | [QRCodeReaderPlugin registerWithRegistrar:[registry registrarForPlugin:@"QRCodeReaderPlugin"]]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIBackgroundModes 6 | 7 | remote-notification 8 | 9 | NSCameraUsageDescription 10 | You have to use the camera to scan a barcode, so we need permission 11 | CFBundleDevelopmentRegion 12 | en 13 | CFBundleExecutable 14 | $(EXECUTABLE_NAME) 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | qrcodereader_example 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 1 29 | LSRequiresIPhoneOS 30 | 31 | UILaunchStoryboardName 32 | LaunchScreen 33 | UIMainStoryboardFile 34 | Main 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) <2017> 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in all 11 | // copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | // SOFTWARE. 20 | 21 | import 'dart:async'; 22 | 23 | import 'package:flutter/material.dart'; 24 | import 'package:qrcode_reader/qrcode_reader.dart'; 25 | 26 | void main() { 27 | runApp(new MyApp()); 28 | } 29 | 30 | class MyApp extends StatelessWidget { 31 | @override 32 | Widget build(BuildContext context) { 33 | return new MaterialApp( 34 | title: 'QRCode Reader Demo', 35 | home: new MyHomePage(), 36 | ); 37 | } 38 | } 39 | 40 | class MyHomePage extends StatefulWidget { 41 | MyHomePage({Key key, this.title}) : super(key: key); 42 | 43 | final String title; 44 | 45 | final Map pluginParameters = { 46 | }; 47 | 48 | @override 49 | _MyHomePageState createState() => new _MyHomePageState(); 50 | } 51 | 52 | class _MyHomePageState extends State { 53 | Future _barcodeString; 54 | 55 | @override 56 | Widget build(BuildContext context) { 57 | return new Scaffold( 58 | appBar: new AppBar( 59 | title: const Text('QRCode Reader Example'), 60 | ), 61 | body: new Center( 62 | child: new FutureBuilder( 63 | future: _barcodeString, 64 | builder: (BuildContext context, AsyncSnapshot snapshot) { 65 | return new Text(snapshot.data != null ? snapshot.data : ''); 66 | })), 67 | floatingActionButton: new FloatingActionButton( 68 | onPressed: () { 69 | setState(() { 70 | _barcodeString = new QRCodeReader() 71 | .setAutoFocusIntervalInMs(200) 72 | .setForceAutoFocus(true) 73 | .setTorchEnabled(true) 74 | .setHandlePermissions(true) 75 | .setExecuteAfterPermissionGranted(true) 76 | .setFrontCamera(false) 77 | .scan(); 78 | }); 79 | }, 80 | tooltip: 'Reader the QRCode', 81 | child: new Icon(Icons.add_a_photo), 82 | ), 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: qrcode_reader_example 2 | description: Demonstrates how to use the qrcode_reader plugin. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | qrcode_reader: 8 | path: ../ 9 | 10 | # For information on the generic Dart part of this file, see the 11 | # following page: https://www.dartlang.org/tools/pub/pubspec 12 | 13 | # The following section is specific to Flutter. 14 | flutter: 15 | 16 | # The following line ensures that the Material Icons font is 17 | # included with your application, so that you can use the icons in 18 | # the Icons class. 19 | uses-material-design: true 20 | 21 | # To add assets to your application, add an assets section here, in 22 | # this "flutter" section, as in: 23 | # assets: 24 | # - images/a_dot_burr.jpeg 25 | # - images/a_dot_ham.jpeg 26 | 27 | # To add custom fonts to your application, add a fonts section here, 28 | # in this "flutter" section. Each entry in this list should have a 29 | # "family" key with the font family name, and a "fonts" key with a 30 | # list giving the asset and other descriptors for the font. For 31 | # example: 32 | # fonts: 33 | # - family: Schyler 34 | # fonts: 35 | # - asset: fonts/Schyler-Regular.ttf 36 | # - asset: fonts/Schyler-Italic.ttf 37 | # style: italic 38 | # - family: Trajan Pro 39 | # fonts: 40 | # - asset: fonts/TrajanPro.ttf 41 | # - asset: fonts/TrajanPro_Bold.ttf 42 | # weight: 700 43 | 44 | environment: 45 | sdk: '>=2.10.0 <3.0.0' -------------------------------------------------------------------------------- /example/qrcode_reader_example.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcko/flutter_qrcode_reader/2cc736a5fbc24ba06a1b048473f456c3742da1f9/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/QRCodeReaderPlugin.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Johan Henselmans. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | #import 5 | #import 6 | #import 7 | 8 | @interface QRCodeReaderPlugin : NSObject 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /ios/Classes/QRCodeReaderPlugin.m: -------------------------------------------------------------------------------- 1 | #import "QRCodeReaderPlugin.h" 2 | 3 | static NSString *const CHANNEL_NAME = @"qrcode_reader"; 4 | static FlutterMethodChannel *channel; 5 | 6 | @interface QRCodeReaderPlugin() 7 | @property (nonatomic, strong) UIView *viewPreview; 8 | @property (nonatomic, strong) UIView *qrcodeview; 9 | @property (nonatomic, strong) UIButton *buttonCancel; 10 | @property (nonatomic) BOOL isReading; 11 | @property (nonatomic, strong) AVCaptureSession *captureSession; 12 | @property (nonatomic, strong) AVCaptureVideoPreviewLayer *videoPreviewLayer; 13 | -(BOOL)startReading; 14 | -(void)stopReading; 15 | @property (nonatomic, retain) UIViewController *viewController; 16 | @property (nonatomic, retain) UIViewController *qrcodeViewController; 17 | @property (nonatomic) BOOL isFrontCamera; 18 | @end 19 | 20 | @implementation QRCodeReaderPlugin { 21 | FlutterResult _result; 22 | UIViewController *_viewController; 23 | } 24 | 25 | float height; 26 | float width; 27 | float landscapeheight; 28 | float portraitheight; 29 | 30 | 31 | + (void)registerWithRegistrar:(NSObject*)registrar { 32 | FlutterMethodChannel* channel = [FlutterMethodChannel 33 | methodChannelWithName:CHANNEL_NAME 34 | binaryMessenger:[registrar messenger]]; 35 | UIViewController *viewController = 36 | [UIApplication sharedApplication].delegate.window.rootViewController; 37 | QRCodeReaderPlugin* instance = [[QRCodeReaderPlugin alloc] initWithViewController:viewController]; 38 | [registrar addMethodCallDelegate:instance channel:channel]; 39 | } 40 | 41 | 42 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 43 | NSDictionary *args = (NSDictionary *)call.arguments; 44 | self.isFrontCamera = [[args objectForKey: @"frontCamera"] boolValue]; 45 | 46 | if ([@"getPlatformVersion" isEqualToString:call.method]) { 47 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]); 48 | } else if ([@"readQRCode" isEqualToString:call.method]) { 49 | [self showQRCodeView:call]; 50 | _result = result; 51 | } else if ([@"stopReading" isEqualToString:call.method]) { 52 | [self stopReading]; 53 | result(@"stopped"); 54 | }else { 55 | result(FlutterMethodNotImplemented); 56 | } 57 | } 58 | 59 | 60 | - (instancetype)initWithViewController:(UIViewController *)viewController { 61 | self = [super init]; 62 | if (self) { 63 | _viewController = viewController; 64 | _viewController.view.backgroundColor = [UIColor clearColor]; 65 | _viewController.view.opaque = NO; 66 | [[ NSNotificationCenter defaultCenter]addObserver: self selector:@selector(rotate:) 67 | name:UIDeviceOrientationDidChangeNotification object:nil]; 68 | } 69 | return self; 70 | } 71 | 72 | 73 | - (void)showQRCodeView:(FlutterMethodCall*)call { 74 | _qrcodeViewController = [[UIViewController alloc] init]; 75 | [_viewController presentViewController:_qrcodeViewController animated:NO completion:nil]; 76 | 77 | if (@available(iOS 13.0, *)) { 78 | [_qrcodeViewController setModalInPresentation:(true) ]; 79 | // [_qrcodeViewController setModalPresentationStyle:(UIModalPresentationFullScreen) ]; 80 | } else { 81 | // Fallback on earlier versions 82 | } 83 | 84 | [self loadViewQRCode]; 85 | [self viewQRCodeDidLoad]; 86 | [self startReading]; 87 | } 88 | 89 | 90 | - (void)closeQRCodeView { 91 | [_qrcodeViewController dismissViewControllerAnimated:YES completion:^{ 92 | [channel invokeMethod:@"onDestroy" arguments:nil]; 93 | }]; 94 | } 95 | 96 | 97 | -(void)loadViewQRCode { 98 | portraitheight = height = [UIScreen mainScreen].applicationFrame.size.height; 99 | landscapeheight = width = [UIScreen mainScreen].applicationFrame.size.width; 100 | if(UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])){ 101 | landscapeheight = height; 102 | portraitheight = width; 103 | } 104 | _qrcodeview= [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, height) ]; 105 | _qrcodeview.opaque = NO; 106 | _qrcodeview.backgroundColor = [UIColor whiteColor]; 107 | _qrcodeViewController.view = _qrcodeview; 108 | } 109 | 110 | 111 | - (void)viewQRCodeDidLoad { 112 | _viewPreview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, height+height/10) ]; 113 | _viewPreview.backgroundColor = [UIColor whiteColor]; 114 | [_qrcodeViewController.view addSubview:_viewPreview]; 115 | _buttonCancel = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 116 | 117 | if (@available(iOS 13.0, *)) { 118 | _buttonCancel.frame = CGRectMake(width/2-width/8, (height-height/20)-30, width/4, height/20); 119 | } else { 120 | // Fallback on earlier versions 121 | _buttonCancel.frame = CGRectMake(width/2-width/8, height-height/20, width/4, height/20); 122 | } 123 | 124 | [_buttonCancel setTitle:@"CANCEL"forState:UIControlStateNormal]; 125 | [_buttonCancel addTarget:self action:@selector(stopReading) forControlEvents:UIControlEventTouchUpInside]; 126 | [_qrcodeViewController.view addSubview:_buttonCancel]; 127 | _captureSession = nil; 128 | _isReading = NO; 129 | 130 | } 131 | 132 | - (BOOL)startReading { 133 | if (_isReading) return NO; 134 | _isReading = YES; 135 | NSError *error; 136 | AVCaptureDevice *captureDevice; 137 | if ([self isFrontCamera]) { 138 | captureDevice = [AVCaptureDevice defaultDeviceWithDeviceType: AVCaptureDeviceTypeBuiltInWideAngleCamera 139 | mediaType: AVMediaTypeVideo 140 | position: AVCaptureDevicePositionFront]; 141 | } else { 142 | captureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; 143 | } 144 | 145 | AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:captureDevice error:&error]; 146 | if (!input) { 147 | NSLog(@"%@", [error localizedDescription]); 148 | return NO; 149 | } 150 | _captureSession = [[AVCaptureSession alloc] init]; 151 | [_captureSession addInput:input]; 152 | AVCaptureMetadataOutput *captureMetadataOutput = [[AVCaptureMetadataOutput alloc] init]; 153 | [_captureSession addOutput:captureMetadataOutput]; 154 | dispatch_queue_t dispatchQueue; 155 | dispatchQueue = dispatch_queue_create("myQueue", NULL); 156 | [captureMetadataOutput setMetadataObjectsDelegate:self queue:dispatchQueue]; 157 | [captureMetadataOutput setMetadataObjectTypes:[NSArray arrayWithObject:AVMetadataObjectTypeQRCode]]; 158 | _videoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:_captureSession]; 159 | [_videoPreviewLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill]; 160 | [_videoPreviewLayer setFrame:_viewPreview.layer.bounds]; 161 | [_viewPreview.layer addSublayer:_videoPreviewLayer]; 162 | [_captureSession startRunning]; 163 | return YES; 164 | } 165 | 166 | 167 | -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection{ 168 | if (metadataObjects != nil && [metadataObjects count] > 0) { 169 | AVMetadataMachineReadableCodeObject *metadataObj = [metadataObjects objectAtIndex:0]; 170 | if ([[metadataObj type] isEqualToString:AVMetadataObjectTypeQRCode]) { 171 | _result([metadataObj stringValue]); 172 | [self performSelectorOnMainThread:@selector(stopReading) withObject:nil waitUntilDone:NO]; 173 | _isReading = NO; 174 | } 175 | } 176 | } 177 | 178 | 179 | - (void) rotate:(NSNotification *) notification{ 180 | UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; 181 | if (orientation == 1) { 182 | height = portraitheight; 183 | width = landscapeheight; 184 | 185 | if (@available(iOS 13.0, *)) { 186 | _buttonCancel.frame = CGRectMake(width/2-width/8, (height-height/20)-30, width/4, height/20); 187 | } else { 188 | // Fallback on earlier versions 189 | _buttonCancel.frame = CGRectMake(width/2-width/8, height-height/20, width/4, height/20); 190 | } 191 | } else { 192 | height = landscapeheight; 193 | width = portraitheight; 194 | _buttonCancel.frame = CGRectMake(width/2-width/8, height-height/10, width/4, height/20); 195 | } 196 | _qrcodeview.frame = CGRectMake(0, 0, width, height) ; 197 | _viewPreview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, height+height/10) ]; 198 | [_videoPreviewLayer setFrame:_viewPreview.layer.bounds]; 199 | [_qrcodeViewController viewWillLayoutSubviews]; 200 | } 201 | 202 | 203 | -(void)stopReading{ 204 | [_captureSession stopRunning]; 205 | _captureSession = nil; 206 | [_videoPreviewLayer removeFromSuperlayer]; 207 | _isReading = NO; 208 | [self closeQRCodeView]; 209 | _result(nil); 210 | } 211 | 212 | 213 | @end 214 | -------------------------------------------------------------------------------- /ios/qrcode_reader.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 = 'qrcode_reader' 6 | s.version = '0.0.1' 7 | s.summary = 'A flutter plugin for reader qrcodes.' 8 | s.description = <<-DESC 9 | A new flutter plugin project. 10 | DESC 11 | s.homepage = 'https://github.com/johanhenselmans/flutter_qrcode_reader' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Netsense' => 'johan@netsense.nl' } 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 | -------------------------------------------------------------------------------- /lib/qrcode_reader.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) <2017> 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in all 11 | // copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | // SOFTWARE. 20 | 21 | import 'dart:async'; 22 | 23 | import 'package:flutter/services.dart'; 24 | 25 | class QRCodeReader { 26 | static const MethodChannel _channel = const MethodChannel('qrcode_reader'); 27 | 28 | int _autoFocusIntervalInMs = 5000; 29 | bool _forceAutoFocus = false; 30 | bool _torchEnabled = false; 31 | bool _handlePermissions = true; 32 | bool _executeAfterPermissionGranted = true; 33 | bool _frontCamera = false; 34 | 35 | QRCodeReader setAutoFocusIntervalInMs(int autoFocusIntervalInMs) { 36 | _autoFocusIntervalInMs = autoFocusIntervalInMs; 37 | return this; 38 | } 39 | 40 | QRCodeReader setForceAutoFocus(bool forceAutoFocus) { 41 | _forceAutoFocus = forceAutoFocus; 42 | return this; 43 | } 44 | 45 | QRCodeReader setTorchEnabled(bool torchEnabled) { 46 | _torchEnabled = torchEnabled; 47 | return this; 48 | } 49 | 50 | QRCodeReader setHandlePermissions(bool handlePermissions) { 51 | _handlePermissions = handlePermissions; 52 | return this; 53 | } 54 | 55 | QRCodeReader setExecuteAfterPermissionGranted(bool executeAfterPermissionGranted) { 56 | _executeAfterPermissionGranted = executeAfterPermissionGranted; 57 | return this; 58 | } 59 | 60 | QRCodeReader setFrontCamera(bool setFrontCamera) { 61 | _frontCamera = setFrontCamera; 62 | return this; 63 | } 64 | 65 | Future scan() async { 66 | Map params = { 67 | "autoFocusIntervalInMs": _autoFocusIntervalInMs, 68 | "forceAutoFocus": _forceAutoFocus, 69 | "torchEnabled": _torchEnabled, 70 | "handlePermissions": _handlePermissions, 71 | "executeAfterPermissionGranted": _executeAfterPermissionGranted, 72 | "frontCamera": _frontCamera, 73 | }; 74 | return await _channel.invokeMethod('readQRCode', params); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: qrcode_reader 2 | 3 | description: Flutter plugin that lets you read a QR Code. 4 | author: Matheus Villela 5 | homepage: https://github.com/villela/flutter_qrcode_reader 6 | version: 0.5.0 7 | 8 | flutter: 9 | plugin: 10 | androidPackage: com.matheusvillela.flutter.plugins.qrcodereader 11 | pluginClass: QRCodeReaderPlugin 12 | 13 | dependencies: 14 | flutter: 15 | sdk: flutter 16 | 17 | environment: 18 | sdk: '>=2.12.0 <3.0.0' 19 | --------------------------------------------------------------------------------