Showing
2 changed files
with
6 additions
and
3 deletions
| @@ -52,7 +52,8 @@ class _MobileScannerState extends State<MobileScanner> | @@ -52,7 +52,8 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 52 | void initState() { | 52 | void initState() { |
| 53 | super.initState(); | 53 | super.initState(); |
| 54 | WidgetsBinding.instance.addObserver(this); | 54 | WidgetsBinding.instance.addObserver(this); |
| 55 | - controller = widget.controller ?? MobileScannerController(onPermissionSet: widget.onPermissionSet); | 55 | + controller = widget.controller ?? |
| 56 | + MobileScannerController(onPermissionSet: widget.onPermissionSet); | ||
| 56 | if (!controller.isStarting) controller.start(); | 57 | if (!controller.isStarting) controller.start(); |
| 57 | } | 58 | } |
| 58 | 59 | ||
| @@ -122,7 +123,8 @@ class _MobileScannerState extends State<MobileScanner> | @@ -122,7 +123,8 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 122 | } | 123 | } |
| 123 | } else { | 124 | } else { |
| 124 | if (widget.controller == null) { | 125 | if (widget.controller == null) { |
| 125 | - controller = MobileScannerController(onPermissionSet: widget.onPermissionSet); | 126 | + controller = |
| 127 | + MobileScannerController(onPermissionSet: widget.onPermissionSet); | ||
| 126 | } else if (oldWidget.controller != widget.controller) { | 128 | } else if (oldWidget.controller != widget.controller) { |
| 127 | controller = widget.controller!; | 129 | controller = widget.controller!; |
| 128 | } | 130 | } |
| @@ -212,7 +212,8 @@ class MobileScannerController { | @@ -212,7 +212,8 @@ class MobileScannerController { | ||
| 212 | hasTorch = startResult['torchable'] as bool? ?? false; | 212 | hasTorch = startResult['torchable'] as bool? ?? false; |
| 213 | 213 | ||
| 214 | if (kIsWeb) { | 214 | if (kIsWeb) { |
| 215 | - onPermissionSet?.call(true); // If we reach this line, it means camera permission has been granted | 215 | + onPermissionSet?.call( |
| 216 | + true); // If we reach this line, it means camera permission has been granted | ||
| 216 | 217 | ||
| 217 | args.value = MobileScannerArguments( | 218 | args.value = MobileScannerArguments( |
| 218 | webId: startResult['ViewID'] as String?, | 219 | webId: startResult['ViewID'] as String?, |
-
Please register or login to post a comment