Julian Steenbakker

Merge remote-tracking branch 'origin/hotfix/usage-after-dispose' into hotfix/usage-after-dispose

# Conflicts:
#	lib/src/mobile_scanner.dart
@@ -22,7 +22,10 @@ class ScannerErrorWidget extends StatelessWidget { @@ -22,7 +22,10 @@ class ScannerErrorWidget extends StatelessWidget {
22 error.errorCode.message, 22 error.errorCode.message,
23 style: const TextStyle(color: Colors.white), 23 style: const TextStyle(color: Colors.white),
24 ), 24 ),
25 - if (error.errorDetails != null) Text( 25 + if (error.errorDetails?.message case final String message) Text(
  26 + message,
  27 + style: const TextStyle(color: Colors.white),
  28 + ),
26 error.errorDetails!.message ?? '', 29 error.errorDetails!.message ?? '',
27 style: const TextStyle(color: Colors.white), 30 style: const TextStyle(color: Colors.white),
28 ), 31 ),
@@ -83,7 +83,7 @@ class MethodChannelMobileScanner extends MobileScannerPlatform { @@ -83,7 +83,7 @@ class MethodChannelMobileScanner extends MobileScannerPlatform {
83 throw MobileScannerException( 83 throw MobileScannerException(
84 errorCode: MobileScannerErrorCode.unsupported, 84 errorCode: MobileScannerErrorCode.unsupported,
85 errorDetails: MobileScannerErrorDetails( 85 errorDetails: MobileScannerErrorDetails(
86 - message:MobileScannerErrorCode.unsupported.message, 86 + message: MobileScannerErrorCode.unsupported.message,
87 ), 87 ),
88 ); 88 );
89 } 89 }
@@ -302,7 +302,7 @@ class _MobileScannerState extends State<MobileScanner> @@ -302,7 +302,7 @@ class _MobileScannerState extends State<MobileScanner>
302 void initState() { 302 void initState() {
303 super.initState(); 303 super.initState();
304 controller = widget.controller ?? MobileScannerController(); 304 controller = widget.controller ?? MobileScannerController();
305 - initMobileScanner(); 305 + unawaited(initMobileScanner());
306 } 306 }
307 307
308 @override 308 @override
@@ -24,7 +24,10 @@ class ScannerErrorWidget extends StatelessWidget { @@ -24,7 +24,10 @@ class ScannerErrorWidget extends StatelessWidget {
24 error.errorCode.message, 24 error.errorCode.message,
25 style: const TextStyle(color: Colors.white), 25 style: const TextStyle(color: Colors.white),
26 ), 26 ),
27 - if (error.errorDetails != null) Text( 27 + if (error.errorDetails?.message case final String message) Text(
  28 + message,
  29 + style: const TextStyle(color: Colors.white),
  30 + ),
28 error.errorDetails!.message ?? '', 31 error.errorDetails!.message ?? '',
29 style: const TextStyle(color: Colors.white), 32 style: const TextStyle(color: Colors.white),
30 ), 33 ),