Julian Steenbakker

release of v1.0.0

  1 +## 1.0.0
  2 +BREAKING CHANGES:
  3 +This version adds a new allowDuplicates option which now defaults to FALSE. this means that it will only call onDetect once after a scan.
  4 +If you still want duplicates, you can set allowDuplicates to true.
  5 +This also means that you don't have to check for duplicates yourself anymore.
  6 +
  7 +New features:
  8 +* We now have web support! Keep in mind that only QR codes are supported right now.
  9 +
  10 +Bugfixes:
  11 +* Fixed hot reload not working.
  12 +* Fixed Navigator.of(context).pop() not working in the example app due to duplicate MaterialApp declaration.
  13 +* Fixed iOS MLKit version not resolving the latest version.
  14 +* Updated all dependencies
  15 +
1 ## 0.2.0 16 ## 0.2.0
2 You can provide a path to controller.analyzeImage(path) in order to scan a local photo from the gallery! 17 You can provide a path to controller.analyzeImage(path) in order to scan a local photo from the gallery!
3 Check out the example app to see how you can use the image_picker plugin to retrieve a photo from 18 Check out the example app to see how you can use the image_picker plugin to retrieve a photo from
@@ -10,7 +10,7 @@ A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX @@ -10,7 +10,7 @@ A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX
10 10
11 | Android | iOS | MacOS | Web | Linux | Windows | 11 | Android | iOS | MacOS | Web | Linux | Windows |
12 | :-----: | :-: | :---: | :-: | :---: | :-----: | 12 | :-----: | :-: | :---: | :-: | :---: | :-----: |
13 -| ✔️ | ✔️ | ✔️ | | | | 13 +| ✔️ | ✔️ | ✔️ | ✔️ | | |
14 14
15 ### Android 15 ### Android
16 SDK 21 and newer. Reason: CameraX requires at least SDK 21. 16 SDK 21 and newer. Reason: CameraX requires at least SDK 21.
@@ -29,6 +29,10 @@ NSPhotoLibraryUsageDescription - describe why your app needs permission for the @@ -29,6 +29,10 @@ NSPhotoLibraryUsageDescription - describe why your app needs permission for the
29 ### macOS 29 ### macOS
30 macOS 10.13 or newer. Reason: Apple Vision library. 30 macOS 10.13 or newer. Reason: Apple Vision library.
31 31
  32 +### Web
  33 +Web only supports QR codes for now.
  34 +Do you have experience with Flutter Web development? [Help me with migrating from jsQR to qr-scanner for full barcode support!](https://github.com/juliansteenbakker/mobile_scanner/issues/54)
  35 +
32 ## Features Supported 36 ## Features Supported
33 37
34 | Features | Android | iOS | macOS | Web | 38 | Features | Android | iOS | macOS | Web |
@@ -41,6 +45,8 @@ Import `package:mobile_scanner/mobile_scanner.dart`, and use the widget with or @@ -41,6 +45,8 @@ Import `package:mobile_scanner/mobile_scanner.dart`, and use the widget with or
41 45
42 If you don't provide a controller, you can't control functions like the torch(flash) or switching camera. 46 If you don't provide a controller, you can't control functions like the torch(flash) or switching camera.
43 47
  48 +If you don't set allowDuplicates to false, you can get multiple scans in a very short time, causing things like pop() to fire lots of times.
  49 +
44 Example without controller: 50 Example without controller:
45 51
46 ```dart 52 ```dart
@@ -51,6 +57,7 @@ import 'package:mobile_scanner/mobile_scanner.dart'; @@ -51,6 +57,7 @@ import 'package:mobile_scanner/mobile_scanner.dart';
51 return Scaffold( 57 return Scaffold(
52 appBar: AppBar(title: const Text('Mobile Scanner')), 58 appBar: AppBar(title: const Text('Mobile Scanner')),
53 body: MobileScanner( 59 body: MobileScanner(
  60 + allowDuplicates: false,
54 onDetect: (barcode, args) { 61 onDetect: (barcode, args) {
55 final String code = barcode.rawValue; 62 final String code = barcode.rawValue;
56 debugPrint('Barcode found! $code'); 63 debugPrint('Barcode found! $code');
@@ -69,6 +76,7 @@ import 'package:mobile_scanner/mobile_scanner.dart'; @@ -69,6 +76,7 @@ import 'package:mobile_scanner/mobile_scanner.dart';
69 return Scaffold( 76 return Scaffold(
70 appBar: AppBar(title: const Text('Mobile Scanner')), 77 appBar: AppBar(title: const Text('Mobile Scanner')),
71 body: MobileScanner( 78 body: MobileScanner(
  79 + allowDuplicates: false,
72 controller: MobileScannerController( 80 controller: MobileScannerController(
73 facing: CameraFacing.front, torchEnabled: true), 81 facing: CameraFacing.front, torchEnabled: true),
74 onDetect: (barcode, args) { 82 onDetect: (barcode, args) {
@@ -127,6 +135,7 @@ import 'package:mobile_scanner/mobile_scanner.dart'; @@ -127,6 +135,7 @@ import 'package:mobile_scanner/mobile_scanner.dart';
127 ], 135 ],
128 ), 136 ),
129 body: MobileScanner( 137 body: MobileScanner(
  138 + allowDuplicates: false,
130 controller: cameraController, 139 controller: cameraController,
131 onDetect: (barcode, args) { 140 onDetect: (barcode, args) {
132 final String code = barcode.rawValue; 141 final String code = barcode.rawValue;
1 name: mobile_scanner 1 name: mobile_scanner
2 description: A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS. 2 description: A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS.
3 -version: 0.2.0 3 +version: 1.0.0
4 repository: https://github.com/juliansteenbakker/mobile_scanner 4 repository: https://github.com/juliansteenbakker/mobile_scanner
5 5
6 environment: 6 environment: