This page covers the Flutter migration from SDK 5.17.x to SDK 6.0.0-beta11.
result['barcodes'].cancellation_error.flutter_genius_scan: 6.0.0-beta11.dependencies:
flutter_genius_scan: 6.0.0-beta11
For Android, set the app minimum SDK to at least 23:
android {
defaultConfig {
minSdkVersion 23
}
}
For iOS, set the Runner deployment target to at least 15.0 in Xcode. Open ios/Runner.xcworkspace, select the Runner target, and update Build Settings > iOS Deployment Target.
Also set the Podfile platform to at least iOS 15:
platform :ios, '15.0'
Keep using FlutterGeniusScan.scanWithConfiguration(...) for document scanning.
If your SDK 5 document scan flow extracted readable codes as structured data, update that configuration and result access to barcode terminology.
Before:
final result = await FlutterGeniusScan.scanWithConfiguration({
'source': 'camera',
'structuredData': ['readableCode'],
'structuredDataReadableCodeTypes': ['qr', 'code128'],
});
final codes = result['scans'][0]['structuredData']['readableCodes'];
After:
final result = await FlutterGeniusScan.scanWithConfiguration({
'source': 'camera',
'structuredData': ['barcode'],
'structuredDataBarcodeTypes': ['qr', 'code128'],
});
final barcodes = result['scans'][0]['structuredData']['barcodes'];
For the complete configuration surface, see the flutter_genius_scan package documentation.
Rename the readable-code API to the barcode API.
| SDK 5 | SDK 6 |
|---|---|
scanReadableCodesWithConfiguration(...) |
scanBarcodesWithConfiguration(...) |
result['readableCodes'] |
result['barcodes'] |
Before:
final result = await FlutterGeniusScan.scanReadableCodesWithConfiguration({
'supportedCodeTypes': ['qr', 'code128'],
'isBatchModeEnabled': true,
});
final codes = result['readableCodes'];
After:
final result = await FlutterGeniusScan.scanBarcodesWithConfiguration({
'supportedCodeTypes': ['qr', 'code128'],
'isBatchModeEnabled': true,
});
final codes = result['barcodes'];
In SDK 5, the Flutter demo sent every PlatformException to the same failure path and displayed a snackbar. If your app already suppressed document scan cancellation, it had to check platform-specific values: com.thegrizzlylabs.gssdk.scanflow.ErrorDomain error 999 on iOS and E_SCAN_CANCELED on Android.
SDK 6 aligns scan-flow error codes across iOS and Android. Flutter receives those codes through PlatformException.code: cancellation_error, configuration_error, licensing_error, capture_error, storage_space_error, and internal_error. The structured payload is also available through PlatformException.details.
Before:
const sdk5DocumentScanCancellationCodes = <String>{
'com.thegrizzlylabs.gssdk.scanflow.ErrorDomain error 999',
'E_SCAN_CANCELED',
};
try {
await FlutterGeniusScan.scanWithConfiguration(configuration);
} on PlatformException catch (error) {
if (sdk5DocumentScanCancellationCodes.contains(error.code)) {
return;
}
showScanError(error.message ?? 'Unable to scan');
}
After:
try {
await FlutterGeniusScan.scanWithConfiguration(configuration);
} on PlatformException catch (error) {
if (error.code == 'cancellation_error') {
return;
}
showScanError(error.message ?? 'Unable to scan');
}
Apply the same SDK 6 pattern to barcode scan flow calls. If your app also logs or rethrows scan-flow failures, do that only after the cancellation_error check.
After the package and native project updates, build and run the app on both iOS and Android.
Validate the document scan flow, barcode scan flow, barcode result key, user cancellation handling, and one non-cancellation error path. If your app uses OCR, PDF generation, multi-page scanning, or structured data extraction, run those scenarios too.
Start with a free trial license to test the SDK, or contact us directly for a custom quote tailored to your needs.
© 2026 The Grizzly Labs. All rights reserved.