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 {
error.errorCode.message,
style: const TextStyle(color: Colors.white),
),
if (error.errorDetails != null) Text(
if (error.errorDetails?.message case final String message) Text(
message,
style: const TextStyle(color: Colors.white),
),
error.errorDetails!.message ?? '',
style: const TextStyle(color: Colors.white),
),
... ...
... ... @@ -83,7 +83,7 @@ class MethodChannelMobileScanner extends MobileScannerPlatform {
throw MobileScannerException(
errorCode: MobileScannerErrorCode.unsupported,
errorDetails: MobileScannerErrorDetails(
message:MobileScannerErrorCode.unsupported.message,
message: MobileScannerErrorCode.unsupported.message,
),
);
}
... ...
... ... @@ -302,7 +302,7 @@ class _MobileScannerState extends State<MobileScanner>
void initState() {
super.initState();
controller = widget.controller ?? MobileScannerController();
initMobileScanner();
unawaited(initMobileScanner());
}
@override
... ...
... ... @@ -24,7 +24,10 @@ class ScannerErrorWidget extends StatelessWidget {
error.errorCode.message,
style: const TextStyle(color: Colors.white),
),
if (error.errorDetails != null) Text(
if (error.errorDetails?.message case final String message) Text(
message,
style: const TextStyle(color: Colors.white),
),
error.errorDetails!.message ?? '',
style: const TextStyle(color: Colors.white),
),
... ...