Julian Steenbakker

imp: change parameters

@@ -19,6 +19,8 @@ Improvements: @@ -19,6 +19,8 @@ Improvements:
19 * Removed `called stop while already stopped` messages. 19 * Removed `called stop while already stopped` messages.
20 20
21 Features: 21 Features:
  22 +* You can now provide a `scanWindow` to the `MobileScanner()` widget.
  23 +* You can now draw an overlay over the scanned barcode. See the barcode scanner window in the example app for more information.
22 * Added a new `placeholderBuilder` function to the `MobileScanner` widget to customize the preview placeholder. 24 * Added a new `placeholderBuilder` function to the `MobileScanner` widget to customize the preview placeholder.
23 * Added `autoStart` parameter to MobileScannerController(). If set to false, controller won't start automatically. 25 * Added `autoStart` parameter to MobileScannerController(). If set to false, controller won't start automatically.
24 * Added `hasTorch` function on MobileScannerController(). After starting the controller, you can check if the device has a torch. 26 * Added `hasTorch` function on MobileScannerController(). After starting the controller, you can check if the device has a torch.
@@ -54,11 +54,10 @@ class _BarcodeScannerWithScanWindowState @@ -54,11 +54,10 @@ class _BarcodeScannerWithScanWindowState
54 arguments != null) 54 arguments != null)
55 CustomPaint( 55 CustomPaint(
56 painter: BarcodeOverlay( 56 painter: BarcodeOverlay(
57 - barcode!,  
58 - arguments!,  
59 - BoxFit.contain,  
60 - MediaQuery.of(context).devicePixelRatio,  
61 - capture!, 57 + barcode: barcode!,
  58 + arguments: arguments!,
  59 + boxFit: BoxFit.contain,
  60 + capture: capture!,
62 ), 61 ),
63 ), 62 ),
64 CustomPaint( 63 CustomPaint(
@@ -131,19 +130,17 @@ class ScannerOverlay extends CustomPainter { @@ -131,19 +130,17 @@ class ScannerOverlay extends CustomPainter {
131 } 130 }
132 131
133 class BarcodeOverlay extends CustomPainter { 132 class BarcodeOverlay extends CustomPainter {
134 - BarcodeOverlay(  
135 - this.barcode,  
136 - this.arguments,  
137 - this.boxFit,  
138 - this.devicePixelRatio,  
139 - this.capture,  
140 - ); 133 + BarcodeOverlay({
  134 + required this.barcode,
  135 + required this.arguments,
  136 + required this.boxFit,
  137 + required this.capture,
  138 + });
141 139
142 final BarcodeCapture capture; 140 final BarcodeCapture capture;
143 final Barcode barcode; 141 final Barcode barcode;
144 final MobileScannerArguments arguments; 142 final MobileScannerArguments arguments;
145 final BoxFit boxFit; 143 final BoxFit boxFit;
146 - final double devicePixelRatio;  
147 144
148 @override 145 @override
149 void paint(Canvas canvas, Size size) { 146 void paint(Canvas canvas, Size size) {
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 # 4 #
5 Pod::Spec.new do |s| 5 Pod::Spec.new do |s|
6 s.name = 'mobile_scanner' 6 s.name = 'mobile_scanner'
7 - s.version = '0.0.1' 7 + s.version = '3.0.0'
8 s.summary = 'An universal scanner for Flutter based on MLKit.' 8 s.summary = 'An universal scanner for Flutter based on MLKit.'
9 s.description = <<-DESC 9 s.description = <<-DESC
10 An universal scanner for Flutter based on MLKit. 10 An universal scanner for Flutter based on MLKit.