Skip to content

Commit

Permalink
Merge pull request #1 from dwikyhardi/improve
Browse files Browse the repository at this point in the history
add improvement for `analyzeImage` function
  • Loading branch information
dwikyhardi authored Nov 20, 2024
2 parents 8e983f1 + f7ebe34 commit 3f8f878
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
13 changes: 13 additions & 0 deletions lib/src/mobile_scanner_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,17 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {

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);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3f8f878

Please sign in to comment.