From f5caa9f60424609dba514fbd793ff66c894a87c1 Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Mon, 6 May 2024 16:56:08 +0200 Subject: [PATCH 1/2] fix autoStart values for samples --- example/lib/barcode_scanner_controller.dart | 9 +++------ example/lib/barcode_scanner_listview.dart | 12 ------------ example/lib/barcode_scanner_pageview.dart | 9 +-------- example/lib/barcode_scanner_returning_image.dart | 10 ---------- example/lib/barcode_scanner_window.dart | 7 ------- example/lib/barcode_scanner_zoom.dart | 6 ------ example/lib/mobile_scanner_overlay.dart | 6 ------ 7 files changed, 4 insertions(+), 55 deletions(-) diff --git a/example/lib/barcode_scanner_controller.dart b/example/lib/barcode_scanner_controller.dart index 84df27200..bcfb55616 100644 --- a/example/lib/barcode_scanner_controller.dart +++ b/example/lib/barcode_scanner_controller.dart @@ -16,12 +16,9 @@ class BarcodeScannerWithController extends StatefulWidget { class _BarcodeScannerWithControllerState extends State with WidgetsBindingObserver { final MobileScannerController controller = MobileScannerController( - torchEnabled: true, useNewCameraSelector: true, - // formats: [BarcodeFormat.qrCode] - // facing: CameraFacing.front, - // detectionSpeed: DetectionSpeed.normal - // detectionTimeoutMs: 1000, - // returnImage: false, + autoStart: false, + torchEnabled: true, + useNewCameraSelector: true, ); Barcode? _barcode; diff --git a/example/lib/barcode_scanner_listview.dart b/example/lib/barcode_scanner_listview.dart index ca0de42ba..20181e578 100644 --- a/example/lib/barcode_scanner_listview.dart +++ b/example/lib/barcode_scanner_listview.dart @@ -15,20 +15,8 @@ class BarcodeScannerListView extends StatefulWidget { class _BarcodeScannerListViewState extends State { final MobileScannerController controller = MobileScannerController( torchEnabled: true, - // formats: [BarcodeFormat.qrCode] - // facing: CameraFacing.front, - // detectionSpeed: DetectionSpeed.normal - // detectionTimeoutMs: 1000, - // returnImage: false, ); - @override - void initState() { - super.initState(); - - controller.start(); - } - Widget _buildBarcodesListView() { return StreamBuilder( stream: controller.barcodes, diff --git a/example/lib/barcode_scanner_pageview.dart b/example/lib/barcode_scanner_pageview.dart index c60212fdc..83f5fc66a 100644 --- a/example/lib/barcode_scanner_pageview.dart +++ b/example/lib/barcode_scanner_pageview.dart @@ -13,17 +13,10 @@ class BarcodeScannerPageView extends StatefulWidget { } class _BarcodeScannerPageViewState extends State { - final MobileScannerController controller = - MobileScannerController(autoStart: false); + final MobileScannerController controller = MobileScannerController(); final PageController pageController = PageController(); - @override - void initState() { - super.initState(); - unawaited(controller.start()); - } - @override Widget build(BuildContext context) { return Scaffold( diff --git a/example/lib/barcode_scanner_returning_image.dart b/example/lib/barcode_scanner_returning_image.dart index 5f2943c0e..f8b007546 100644 --- a/example/lib/barcode_scanner_returning_image.dart +++ b/example/lib/barcode_scanner_returning_image.dart @@ -18,19 +18,9 @@ class _BarcodeScannerReturningImageState extends State { final MobileScannerController controller = MobileScannerController( torchEnabled: true, - // formats: [BarcodeFormat.qrCode] - // facing: CameraFacing.front, - // detectionSpeed: DetectionSpeed.normal - // detectionTimeoutMs: 1000, returnImage: true, ); - @override - void initState() { - super.initState(); - controller.start(); - } - @override Widget build(BuildContext context) { return Scaffold( diff --git a/example/lib/barcode_scanner_window.dart b/example/lib/barcode_scanner_window.dart index e85433201..0a13f15ce 100644 --- a/example/lib/barcode_scanner_window.dart +++ b/example/lib/barcode_scanner_window.dart @@ -17,13 +17,6 @@ class _BarcodeScannerWithScanWindowState extends State { final MobileScannerController controller = MobileScannerController(); - @override - void initState() { - super.initState(); - - controller.start(); - } - Widget _buildBarcodeOverlay() { return ValueListenableBuilder( valueListenable: controller, diff --git a/example/lib/barcode_scanner_zoom.dart b/example/lib/barcode_scanner_zoom.dart index 4cd36ecb6..09b11d690 100644 --- a/example/lib/barcode_scanner_zoom.dart +++ b/example/lib/barcode_scanner_zoom.dart @@ -22,12 +22,6 @@ class _BarcodeScannerWithZoomState extends State { double _zoomFactor = 0.0; - @override - void initState() { - super.initState(); - controller.start(); - } - Widget _buildZoomScaleSlider() { return ValueListenableBuilder( valueListenable: controller, diff --git a/example/lib/mobile_scanner_overlay.dart b/example/lib/mobile_scanner_overlay.dart index 922a63409..85cd8dec6 100644 --- a/example/lib/mobile_scanner_overlay.dart +++ b/example/lib/mobile_scanner_overlay.dart @@ -15,12 +15,6 @@ class _BarcodeScannerWithOverlayState extends State { formats: const [BarcodeFormat.qrCode], ); - @override - void initState() { - super.initState(); - controller.start(); - } - @override Widget build(BuildContext context) { final scanWindow = Rect.fromCenter( From b0d6f98568add79a808a238bc2fa97bea693a64a Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Mon, 6 May 2024 17:03:14 +0200 Subject: [PATCH 2/2] bump version --- CHANGELOG.md | 3 +++ ios/mobile_scanner.podspec | 2 +- macos/mobile_scanner.podspec | 2 +- pubspec.yaml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0f75983..ac8dc4024 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 5.1.1 +* This release fixes an issue with automatic starts in the examples. + ## 5.1.0 This updates reverts a few breaking changes made in v5.0.0 in order to keep things simple. diff --git a/ios/mobile_scanner.podspec b/ios/mobile_scanner.podspec index 027cd235d..eb5dce984 100644 --- a/ios/mobile_scanner.podspec +++ b/ios/mobile_scanner.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'mobile_scanner' - s.version = '5.0.2' + s.version = '5.1.1' s.summary = 'An universal scanner for Flutter based on MLKit.' s.description = <<-DESC An universal scanner for Flutter based on MLKit. diff --git a/macos/mobile_scanner.podspec b/macos/mobile_scanner.podspec index f9d01e8df..8d640999b 100644 --- a/macos/mobile_scanner.podspec +++ b/macos/mobile_scanner.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'mobile_scanner' - s.version = '5.0.2' + s.version = '5.1.1' s.summary = 'An universal scanner for Flutter based on MLKit.' s.description = <<-DESC An universal scanner for Flutter based on MLKit. diff --git a/pubspec.yaml b/pubspec.yaml index cd5b949e7..f283ccd01 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mobile_scanner 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. -version: 5.1.0 +version: 5.1.1 repository: https://github.com/juliansteenbakker/mobile_scanner screenshots: