Showing
1 changed file
with
1 additions
and
13 deletions
| @@ -285,24 +285,12 @@ class _MobileScannerState extends State<MobileScanner> | @@ -285,24 +285,12 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | Future<void> disposeMobileScanner() async { | 287 | Future<void> disposeMobileScanner() async { |
| 288 | - Future<void> disposeMobileScanner() async { | ||
| 289 | if (widget.controller == null) { | 288 | if (widget.controller == null) { |
| 290 | WidgetsBinding.instance.removeObserver(this); | 289 | WidgetsBinding.instance.removeObserver(this); |
| 291 | } | 290 | } |
| 292 | - | 291 | + |
| 293 | await _subscription?.cancel(); | 292 | await _subscription?.cancel(); |
| 294 | _subscription = null; | 293 | _subscription = null; |
| 295 | - | ||
| 296 | - if (controller.autoStart) { | ||
| 297 | - await controller.stop(); | ||
| 298 | - } | ||
| 299 | - | ||
| 300 | - // Dispose default controller if not provided by user | ||
| 301 | - if (widget.controller == null) { | ||
| 302 | - await controller.dispose(); | ||
| 303 | - } | ||
| 304 | - } | ||
| 305 | - WidgetsBinding.instance.removeObserver(this); | ||
| 306 | 294 | ||
| 307 | if (controller.autoStart) { | 295 | if (controller.autoStart) { |
| 308 | await controller.stop(); | 296 | await controller.stop(); |
-
Please register or login to post a comment