Showing
1 changed file
with
4 additions
and
12 deletions
| @@ -14,11 +14,6 @@ class MobileScanner extends StatefulWidget { | @@ -14,11 +14,6 @@ class MobileScanner extends StatefulWidget { | ||
| 14 | /// The controller of the camera. | 14 | /// The controller of the camera. |
| 15 | final MobileScannerController? controller; | 15 | final MobileScannerController? controller; |
| 16 | 16 | ||
| 17 | - /// Calls the provided [onPermissionSet] callback when the permission is set. | ||
| 18 | - // @Deprecated('Use the [onPermissionSet] paremeter in the [MobileScannerController] instead.') | ||
| 19 | - // ignore: deprecated_consistency | ||
| 20 | - final Function(bool permissionGranted)? onPermissionSet; | ||
| 21 | - | ||
| 22 | /// Function that gets called when a Barcode is detected. | 17 | /// Function that gets called when a Barcode is detected. |
| 23 | /// | 18 | /// |
| 24 | /// [barcode] The barcode object with all information about the scanned code. | 19 | /// [barcode] The barcode object with all information about the scanned code. |
| @@ -37,7 +32,8 @@ class MobileScanner extends StatefulWidget { | @@ -37,7 +32,8 @@ class MobileScanner extends StatefulWidget { | ||
| 37 | /// Whether to automatically resume the camera when the application is resumed | 32 | /// Whether to automatically resume the camera when the application is resumed |
| 38 | final bool autoResume; | 33 | final bool autoResume; |
| 39 | 34 | ||
| 40 | - /// Create a [MobileScanner] with a [controller], the [controller] must has been initialized. | 35 | + /// Create a [MobileScanner] with a [controller]. |
| 36 | + /// The [controller] must have been initialized, using [MobileScannerController.start]. | ||
| 41 | const MobileScanner({ | 37 | const MobileScanner({ |
| 42 | super.key, | 38 | super.key, |
| 43 | required this.onDetect, | 39 | required this.onDetect, |
| @@ -45,8 +41,6 @@ class MobileScanner extends StatefulWidget { | @@ -45,8 +41,6 @@ class MobileScanner extends StatefulWidget { | ||
| 45 | this.controller, | 41 | this.controller, |
| 46 | this.autoResume = true, | 42 | this.autoResume = true, |
| 47 | this.fit = BoxFit.cover, | 43 | this.fit = BoxFit.cover, |
| 48 | - @Deprecated('Use the [onPermissionSet] paremeter in the [MobileScannerController] instead.') | ||
| 49 | - this.onPermissionSet, | ||
| 50 | }); | 44 | }); |
| 51 | 45 | ||
| 52 | @override | 46 | @override |
| @@ -61,8 +55,7 @@ class _MobileScannerState extends State<MobileScanner> | @@ -61,8 +55,7 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 61 | void initState() { | 55 | void initState() { |
| 62 | super.initState(); | 56 | super.initState(); |
| 63 | WidgetsBinding.instance.addObserver(this); | 57 | WidgetsBinding.instance.addObserver(this); |
| 64 | - controller = widget.controller ?? | ||
| 65 | - MobileScannerController(onPermissionSet: widget.onPermissionSet); | 58 | + controller = widget.controller ?? MobileScannerController(); |
| 66 | if (!controller.isStarting) { | 59 | if (!controller.isStarting) { |
| 67 | _startScanner(); | 60 | _startScanner(); |
| 68 | } | 61 | } |
| @@ -141,8 +134,7 @@ class _MobileScannerState extends State<MobileScanner> | @@ -141,8 +134,7 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 141 | } | 134 | } |
| 142 | } else { | 135 | } else { |
| 143 | if (widget.controller == null) { | 136 | if (widget.controller == null) { |
| 144 | - controller = | ||
| 145 | - MobileScannerController(onPermissionSet: widget.onPermissionSet); | 137 | + controller = MobileScannerController(); |
| 146 | } else if (oldWidget.controller != widget.controller) { | 138 | } else if (oldWidget.controller != widget.controller) { |
| 147 | controller = widget.controller!; | 139 | controller = widget.controller!; |
| 148 | } | 140 | } |
-
Please register or login to post a comment