diff --git a/android/build.gradle b/android/build.gradle index 6b7c31872..d9332f267 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -70,7 +70,7 @@ dependencies { implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.1' } else { // Bundled model in app - implementation 'com.google.mlkit:barcode-scanning:17.2.0' + implementation 'com.google.mlkit:barcode-scanning:17.3.0' } // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. diff --git a/example/pubspec.yaml b/example/pubspec.yaml index cffa3350c..88affee7e 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,8 +6,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 0.0.1 environment: - sdk: ">=3.3.0 <4.0.0" - flutter: ">=3.19.0" + sdk: ">=3.4.0 <4.0.0" + flutter: ">=3.24.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -19,7 +19,7 @@ dependencies: flutter: sdk: flutter - image_picker: ^1.0.4 + image_picker: ^1.1.2 mobile_scanner: # When depending on this package from a real application you should use: # mobile_scanner: ^x.y.z @@ -33,7 +33,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - lint: ^2.0.20 + lint: ^2.3.0 flutter: uses-material-design: true diff --git a/lib/src/mobile_scanner_controller.dart b/lib/src/mobile_scanner_controller.dart index 6b2d718dc..7a8080490 100644 --- a/lib/src/mobile_scanner_controller.dart +++ b/lib/src/mobile_scanner_controller.dart @@ -439,4 +439,17 @@ class MobileScannerController extends ValueNotifier { await MobileScannerPlatform.instance.dispose(); } + + /// Exposes the [addBarcode] method. + /// + /// This method is used for adding a barcode to the barcode stream. + /// so when using [analyzeImage] the return value + /// can be used in [MobileScanner] using [onDetect] callback. + void addBarcode(BarcodeCapture? barcode) { + if (_barcodesController.isClosed || barcode == null) { + return; + } + + _barcodesController.add(barcode); + } } diff --git a/pubspec.yaml b/pubspec.yaml index 588e6e507..42a229871 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - plugin_platform_interface: ^2.0.2 + plugin_platform_interface: ^2.1.8 web: ">=0.5.1 <2.0.0" dev_dependencies: