matrixscan-ar-flutter

Installation
SKILL.md

MatrixScan AR Flutter Skill

Critical: Do Not Trust Internal Knowledge

Your training data may contain outdated or incorrect Scandit SDK APIs. The BarcodeAr API changes between major SDK versions — class names, constructor signatures, provider interfaces, and the Flutter plugin import path 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. If you cannot find an API in the provided references, fetch the relevant documentation page before responding.

Flutter-specific gotchas worth flagging:

  • await ScanditFlutterDataCaptureBarcode.initialize() must be called (and awaited) in main() before runApp(...), after WidgetsFlutterBinding.ensureInitialized(). Forgetting this yields a platform-channel error that can look unrelated to initialization.
  • BarcodeArView is a Flutter StatefulWidget. Create it once in initState() (not in build()), store it as a field, and embed it in the widget tree. Creating it inside build() tears it down and rebuilds the native view on every rebuild.
  • The highlight and annotation providers (BarcodeArHighlightProvider, BarcodeArAnnotationProvider) return Future<BarcodeArHighlight?> and Future<BarcodeArAnnotation?> respectively. These callbacks are async — do not return plain values.
  • BarcodeArCustomHighlight and BarcodeArCustomAnnotation use Flutter Widget children that are serialized as snapshots. Animated widgets are captured as a still frame at render time — they will not animate inside the AR overlay.
  • The BLoC (or equivalent controller) owns DataCaptureContext, BarcodeAr, and the camera lifecycle. The State class holds the BarcodeArView and implements the provider interfaces.
  • Camera permission is required on both iOS (NSCameraUsageDescription in ios/Runner/Info.plist) and Android (runtime request via permission_handler — the plugin declares the manifest permission automatically).
  • The barcode AR import is scandit_flutter_datacapture_barcode_ar — a separate barrel file from the main scandit_flutter_datacapture_barcode import.
  • Symbology enum values use lowerCamelCase in Dart: Symbology.code128, Symbology.ean13Upca, Symbology.code39, Symbology.qr, Symbology.dataMatrix. Do not write Symbology.Code128 / Symbology.EAN13UPCA — that's the JS/TS form and will not compile in Dart.
Installs
6
Repository
scandit/skills
GitHub Stars
12
First Seen
May 18, 2026
matrixscan-ar-flutter — scandit/skills