Skip to content

Commit

Permalink
Merge pull request #1059 from navaronbracke/fix_samples
Browse files Browse the repository at this point in the history
fix: Adjust autoStart values for samples
  • Loading branch information
navaronbracke authored May 15, 2024
2 parents a2a4dd8 + b0d6f98 commit c2c9848
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 58 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
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
2 changes: 1 addition & 1 deletion ios/mobile_scanner.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion macos/mobile_scanner.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit c2c9848

Please sign in to comment.