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(