From e7d634679774504dcac00528c3196872096aee24 Mon Sep 17 00:00:00 2001 From: devodevM Date: Sat, 14 Dec 2024 16:04:14 +0100 Subject: [PATCH 1/3] Update gradle and pubspec versions --- .idea/aws.xml | 17 + .idea/caches/deviceStreaming.xml | 365 ++++++++++++++++++ .idea/libraries/Dart_SDK.xml | 33 +- .idea/libraries/Flutter_Plugins.xml | 1 - .idea/misc.xml | 1 - .idea/vcs.xml | 1 - .idea/workspace.xml | 111 +++--- android/build.gradle | 8 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/app/build.gradle | 13 +- .../android/app/src/main/AndroidManifest.xml | 1 + example/android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../ios/Flutter/flutter_export_environment.sh | 10 +- example/pubspec.yaml | 6 +- pubspec.yaml | 6 +- 16 files changed, 479 insertions(+), 102 deletions(-) create mode 100644 .idea/aws.xml create mode 100644 .idea/caches/deviceStreaming.xml diff --git a/.idea/aws.xml b/.idea/aws.xml new file mode 100644 index 00000000..75433f33 --- /dev/null +++ b/.idea/aws.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml new file mode 100644 index 00000000..70b67b4e --- /dev/null +++ b/.idea/caches/deviceStreaming.xml @@ -0,0 +1,365 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml index 8213d129..fe1aff27 100644 --- a/.idea/libraries/Dart_SDK.xml +++ b/.idea/libraries/Dart_SDK.xml @@ -1,17 +1,28 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml index 42254fd5..53449dae 100644 --- a/.idea/libraries/Flutter_Plugins.xml +++ b/.idea/libraries/Flutter_Plugins.xml @@ -2,7 +2,6 @@ - diff --git a/.idea/misc.xml b/.idea/misc.xml index d9e98bd3..65a02b8c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 1f805b67..94a25f7f 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,5 @@ - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7b627c6b..13480287 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -8,43 +8,26 @@ + + + + + + + - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - + + + @@ -59,26 +45,43 @@ + + + - - - - - - - - - - - - - - + @@ -89,6 +92,7 @@ + @@ -112,29 +116,6 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/build.gradle b/android/build.gradle index f0f02e7a..31df726a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' + classpath 'com.android.tools.build:gradle:8.3.2' } } @@ -22,11 +22,11 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - compileSdkVersion 30 - + compileSdkVersion 34 + namespace "com.amolg.flutterbarcodescanner" defaultConfig { minSdkVersion 16 - targetSdkVersion 30 + targetSdkVersion 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 9474641a..dfb673e1 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 94edfe8d..090d62c2 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -25,17 +25,22 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 29 - + compileSdkVersion 34 + namespace "com.amolg.flutterbarcodescannerexample" lintOptions { disable 'InvalidPackage' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.amolg.flutterbarcodescannerexample" - minSdkVersion 16 - targetSdkVersion 29 + minSdkVersion flutter.minSdkVersion + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index d7d397c3..329aa79a 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -16,6 +16,7 @@ android:icon="@mipmap/ic_launcher" android:label="flutter_barcode_scanner_example"> Date: Thu, 13 Feb 2025 10:59:47 +0100 Subject: [PATCH 2/3] Refactor: Update gradle and dependencies, add migration file, and update EmbeddingV1Activity - Updated Gradle wrapper to version 8.10.2. - Modified settings.gradle to manage Flutter SDK paths and plugin dependencies. - Updated EmbeddingV1Activity to use FlutterEngine. - Updated `flutter_plugin_android_lifecycle` to `2.0.24`. - Updated test to `1.25.15`. - Refactored FlutterBarcodeScannerPlugin for improved v2 embedding. - Removed unnecessary Flutter activity. - Corrected the Activity Lifecycle observer to properly unregister. - Updated continuous scan mode to return proper results. --- android/.idea/migrations.xml | 10 + android/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.properties | 0 android/settings.gradle | 0 .../FlutterBarcodeScannerPlugin.java | 555 ++++++++---------- .../EmbeddingV1Activity.java | 10 +- .../MainActivity.java | 0 example/android/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 47 +- example/lib/main.dart | 0 example/pubspec.yaml | 2 +- flutter_barcode_scanner.iml | 0 ios/Classes/FlutterBarcodeScannerPlugin.h | 0 .../SwiftFlutterBarcodeScannerPlugin.swift | 0 lib/flutter_barcode_scanner.dart | 0 pubspec.yaml | 4 +- 17 files changed, 298 insertions(+), 332 deletions(-) create mode 100644 android/.idea/migrations.xml mode change 100644 => 100755 android/gradle.properties mode change 100644 => 100755 android/gradle/wrapper/gradle-wrapper.properties mode change 100644 => 100755 android/settings.gradle mode change 100644 => 100755 android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java mode change 100644 => 100755 example/android/app/src/main/java/com/amolg/flutterbarcodescannerexample/EmbeddingV1Activity.java mode change 100644 => 100755 example/android/app/src/main/java/com/amolg/flutterbarcodescannerexample/MainActivity.java mode change 100644 => 100755 example/android/gradle.properties mode change 100644 => 100755 example/android/gradle/wrapper/gradle-wrapper.properties mode change 100644 => 100755 example/android/settings.gradle mode change 100644 => 100755 example/lib/main.dart mode change 100644 => 100755 example/pubspec.yaml mode change 100644 => 100755 flutter_barcode_scanner.iml mode change 100644 => 100755 ios/Classes/FlutterBarcodeScannerPlugin.h mode change 100644 => 100755 ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift mode change 100644 => 100755 lib/flutter_barcode_scanner.dart mode change 100644 => 100755 pubspec.yaml diff --git a/android/.idea/migrations.xml b/android/.idea/migrations.xml new file mode 100644 index 00000000..f8051a6f --- /dev/null +++ b/android/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties old mode 100644 new mode 100755 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties old mode 100644 new mode 100755 diff --git a/android/settings.gradle b/android/settings.gradle old mode 100644 new mode 100755 diff --git a/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java b/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java old mode 100644 new mode 100755 index 91480647..93580b61 --- a/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java +++ b/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java @@ -1,375 +1,302 @@ package com.amolg.flutterbarcodescanner; -import android.app.Activity; -import android.app.Application; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; - -import androidx.annotation.NonNull; -import androidx.lifecycle.DefaultLifecycleObserver; -import androidx.lifecycle.Lifecycle; -import androidx.lifecycle.LifecycleOwner; - -import com.google.android.gms.common.api.CommonStatusCodes; -import com.google.android.gms.vision.barcode.Barcode; - -import java.util.Map; - -import io.flutter.embedding.android.FlutterActivity; - -import io.flutter.embedding.engine.plugins.FlutterPlugin; -import io.flutter.embedding.engine.plugins.activity.ActivityAware; -import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; -import io.flutter.plugin.common.BinaryMessenger; -import io.flutter.plugin.common.EventChannel; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry; -import io.flutter.plugin.common.PluginRegistry.ActivityResultListener; -import io.flutter.plugin.common.EventChannel.StreamHandler; -import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter; - - -/** - * FlutterBarcodeScannerPlugin - */ -public class FlutterBarcodeScannerPlugin implements MethodCallHandler, ActivityResultListener, StreamHandler, FlutterPlugin, ActivityAware { - private static final String CHANNEL = "flutter_barcode_scanner"; - - private static FlutterActivity activity; - private static Result pendingResult; - private Map arguments; - - private static final String TAG = FlutterBarcodeScannerPlugin.class.getSimpleName(); - private static final int RC_BARCODE_CAPTURE = 9001; - public static String lineColor = ""; - public static boolean isShowFlashIcon = false; - public static boolean isContinuousScan = false; - static EventChannel.EventSink barcodeStream; - private EventChannel eventChannel; + import android.app.Activity; + import android.app.Application; + import android.content.Intent; + import android.os.Bundle; + import android.util.Log; + + import androidx.annotation.NonNull; + import androidx.lifecycle.DefaultLifecycleObserver; + import androidx.lifecycle.Lifecycle; + import androidx.lifecycle.LifecycleOwner; + + import com.google.android.gms.common.api.CommonStatusCodes; + import com.google.android.gms.vision.barcode.Barcode; + + import java.util.Map; + + import io.flutter.embedding.android.FlutterActivity; + import io.flutter.embedding.engine.plugins.FlutterPlugin; + import io.flutter.embedding.engine.plugins.activity.ActivityAware; + import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; + import io.flutter.plugin.common.BinaryMessenger; + import io.flutter.plugin.common.EventChannel; + import io.flutter.plugin.common.MethodCall; + import io.flutter.plugin.common.MethodChannel; + import io.flutter.plugin.common.MethodChannel.MethodCallHandler; + import io.flutter.plugin.common.MethodChannel.Result; + import io.flutter.plugin.common.PluginRegistry.ActivityResultListener; + import io.flutter.plugin.common.EventChannel.StreamHandler; + import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter; /** - * V2 embedding - * - * @param activity - * @param registrar + * FlutterBarcodeScannerPlugin */ - private MethodChannel channel; - private FlutterPluginBinding pluginBinding; - private ActivityPluginBinding activityBinding; - private Application applicationContext; - // This is null when not using v2 embedding; - private Lifecycle lifecycle; - private LifeCycleObserver observer; + public class FlutterBarcodeScannerPlugin implements MethodCallHandler, ActivityResultListener, StreamHandler, FlutterPlugin, ActivityAware { + private static final String CHANNEL = "flutter_barcode_scanner"; + + private static FlutterActivity activity; + private static Result pendingResult; + private Map arguments; + + private static final String TAG = FlutterBarcodeScannerPlugin.class.getSimpleName(); + private static final int RC_BARCODE_CAPTURE = 9001; + public static String lineColor = ""; + public static boolean isShowFlashIcon = false; + public static boolean isContinuousScan = false; + static EventChannel.EventSink barcodeStream; + private EventChannel eventChannel; + + private MethodChannel channel; + private FlutterPluginBinding pluginBinding; + private ActivityPluginBinding activityBinding; + private Application applicationContext; + private Lifecycle lifecycle; + private LifeCycleObserver observer; + + public FlutterBarcodeScannerPlugin() { + } - public FlutterBarcodeScannerPlugin() { - } + private FlutterBarcodeScannerPlugin(Activity activity) { + FlutterBarcodeScannerPlugin.activity = (FlutterActivity) activity; + } - private FlutterBarcodeScannerPlugin(FlutterActivity activity, final PluginRegistry.Registrar registrar) { - FlutterBarcodeScannerPlugin.activity = activity; - } + @Override + public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { + try { + pendingResult = result; - /** - * Plugin registration. - */ - public static void registerWith(final PluginRegistry.Registrar registrar) { - if (registrar.activity() == null) { - return; - } - Activity activity = registrar.activity(); - Application applicationContext = null; - if (registrar.context() != null) { - applicationContext = (Application) (registrar.context().getApplicationContext()); - } - FlutterBarcodeScannerPlugin instance = new FlutterBarcodeScannerPlugin((FlutterActivity) registrar.activity(), registrar); - instance.createPluginSetup(registrar.messenger(), applicationContext, activity, registrar, null); - } - - @Override - public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { - try { - pendingResult = result; - - if (call.method.equals("scanBarcode")) { - if (!(call.arguments instanceof Map)) { - throw new IllegalArgumentException("Plugin not passing a map as parameter: " + call.arguments); - } - arguments = (Map) call.arguments; - lineColor = (String) arguments.get("lineColor"); - isShowFlashIcon = (boolean) arguments.get("isShowFlashIcon"); - if (null == lineColor || lineColor.equalsIgnoreCase("")) { - lineColor = "#DC143C"; - } - if (null != arguments.get("scanMode")) { - if ((int) arguments.get("scanMode") == BarcodeCaptureActivity.SCAN_MODE_ENUM.DEFAULT.ordinal()) { - BarcodeCaptureActivity.SCAN_MODE = BarcodeCaptureActivity.SCAN_MODE_ENUM.QR.ordinal(); + if (call.method.equals("scanBarcode")) { + if (!(call.arguments instanceof Map)) { + throw new IllegalArgumentException("Plugin not passing a map as parameter: " + call.arguments); + } + arguments = (Map) call.arguments; + lineColor = (String) arguments.get("lineColor"); + isShowFlashIcon = (boolean) arguments.get("isShowFlashIcon"); + if (null == lineColor || lineColor.equalsIgnoreCase("")) { + lineColor = "#DC143C"; + } + if (null != arguments.get("scanMode")) { + if ((int) arguments.get("scanMode") == BarcodeCaptureActivity.SCAN_MODE_ENUM.DEFAULT.ordinal()) { + BarcodeCaptureActivity.SCAN_MODE = BarcodeCaptureActivity.SCAN_MODE_ENUM.QR.ordinal(); + } else { + BarcodeCaptureActivity.SCAN_MODE = (int) arguments.get("scanMode"); + } } else { - BarcodeCaptureActivity.SCAN_MODE = (int) arguments.get("scanMode"); + BarcodeCaptureActivity.SCAN_MODE = BarcodeCaptureActivity.SCAN_MODE_ENUM.QR.ordinal(); } - } else { - BarcodeCaptureActivity.SCAN_MODE = BarcodeCaptureActivity.SCAN_MODE_ENUM.QR.ordinal(); - } - isContinuousScan = (boolean) arguments.get("isContinuousScan"); + isContinuousScan = (boolean) arguments.get("isContinuousScan"); - startBarcodeScannerActivityView((String) arguments.get("cancelButtonText"), isContinuousScan); + startBarcodeScannerActivityView((String) arguments.get("cancelButtonText"), isContinuousScan); + } + } catch (Exception e) { + Log.e(TAG, "onMethodCall: " + e.getLocalizedMessage()); } - } catch (Exception e) { - Log.e(TAG, "onMethodCall: " + e.getLocalizedMessage()); } - } - - private void startBarcodeScannerActivityView(String buttonText, boolean isContinuousScan) { - try { - Intent intent = new Intent(activity, BarcodeCaptureActivity.class).putExtra("cancelButtonText", buttonText); - if (isContinuousScan) { - activity.startActivity(intent); - } else { - activity.startActivityForResult(intent, RC_BARCODE_CAPTURE); + + private void startBarcodeScannerActivityView(String buttonText, boolean isContinuousScan) { + try { + Intent intent = new Intent(activity, BarcodeCaptureActivity.class).putExtra("cancelButtonText", buttonText); + if (isContinuousScan) { + activity.startActivity(intent); + } else { + activity.startActivityForResult(intent, RC_BARCODE_CAPTURE); + } + } catch (Exception e) { + Log.e(TAG, "startView: " + e.getLocalizedMessage()); } - } catch (Exception e) { - Log.e(TAG, "startView: " + e.getLocalizedMessage()); } - } - - /** - * Get the barcode scanning results in onActivityResult - * - * @param requestCode - * @param resultCode - * @param data - * @return - */ - @Override - public boolean onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == RC_BARCODE_CAPTURE) { - if (resultCode == CommonStatusCodes.SUCCESS) { - if (data != null) { - try { - Barcode barcode = data.getParcelableExtra(BarcodeCaptureActivity.BarcodeObject); - String barcodeResult = barcode.rawValue; - pendingResult.success(barcodeResult); - } catch (Exception e) { + @Override + public boolean onActivityResult(int requestCode, int resultCode, Intent data) { + if (requestCode == RC_BARCODE_CAPTURE) { + if (resultCode == CommonStatusCodes.SUCCESS) { + if (data != null) { + try { + Barcode barcode = data.getParcelableExtra(BarcodeCaptureActivity.BarcodeObject); + String barcodeResult = barcode.rawValue; + pendingResult.success(barcodeResult); + } catch (Exception e) { + pendingResult.success("-1"); + } + } else { pendingResult.success("-1"); } + pendingResult = null; + arguments = null; + return true; } else { pendingResult.success("-1"); } - pendingResult = null; - arguments = null; - return true; - } else { - pendingResult.success("-1"); } + return false; } - return false; - } - - - @Override - public void onListen(Object o, EventChannel.EventSink eventSink) { - try { - barcodeStream = eventSink; - } catch (Exception e) { - } - } - - @Override - public void onCancel(Object o) { - try { - barcodeStream = null; - } catch (Exception e) { - } - } - - /** - * Continuous receive barcode - * - * @param barcode - */ - public static void onBarcodeScanReceiver(final Barcode barcode) { - try { - if (barcode != null && !barcode.displayValue.isEmpty()) { - activity.runOnUiThread(new Runnable() { - @Override - public void run() { - barcodeStream.success(barcode.rawValue); - } - }); + @Override + public void onListen(Object o, EventChannel.EventSink eventSink) { + try { + barcodeStream = eventSink; + } catch (Exception e) { } - } catch (Exception e) { - Log.e(TAG, "onBarcodeScanReceiver: " + e.getLocalizedMessage()); } - } - - @Override - public void onAttachedToEngine(FlutterPluginBinding binding) { - pluginBinding = binding; - } - - @Override - public void onDetachedFromEngine(FlutterPluginBinding binding) { - pluginBinding = null; - } - - @Override - public void onDetachedFromActivityForConfigChanges() { - onDetachedFromActivity(); - } - - @Override - public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) { - onAttachedToActivity(binding); - } - /** - * Setup method - * Created after Embedding V2 API release - * - * @param messenger - * @param applicationContext - * @param activity - * @param registrar - * @param activityBinding - */ - private void createPluginSetup( - final BinaryMessenger messenger, - final Application applicationContext, - final Activity activity, - final PluginRegistry.Registrar registrar, - final ActivityPluginBinding activityBinding) { - - - this.activity = (FlutterActivity) activity; - eventChannel = - new EventChannel(messenger, "flutter_barcode_scanner_receiver"); - eventChannel.setStreamHandler(this); - - - this.applicationContext = applicationContext; - channel = new MethodChannel(messenger, CHANNEL); - channel.setMethodCallHandler(this); - if (registrar != null) { - // V1 embedding setup for activity listeners. - observer = new LifeCycleObserver(activity); - applicationContext.registerActivityLifecycleCallbacks( - observer); // Use getApplicationContext() to avoid casting failures. - registrar.addActivityResultListener(this); - } else { - // V2 embedding setup for activity listeners. - activityBinding.addActivityResultListener(this); - lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); - observer = new LifeCycleObserver(activity); - lifecycle.addObserver(observer); + @Override + public void onCancel(Object o) { + try { + barcodeStream = null; + } catch (Exception e) { + } } - } - - @Override - public void onAttachedToActivity(ActivityPluginBinding binding) { - activityBinding = binding; - createPluginSetup( - pluginBinding.getBinaryMessenger(), - (Application) pluginBinding.getApplicationContext(), - activityBinding.getActivity(), - null, - activityBinding); - } - - @Override - public void onDetachedFromActivity() { - clearPluginSetup(); - } - /** - * Clear plugin setup - */ - private void clearPluginSetup() { - activity = null; - activityBinding.removeActivityResultListener(this); - activityBinding = null; - lifecycle.removeObserver(observer); - lifecycle = null; - channel.setMethodCallHandler(null); - eventChannel.setStreamHandler(null); - channel = null; - applicationContext.unregisterActivityLifecycleCallbacks(observer); - applicationContext = null; - } - - /** - * Activity lifecycle observer - */ - private class LifeCycleObserver - implements Application.ActivityLifecycleCallbacks, DefaultLifecycleObserver { - private final Activity thisActivity; - - LifeCycleObserver(Activity activity) { - this.thisActivity = activity; + public static void onBarcodeScanReceiver(final Barcode barcode) { + try { + if (barcode != null && !barcode.displayValue.isEmpty()) { + activity.runOnUiThread(new Runnable() { + @Override + public void run() { + barcodeStream.success(barcode.rawValue); + } + }); + } + } catch (Exception e) { + Log.e(TAG, "onBarcodeScanReceiver: " + e.getLocalizedMessage()); + } } @Override - public void onCreate(@NonNull LifecycleOwner owner) { + public void onAttachedToEngine(FlutterPluginBinding binding) { + pluginBinding = binding; } @Override - public void onStart(@NonNull LifecycleOwner owner) { + public void onDetachedFromEngine(FlutterPluginBinding binding) { + pluginBinding = null; } @Override - public void onResume(@NonNull LifecycleOwner owner) { + public void onDetachedFromActivityForConfigChanges() { + onDetachedFromActivity(); } @Override - public void onPause(@NonNull LifecycleOwner owner) { + public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) { + onAttachedToActivity(binding); } - @Override - public void onStop(@NonNull LifecycleOwner owner) { - onActivityStopped(thisActivity); + private void createPluginSetup( + final BinaryMessenger messenger, + final Application applicationContext, + final Activity activity, + final ActivityPluginBinding activityBinding) { + + this.activity = (FlutterActivity) activity; + eventChannel = new EventChannel(messenger, "flutter_barcode_scanner_receiver"); + eventChannel.setStreamHandler(this); + + this.applicationContext = applicationContext; + channel = new MethodChannel(messenger, CHANNEL); + channel.setMethodCallHandler(this); + + if (activityBinding != null) { + activityBinding.addActivityResultListener(this); + lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); + observer = new LifeCycleObserver(activity); + lifecycle.addObserver(observer); + } } @Override - public void onDestroy(@NonNull LifecycleOwner owner) { - onActivityDestroyed(thisActivity); + public void onAttachedToActivity(ActivityPluginBinding binding) { + activityBinding = binding; + createPluginSetup( + pluginBinding.getBinaryMessenger(), + (Application) pluginBinding.getApplicationContext(), + activityBinding.getActivity(), + activityBinding); } @Override - public void onActivityCreated(Activity activity, Bundle savedInstanceState) { + public void onDetachedFromActivity() { + clearPluginSetup(); } - @Override - public void onActivityStarted(Activity activity) { + private void clearPluginSetup() { + activity = null; + activityBinding.removeActivityResultListener(this); + activityBinding = null; + lifecycle.removeObserver(observer); + lifecycle = null; + channel.setMethodCallHandler(null); + eventChannel.setStreamHandler(null); + channel = null; + applicationContext.unregisterActivityLifecycleCallbacks(observer); + applicationContext = null; } - @Override - public void onActivityResumed(Activity activity) { - } + private class LifeCycleObserver implements Application.ActivityLifecycleCallbacks, DefaultLifecycleObserver { + private final Activity thisActivity; - @Override - public void onActivityPaused(Activity activity) { - } + LifeCycleObserver(Activity activity) { + this.thisActivity = activity; + } - @Override - public void onActivitySaveInstanceState(Activity activity, Bundle outState) { - } + @Override + public void onCreate(@NonNull LifecycleOwner owner) { + } - @Override - public void onActivityDestroyed(Activity activity) { - if (thisActivity == activity && activity.getApplicationContext() != null) { - ((Application) activity.getApplicationContext()) - .unregisterActivityLifecycleCallbacks( - this); + @Override + public void onStart(@NonNull LifecycleOwner owner) { } - } - @Override - public void onActivityStopped(Activity activity) { + @Override + public void onResume(@NonNull LifecycleOwner owner) { + } + + @Override + public void onPause(@NonNull LifecycleOwner owner) { + } + + @Override + public void onStop(@NonNull LifecycleOwner owner) { + onActivityStopped(thisActivity); + } + + @Override + public void onDestroy(@NonNull LifecycleOwner owner) { + onActivityDestroyed(thisActivity); + } + + @Override + public void onActivityCreated(Activity activity, Bundle savedInstanceState) { + } + + @Override + public void onActivityStarted(Activity activity) { + } + @Override + public void onActivityResumed(Activity activity) { + } + + @Override + public void onActivityPaused(Activity activity) { + } + + @Override + public void onActivitySaveInstanceState(Activity activity, Bundle outState) { + } + + @Override + public void onActivityDestroyed(Activity activity) { + if (thisActivity == activity && activity.getApplicationContext() != null) { + ((Application) activity.getApplicationContext()).unregisterActivityLifecycleCallbacks(this); + } + } + + @Override + public void onActivityStopped(Activity activity) { + } } - } -} \ No newline at end of file + } \ No newline at end of file diff --git a/example/android/app/src/main/java/com/amolg/flutterbarcodescannerexample/EmbeddingV1Activity.java b/example/android/app/src/main/java/com/amolg/flutterbarcodescannerexample/EmbeddingV1Activity.java old mode 100644 new mode 100755 index 6c1f9f33..73a13fd1 --- a/example/android/app/src/main/java/com/amolg/flutterbarcodescannerexample/EmbeddingV1Activity.java +++ b/example/android/app/src/main/java/com/amolg/flutterbarcodescannerexample/EmbeddingV1Activity.java @@ -1,14 +1,16 @@ package com.amolg.flutterbarcodescannerexample; import android.os.Bundle; -import io.flutter.app.FlutterActivity; + +import androidx.annotation.NonNull; + +import io.flutter.embedding.android.FlutterActivity; import io.flutter.embedding.engine.FlutterEngine; import io.flutter.plugins.GeneratedPluginRegistrant; public class EmbeddingV1Activity extends FlutterActivity { @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(new FlutterEngine(this)); + public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); } } \ No newline at end of file diff --git a/example/android/app/src/main/java/com/amolg/flutterbarcodescannerexample/MainActivity.java b/example/android/app/src/main/java/com/amolg/flutterbarcodescannerexample/MainActivity.java old mode 100644 new mode 100755 diff --git a/example/android/gradle.properties b/example/android/gradle.properties old mode 100644 new mode 100755 diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties old mode 100644 new mode 100755 index 1b82740b..38325b36 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle old mode 100644 new mode 100755 index 5a2f14fb..b31a2d20 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,15 +1,42 @@ -include ':app' +//include ':app' +// +//def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() +// +//def plugins = new Properties() +//def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +//if (pluginsFile.exists()) { +// pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +//} +// +//plugins.each { name, path -> +// def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() +// include ":$name" +// project(":$name").projectDir = pluginDirectory +//} -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.8.0" apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false } + +include ":app" \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart old mode 100644 new mode 100755 diff --git a/example/pubspec.yaml b/example/pubspec.yaml old mode 100644 new mode 100755 index 8433b573..d85f5c02 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.8 - flutter_plugin_android_lifecycle: ^2.0.23 + flutter_plugin_android_lifecycle: ^2.0.24 dev_dependencies: flutter_test: diff --git a/flutter_barcode_scanner.iml b/flutter_barcode_scanner.iml old mode 100644 new mode 100755 diff --git a/ios/Classes/FlutterBarcodeScannerPlugin.h b/ios/Classes/FlutterBarcodeScannerPlugin.h old mode 100644 new mode 100755 diff --git a/ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift b/ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift old mode 100644 new mode 100755 diff --git a/lib/flutter_barcode_scanner.dart b/lib/flutter_barcode_scanner.dart old mode 100644 new mode 100755 diff --git a/pubspec.yaml b/pubspec.yaml old mode 100644 new mode 100755 index b9566d40..8bf40764 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,10 +11,10 @@ environment: dependencies: flutter: sdk: flutter - flutter_plugin_android_lifecycle: ^2.0.23 + flutter_plugin_android_lifecycle: ^2.0.24 dev_dependencies: pedantic: ^1.11.1 - test: ^1.25.12 + test: ^1.25.15 flutter: # This section identifies this Flutter project as a plugin project. From 15378e9904d8880318727bdfba756c3cb08455fe Mon Sep 17 00:00:00 2001 From: Deco Dev Date: Thu, 13 Feb 2025 11:00:28 +0100 Subject: [PATCH 3/3] Refactor: Update gradle and dependencies, add migration file, and update EmbeddingV1Activity - Updated Gradle wrapper to version 8.10.2. - Modified settings.gradle to manage Flutter SDK paths and plugin dependencies. - Updated EmbeddingV1Activity to use FlutterEngine. - Updated `flutter_plugin_android_lifecycle` to `2.0.24`. - Updated test to `1.25.15`. - Refactored FlutterBarcodeScannerPlugin for improved v2 embedding. - Removed unnecessary Flutter activity. - Corrected the Activity Lifecycle observer to properly unregister. - Updated continuous scan mode to return proper results. --- .github/FUNDING.yml | 0 .github/ISSUE_TEMPLATE/bug_report.md | 0 .github/ISSUE_TEMPLATE/feature_request.md | 0 .gitignore | 0 .idea/aws.xml | 0 .idea/caches/deviceStreaming.xml | 108 ++ .idea/codeStyles/Project.xml | 0 .idea/encodings.xml | 0 .idea/libraries/Dart_SDK.xml | 0 .idea/libraries/Flutter_Plugins.xml | 0 .idea/misc.xml | 0 .idea/modules.xml | 0 .../example_lib_main_dart.xml | 0 .idea/vcs.xml | 0 .idea/workspace.xml | 142 +- .metadata | 0 CHANGELOG.md | 0 LICENSE | 0 README.md | 0 analysis_options.yaml | 0 android/.gitignore | 0 android/.idea/.name | 0 android/.idea/appInsightsSettings.xml | 23 + android/.idea/caches/build_file_checksums.ser | Bin android/.idea/caches/gradle_models.ser | Bin android/.idea/codeStyles/Project.xml | 0 android/.idea/compiler.xml | 2 +- android/.idea/encodings.xml | 0 android/.idea/gradle.xml | 7 +- android/.idea/jarRepositories.xml | 0 android/.idea/misc.xml | 2 +- android/.idea/modules.xml | 3 + android/.idea/runConfigurations.xml | 8 + android/.idea/vcs.xml | 0 android/build.gradle | 6 +- android/gradle/wrapper/gradle-wrapper.jar | Bin android/gradlew | 0 android/gradlew.bat | 0 android/src/main/AndroidManifest.xml | 0 .../constants/AppConstants.java | 0 .../flutterbarcodescanner/utils/AppUtil.java | 0 .../res/drawable/ic_barcode_flash_off.xml | 0 .../main/res/drawable/ic_barcode_flash_on.xml | 0 .../main/res/drawable/ic_switch_camera.xml | 0 example/.gitignore | 0 example/.metadata | 0 example/README.md | 0 example/android/.gitignore | 0 .../.cmake/api/v1/query/client-agp/cache-v2 | 0 .../api/v1/query/client-agp/cmakeFiles-v1 | 0 .../api/v1/query/client-agp/codemodel-v2 | 0 .../reply/cache-v2-12881d5b566f7d477251.json | 1391 +++++++++++++++++ .../cmakeFiles-v1-8a8b41fee7e97cf77114.json | 803 ++++++++++ .../codemodel-v2-865a85a1f1da6bb5a4eb.json | 43 + ...irectory-.-Debug-f5ebdc15457944623624.json | 14 + .../reply/index-2025-02-13T09-41-42-0050.json | 92 ++ .../Debug/5t1c4e1v/arm64-v8a/CMakeCache.txt | 405 +++++ .../3.22.1-g37088a8/CMakeCCompiler.cmake | 72 + .../3.22.1-g37088a8/CMakeCXXCompiler.cmake | 83 + .../CMakeDetermineCompilerABI_C.bin | Bin 0 -> 7832 bytes .../CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 7968 bytes .../3.22.1-g37088a8/CMakeSystem.cmake | 15 + .../CompilerIdC/CMakeCCompilerId.c | 803 ++++++++++ .../CompilerIdC/CMakeCCompilerId.o | Bin 0 -> 6080 bytes .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 791 ++++++++++ .../CompilerIdCXX/CMakeCXXCompilerId.o | Bin 0 -> 6096 bytes .../CMakeFiles/TargetDirectories.txt | 2 + .../arm64-v8a/CMakeFiles/cmake.check_cache | 1 + .../5t1c4e1v/arm64-v8a/CMakeFiles/rules.ninja | 45 + .../arm64-v8a/additional_project_files.txt | 0 .../arm64-v8a/android_gradle_build.json | 28 + .../arm64-v8a/android_gradle_build_mini.json | 20 + .../.cxx/Debug/5t1c4e1v/arm64-v8a/build.ninja | 112 ++ .../5t1c4e1v/arm64-v8a/build_file_index.txt | 1 + .../5t1c4e1v/arm64-v8a/cmake_install.cmake | 54 + .../arm64-v8a/configure_fingerprint.bin | 28 + .../arm64-v8a/metadata_generation_command.txt | 20 + .../5t1c4e1v/arm64-v8a/prefab_config.json | 4 + .../arm64-v8a/symbol_folder_index.txt | 1 + .../app/.cxx/Debug/5t1c4e1v/hash_key.txt | 27 + .../.cmake/api/v1/query/client-agp/cache-v2 | 0 .../api/v1/query/client-agp/cmakeFiles-v1 | 0 .../api/v1/query/client-agp/codemodel-v2 | 0 .../reply/cache-v2-3218d3d2463b434e2a01.json | 1391 +++++++++++++++++ .../cmakeFiles-v1-40ea7f5d887b305a6180.json | 803 ++++++++++ .../codemodel-v2-8e686bb29d68d9d46a08.json | 43 + ...irectory-.-Debug-f5ebdc15457944623624.json | 14 + .../reply/index-2025-02-13T09-36-06-0447.json | 92 ++ .../.cxx/Debug/5t1c4e1v/x86/CMakeCache.txt | 405 +++++ .../3.22.1-g37088a8/CMakeCCompiler.cmake | 72 + .../3.22.1-g37088a8/CMakeCXXCompiler.cmake | 83 + .../CMakeDetermineCompilerABI_C.bin | Bin 0 -> 5824 bytes .../CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 5964 bytes .../3.22.1-g37088a8/CMakeSystem.cmake | 15 + .../CompilerIdC/CMakeCCompilerId.c | 803 ++++++++++ .../CompilerIdC/CMakeCCompilerId.o | Bin 0 -> 3952 bytes .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 791 ++++++++++ .../CompilerIdCXX/CMakeCXXCompilerId.o | Bin 0 -> 3992 bytes .../x86/CMakeFiles/TargetDirectories.txt | 2 + .../5t1c4e1v/x86/CMakeFiles/cmake.check_cache | 1 + .../Debug/5t1c4e1v/x86/CMakeFiles/rules.ninja | 45 + .../5t1c4e1v/x86/additional_project_files.txt | 0 .../5t1c4e1v/x86/android_gradle_build.json | 28 + .../x86/android_gradle_build_mini.json | 20 + .../app/.cxx/Debug/5t1c4e1v/x86/build.ninja | 112 ++ .../Debug/5t1c4e1v/x86/build_file_index.txt | 1 + .../Debug/5t1c4e1v/x86/cmake_install.cmake | 54 + .../5t1c4e1v/x86/configure_fingerprint.bin | 28 + .../x86/metadata_generation_command.txt | 20 + .../Debug/5t1c4e1v/x86/prefab_config.json | 4 + .../5t1c4e1v/x86/symbol_folder_index.txt | 1 + example/android/app/build.gradle | 29 +- .../android/app/src/main/AndroidManifest.xml | 0 .../main/res/drawable/launch_background.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../app/src/main/res/values/styles.xml | 0 example/android/build.gradle | 42 +- example/ios/.gitignore | 0 example/ios/Flutter/AppFrameworkInfo.plist | 0 example/ios/Flutter/Debug.xcconfig | 0 example/ios/Flutter/Release.xcconfig | 0 .../ios/Flutter/flutter_export_environment.sh | 2 +- example/ios/Podfile | 0 example/ios/Podfile.lock | 22 - example/ios/Runner.xcodeproj/project.pbxproj | 0 .../contents.xcworkspacedata | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 example/ios/Runner/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../Icon-App-1024x1024@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin .../Icon-App-83.5x83.5@2x.png | Bin .../LaunchImage.imageset/Contents.json | 0 .../LaunchImage.imageset/LaunchImage.png | Bin .../LaunchImage.imageset/LaunchImage@2x.png | Bin .../LaunchImage.imageset/LaunchImage@3x.png | Bin .../LaunchImage.imageset/README.md | 0 .../Runner/Base.lproj/LaunchScreen.storyboard | 0 example/ios/Runner/Base.lproj/Main.storyboard | 0 example/ios/Runner/Info.plist | 0 example/ios/Runner/Runner-Bridging-Header.h | 0 ios/.gitignore | 0 ios/Assets/.gitkeep | 0 ios/Assets/ic_flash_off.png | Bin ios/Assets/ic_flash_on.png | Bin ios/Assets/ic_switch_camera.png | Bin ios/Classes/FlutterBarcodeScannerPlugin.m | 0 ios/flutter_barcode_scanner.podspec | 0 165 files changed, 10013 insertions(+), 66 deletions(-) mode change 100644 => 100755 .github/FUNDING.yml mode change 100644 => 100755 .github/ISSUE_TEMPLATE/bug_report.md mode change 100644 => 100755 .github/ISSUE_TEMPLATE/feature_request.md mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .idea/aws.xml mode change 100644 => 100755 .idea/caches/deviceStreaming.xml mode change 100644 => 100755 .idea/codeStyles/Project.xml mode change 100644 => 100755 .idea/encodings.xml mode change 100644 => 100755 .idea/libraries/Dart_SDK.xml mode change 100644 => 100755 .idea/libraries/Flutter_Plugins.xml mode change 100644 => 100755 .idea/misc.xml mode change 100644 => 100755 .idea/modules.xml mode change 100644 => 100755 .idea/runConfigurations/example_lib_main_dart.xml mode change 100644 => 100755 .idea/vcs.xml mode change 100644 => 100755 .idea/workspace.xml mode change 100644 => 100755 .metadata mode change 100644 => 100755 CHANGELOG.md mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 analysis_options.yaml mode change 100644 => 100755 android/.gitignore mode change 100644 => 100755 android/.idea/.name create mode 100644 android/.idea/appInsightsSettings.xml mode change 100644 => 100755 android/.idea/caches/build_file_checksums.ser mode change 100644 => 100755 android/.idea/caches/gradle_models.ser mode change 100644 => 100755 android/.idea/codeStyles/Project.xml mode change 100644 => 100755 android/.idea/compiler.xml mode change 100644 => 100755 android/.idea/encodings.xml mode change 100644 => 100755 android/.idea/gradle.xml mode change 100644 => 100755 android/.idea/jarRepositories.xml mode change 100644 => 100755 android/.idea/misc.xml mode change 100644 => 100755 android/.idea/modules.xml mode change 100644 => 100755 android/.idea/runConfigurations.xml mode change 100644 => 100755 android/.idea/vcs.xml mode change 100644 => 100755 android/build.gradle mode change 100644 => 100755 android/gradle/wrapper/gradle-wrapper.jar mode change 100644 => 100755 android/gradlew mode change 100644 => 100755 android/gradlew.bat mode change 100644 => 100755 android/src/main/AndroidManifest.xml mode change 100644 => 100755 android/src/main/java/com/amolg/flutterbarcodescanner/constants/AppConstants.java mode change 100644 => 100755 android/src/main/java/com/amolg/flutterbarcodescanner/utils/AppUtil.java mode change 100644 => 100755 android/src/main/res/drawable/ic_barcode_flash_off.xml mode change 100644 => 100755 android/src/main/res/drawable/ic_barcode_flash_on.xml mode change 100644 => 100755 android/src/main/res/drawable/ic_switch_camera.xml mode change 100644 => 100755 example/.gitignore mode change 100644 => 100755 example/.metadata mode change 100644 => 100755 example/README.md mode change 100644 => 100755 example/android/.gitignore create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2 create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2 create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/.cmake/api/v1/reply/cache-v2-12881d5b566f7d477251.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-8a8b41fee7e97cf77114.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-865a85a1f1da6bb5a4eb.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/.cmake/api/v1/reply/index-2025-02-13T09-41-42-0050.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeCache.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeCCompiler.cmake create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeCXXCompiler.cmake create mode 100755 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_C.bin create mode 100755 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_CXX.bin create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeSystem.cmake create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.c create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.o create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.o create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/TargetDirectories.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/cmake.check_cache create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/CMakeFiles/rules.ninja create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/additional_project_files.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/android_gradle_build.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/android_gradle_build_mini.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/build.ninja create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/build_file_index.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/cmake_install.cmake create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/configure_fingerprint.bin create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/metadata_generation_command.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/prefab_config.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/arm64-v8a/symbol_folder_index.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/hash_key.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/.cmake/api/v1/query/client-agp/cache-v2 create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/.cmake/api/v1/query/client-agp/cmakeFiles-v1 create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/.cmake/api/v1/query/client-agp/codemodel-v2 create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/.cmake/api/v1/reply/cache-v2-3218d3d2463b434e2a01.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/.cmake/api/v1/reply/cmakeFiles-v1-40ea7f5d887b305a6180.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/.cmake/api/v1/reply/codemodel-v2-8e686bb29d68d9d46a08.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/.cmake/api/v1/reply/index-2025-02-13T09-36-06-0447.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeCache.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CMakeCCompiler.cmake create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CMakeCXXCompiler.cmake create mode 100755 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_C.bin create mode 100755 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_CXX.bin create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CMakeSystem.cmake create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.c create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.o create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.o create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/TargetDirectories.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/cmake.check_cache create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/CMakeFiles/rules.ninja create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/additional_project_files.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/android_gradle_build.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/android_gradle_build_mini.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/build.ninja create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/build_file_index.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/cmake_install.cmake create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/configure_fingerprint.bin create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/metadata_generation_command.txt create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/prefab_config.json create mode 100644 example/android/app/.cxx/Debug/5t1c4e1v/x86/symbol_folder_index.txt mode change 100644 => 100755 example/android/app/build.gradle mode change 100644 => 100755 example/android/app/src/main/AndroidManifest.xml mode change 100644 => 100755 example/android/app/src/main/res/drawable/launch_background.xml mode change 100644 => 100755 example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png mode change 100644 => 100755 example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png mode change 100644 => 100755 example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png mode change 100644 => 100755 example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png mode change 100644 => 100755 example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png mode change 100644 => 100755 example/android/app/src/main/res/values/styles.xml mode change 100644 => 100755 example/android/build.gradle mode change 100644 => 100755 example/ios/.gitignore mode change 100644 => 100755 example/ios/Flutter/AppFrameworkInfo.plist mode change 100644 => 100755 example/ios/Flutter/Debug.xcconfig mode change 100644 => 100755 example/ios/Flutter/Release.xcconfig mode change 100644 => 100755 example/ios/Podfile delete mode 100644 example/ios/Podfile.lock mode change 100644 => 100755 example/ios/Runner.xcodeproj/project.pbxproj mode change 100644 => 100755 example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata mode change 100644 => 100755 example/ios/Runner.xcworkspace/contents.xcworkspacedata mode change 100644 => 100755 example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 example/ios/Runner/AppDelegate.swift mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png mode change 100644 => 100755 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md mode change 100644 => 100755 example/ios/Runner/Base.lproj/LaunchScreen.storyboard mode change 100644 => 100755 example/ios/Runner/Base.lproj/Main.storyboard mode change 100644 => 100755 example/ios/Runner/Info.plist mode change 100644 => 100755 example/ios/Runner/Runner-Bridging-Header.h mode change 100644 => 100755 ios/.gitignore mode change 100644 => 100755 ios/Assets/.gitkeep mode change 100644 => 100755 ios/Assets/ic_flash_off.png mode change 100644 => 100755 ios/Assets/ic_flash_on.png mode change 100644 => 100755 ios/Assets/ic_switch_camera.png mode change 100644 => 100755 ios/Classes/FlutterBarcodeScannerPlugin.m mode change 100644 => 100755 ios/flutter_barcode_scanner.podspec diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.idea/aws.xml b/.idea/aws.xml old mode 100644 new mode 100755 diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml old mode 100644 new mode 100755 index 70b67b4e..5daa96e7 --- a/.idea/caches/deviceStreaming.xml +++ b/.idea/caches/deviceStreaming.xml @@ -15,6 +15,18 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + { + "associatedIndex": 4 +} @@ -78,7 +181,9 @@ "cidr.known.project.marker": "true", "dart.analysis.tool.window.visible": "false", "git-widget-placeholder": "master", + "io.flutter.reload.alreadyRun": "true", "kotlin-language-version-configured": "true", + "last_opened_file_path": "/Volumes/MyDocs/Developer/Projects/Flutter/flutter_barcode_scanner", "show.migrate.to.gradle.popup": "false" } }]]> @@ -104,6 +209,15 @@ @@ -117,6 +231,10 @@ + + + diff --git a/.metadata b/.metadata old mode 100644 new mode 100755 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/analysis_options.yaml b/analysis_options.yaml old mode 100644 new mode 100755 diff --git a/android/.gitignore b/android/.gitignore old mode 100644 new mode 100755 diff --git a/android/.idea/.name b/android/.idea/.name old mode 100644 new mode 100755 diff --git a/android/.idea/appInsightsSettings.xml b/android/.idea/appInsightsSettings.xml new file mode 100644 index 00000000..820d0146 --- /dev/null +++ b/android/.idea/appInsightsSettings.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/caches/build_file_checksums.ser b/android/.idea/caches/build_file_checksums.ser old mode 100644 new mode 100755 diff --git a/android/.idea/caches/gradle_models.ser b/android/.idea/caches/gradle_models.ser old mode 100644 new mode 100755 diff --git a/android/.idea/codeStyles/Project.xml b/android/.idea/codeStyles/Project.xml old mode 100644 new mode 100755 diff --git a/android/.idea/compiler.xml b/android/.idea/compiler.xml old mode 100644 new mode 100755 index 61a9130c..b86273d9 --- a/android/.idea/compiler.xml +++ b/android/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/android/.idea/encodings.xml b/android/.idea/encodings.xml old mode 100644 new mode 100755 diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml old mode 100644 new mode 100755 index e4567842..de6412ba --- a/android/.idea/gradle.xml +++ b/android/.idea/gradle.xml @@ -5,16 +5,15 @@ diff --git a/android/.idea/jarRepositories.xml b/android/.idea/jarRepositories.xml old mode 100644 new mode 100755 diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml old mode 100644 new mode 100755 index 33782299..c855577e --- a/android/.idea/misc.xml +++ b/android/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/android/.idea/modules.xml b/android/.idea/modules.xml old mode 100644 new mode 100755 index 9958d44c..a0b4505e --- a/android/.idea/modules.xml +++ b/android/.idea/modules.xml @@ -3,6 +3,9 @@ + + + \ No newline at end of file diff --git a/android/.idea/runConfigurations.xml b/android/.idea/runConfigurations.xml old mode 100644 new mode 100755 index 7f68460d..72f00edd --- a/android/.idea/runConfigurations.xml +++ b/android/.idea/runConfigurations.xml @@ -3,6 +3,14 @@