Skip to content

Commit

Permalink
fix autoStart values for samples
Browse files Browse the repository at this point in the history
  • Loading branch information
navaronbracke committed May 6, 2024
1 parent e4036c7 commit f5caa9f
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 55 deletions.
9 changes: 3 additions & 6 deletions example/lib/barcode_scanner_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ class BarcodeScannerWithController extends StatefulWidget {
class _BarcodeScannerWithControllerState
extends State<BarcodeScannerWithController> 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;
Expand Down
12 changes: 0 additions & 12 deletions example/lib/barcode_scanner_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,8 @@ class BarcodeScannerListView extends StatefulWidget {
class _BarcodeScannerListViewState extends State<BarcodeScannerListView> {
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<BarcodeCapture>(
stream: controller.barcodes,
Expand Down
9 changes: 1 addition & 8 deletions example/lib/barcode_scanner_pageview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@ class BarcodeScannerPageView extends StatefulWidget {
}

class _BarcodeScannerPageViewState extends State<BarcodeScannerPageView> {
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(
Expand Down
10 changes: 0 additions & 10 deletions example/lib/barcode_scanner_returning_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,9 @@ class _BarcodeScannerReturningImageState
extends State<BarcodeScannerReturningImage> {
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(
Expand Down
7 changes: 0 additions & 7 deletions example/lib/barcode_scanner_window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ class _BarcodeScannerWithScanWindowState
extends State<BarcodeScannerWithScanWindow> {
final MobileScannerController controller = MobileScannerController();

@override
void initState() {
super.initState();

controller.start();
}

Widget _buildBarcodeOverlay() {
return ValueListenableBuilder(
valueListenable: controller,
Expand Down
6 changes: 0 additions & 6 deletions example/lib/barcode_scanner_zoom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ class _BarcodeScannerWithZoomState extends State<BarcodeScannerWithZoom> {

double _zoomFactor = 0.0;

@override
void initState() {
super.initState();
controller.start();
}

Widget _buildZoomScaleSlider() {
return ValueListenableBuilder(
valueListenable: controller,
Expand Down
6 changes: 0 additions & 6 deletions example/lib/mobile_scanner_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ class _BarcodeScannerWithOverlayState extends State<BarcodeScannerWithOverlay> {
formats: const [BarcodeFormat.qrCode],
);

@override
void initState() {
super.initState();
controller.start();
}

@override
Widget build(BuildContext context) {
final scanWindow = Rect.fromCenter(
Expand Down

0 comments on commit f5caa9f

Please sign in to comment.