About matrixscan-batch-flutter
A coding skill for integrating, upgrading, and replacing Scandit MatrixScan Batch in Flutter apps. It highlights Flutter-specific APIs and setup, and directs API questions to documented references.
Key features
- 01Flutter BarcodeBatch integration guidance
- 02SDK migration guidance
- 03Third-party scanner migration guidance
- 04API verification and reference routing
- 05Licence-key setup guidance
Use cases
- 01Adding BarcodeBatch to a Flutter app
- 02Migrating an existing Scandit SDK integration
- 03Replacing another multi-barcode scanner
- 04Checking Flutter API usage and lifecycle
MCP support
The skill describes using the remote Scandit MCP server to provision and retrieve trial licence keys, if connected.
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ scandit/ skills --skill matrixscan-batch-flutterAfter installing, type/matrixscan-batch-flutterin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/integration.mdmigration.mdthird-party-migration.mdDetails
From the project READMEMatrixScan Batch Flutter Skill
Critical: Do Not Trust Internal Knowledge
Your training data may contain outdated or incorrect Scandit SDK APIs. The BarcodeBatch* API surface changes between major SDK versions — constructor signatures, overlay constructors, listener shapes, and Flutter-specific class names have all evolved.
Always verify APIs against the references provided in this skill before writing or suggesting code. Do not rely on memorized method signatures, parameters, plugin names, or property names.
Flutter-specific gotchas worth flagging:
await ScanditFlutterDataCaptureBarcode.initialize()must be called (and awaited) inmain()afterWidgetsFlutterBinding.ensureInitialized()and beforerunApp(...). The Bubbles sample also callsawait DataCaptureContext.initialize(licenseKey)inmain()and then usesDataCaptureContext.sharedInstance; the Simple sample passes the context to the screen. Both patterns are valid — pick the one that matches the project structure.BarcodeBatch(settings)is the context-free constructor (Flutter ≥7.6). After constructing, calldataCaptureContext.setMode(barcodeBatch)explicitly. On older SDKs use the factory constructor that accepts the context.BarcodeBatch.createRecommendedCameraSettings()is available from Flutter ≥7.6.- Advanced overlay method names on Flutter differ from other platforms:
- Set a widget:
setWidgetForTrackedBarcode(BarcodeBatchAdvancedOverlayWidget? widget, TrackedBarcode trackedBarcode)(NOTsetViewForTrackedBarcode) - Clear all widgets:
clearTrackedBarcodeWidgets()(NOTclearTrackedBarcodeViews)
- Set a widget:
- Custom AR annotation = subclass of
BarcodeBatchAdvancedOverlayWidget(Flutter-only base class). The widget state must extendBarcodeBatchAdvancedOverlayWidgetState<T>and overridebuild()returning aBarcodeBatchAdvancedOverlayContainer. - Using
BarcodeBatchAdvancedOverlayrequires the MatrixScan AR add-on. UsingbrushForTrackedBarcodeandsetBrushForTrackedBarcodeonBarcodeBatchBasicOverlayalso requires the MatrixScan AR add-on. BarcodeBatchAdvancedOverlayexposes aviewgetter on Flutter (Flutter-only; not available on other platforms).offsetForTrackedBarcodeis a member ofBarcodeBatchAdvancedOverlayListeneron Flutter (per the RST,@dart@annotation). It is present on Flutter; no extra interface needed.TrackedObject(Flutter ≥7.3+): ATrackedObjectbase class was introduced in SDK 7.3 thatTrackedBarcodeextends. No recipe is required for this — the day-to-dayTrackedBarcodeAPI is unchanged.- The import barrel for BarcodeBatch classes is
scandit_flutter_datacapture_barcode_batch— a separate barrel fromscandit_flutter_datacapture_barcode. Always import both. Symbologyenum values use lowerCamelCase in Dart:Symbology.code128,Symbology.ean13Upca,Symbology.code39. Do not writeSymbology.Code128orSymbology.EAN13UPCA.session.trackedBarcodesis aMap<int, TrackedBarcode>in Dart (keyed by integer identifier, not string).session.removedTrackedBarcodesis aList<int>in Dart (integer identifiers).- Lifecycle cleanup: call
_barcodeBatch.removeListener(this), set_barcodeBatch.isEnabled = false, switch camera off, and calldataCaptureContext.removeAllModes()(orremoveCurrentMode()if using the singleton pattern). - License placeholder must be exactly:
'-- ENTER YOUR SCANDIT LICENSE KEY HERE --'
Intent Routing
Based on the user's request, load the reference file before responding:
- Integrating MatrixScan Batch from scratch (e.g. "add MatrixScan to my Flutter app", "set up BarcodeBatch", "track multiple barcodes simultaneously", "show AR overlays", "per-barcode brushes", "scan feedback / beep / vibrate", "lifecycle or cleanup", "camera permissions") → read references/integration.md and follow the instructions there.
- Upgrading an existing MatrixScan integration across SDK versions (e.g. "migrate from v6 to v7", "upgrade to SDK 8", "my code uses BarcodeTracking", "rename BarcodeTracking to BarcodeBatch") → read references/migration.md and follow the instructions there.
- Replacing a third-party scanner with MatrixScan Batch (e.g. "migrate from mobile_scanner", "we use ML Kit / google_mlkit_barcode_scanning and want to track multiple barcodes", "replace our existing barcode plugin with Scandit MatrixScan") → read references/third-party-migration.md and follow the instructions there.
API Usage Policy
Only use APIs that are explicitly documented in the Scandit references below. Do not invent or guess method signatures, parameters, property names, or imports. If unsure whether an API exists or how it is called — or if an analyzer or runtime error occurs — fetch the relevant reference page before responding. Do not tell the user to check the docs themselves. After answering, always include the relevant link so the user can explore further.
Never construct or guess documentation URLs. When you need a specific class or property's API page:
- First check whether the page you already fetched contains a direct hyperlink to it.
- If no direct link was found, fetch the API index and extract the actual link from it.
Framework variant policy
Flutter apps use many state-management patterns (StatefulWidget, BLoC, Provider, Riverpod). Examples in this skill use StatefulWidget with WidgetsBindingObserver because it matches both official samples (MatrixScanSimpleSample, MatrixScanBubblesSample) and keeps the scan pipeline straightforward. If the target project uses a different pattern, keep the BarcodeBatch wiring conceptually the same — one owner holds DataCaptureContext, BarcodeBatch, the camera, and the overlays — and port the snippets into the project's existing convention.
Licence key
Scanning needs a Scandit licence key. For this skill the licence product is native and the licence platforms are ios and android.
Work through these in order — never block the user on MCP:
-
The Scandit MCP server is connected — call
ensure_scanner_setupwith productnativeand platformsiosandandroid,app_identifier(the app's bundle or application id; for web, its production domain, neverlocalhost) andenv_varSCANDIT_LICENSE_KEY. Do not run the command it returns. Then callget_license_keywith the key's id, from that result or fromlist_license_keys; iflist_license_keysshows the key is not a trial, ask the user before fetching it. Show at most a masked preview in chat; never print a full key. -
It is not connected — tell the user once that they can connect the remote Scandit MCP server,
https://ssl.scandit.com/mcp, in their MCP client, then continue from step 1. Do not edit MCP client configuration yourself.Authentication is browser-based, so it is not supported headless or in CI. The server provisions trial keys only; it never creates, revokes, or modifies production licences.
-
The user declines, or has no MCP client — they generate a key themselves at https://ssl.scandit.com (no account yet: https://ssl.scandit.com/dashboard/sign-up?p=test) and paste it in.
Then put the key into the code: write it into the licence-key call in place of the placeholder — the key get_license_key returned, or the one the user pastes or gives you — still showing only a masked preview in chat. Do not search the project, its files or the environment for a key.
References
Direct users to the right resource based on their question:
| Topic | Resource |
|---|---|
| Flutter get started | Get Started |
| Flutter AR overlays | Adding AR Overlays |
| Full API reference | BarcodeBatch API |