@@ -26,6 +24,7 @@ See the example app for detailed implementation information.
| ✔ | ✔ | ✔ | ✔ | :x: | :x: |
## Platform specific setup
### Android
This package uses by default the **bundled version** of MLKit Barcode-scanning for Android. This version is immediately available to the device. But it will increase the size of the app by approximately 3 to 10 MB.
...
...
@@ -61,194 +60,101 @@ Ensure that you granted camera permission in XCode -> Signing & Capabilities:
<imgwidth="696"alt="Screenshot of XCode where Camera is checked"src="https://user-images.githubusercontent.com/24459435/193464115-d76f81d0-6355-4cb2-8bee-538e413a3ad0.png">
## Web
This package uses ZXing on web to read barcodes so it needs to be included in `index.html` as script.
Include the `ZXing` library in the `<head>` of your `index.html` as a script.
Import `package:mobile_scanner/mobile_scanner.dart`, and use the widget with or without the controller.
Import the package with `package:mobile_scanner/mobile_scanner.dart`.
If you don't provide a controller, you can't control functions like the torch(flash) or switching camera.
If you don't set `detectionSpeed` to `DetectionSpeed.noDuplicates`, you can get multiple scans in a very short time, causing things like pop() to fire lots of times.
Example without controller:
Create a new `MobileScannerController` controller, using the required options.
Provide a `StreamSubscription` for the barcode events.