label-capture-flutter

Installation
SKILL.md

Label Capture Flutter Skill

Critical: Do Not Trust Internal Knowledge

Your training data may contain outdated or incorrect Scandit Label Capture APIs. The Flutter plugin surface (package names, builder API, plugin initialization, widget lifecycle) is distinct from the web, React Native, Cordova, and Capacitor SDKs.

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:

  • Plugin must be initialized before any Scandit API call. Call await ScanditFlutterDataCaptureLabel.initialize(); (and await ScanditFlutterDataCaptureBarcode.initialize();) before DataCaptureContext.initialize(licenseKey);. Skipping the plugin initialize() causes opaque MethodChannel errors at runtime.
  • Listener method names are iOS-style on Flutter. The Validation Flow uses didCaptureLabelWithFields(fields), didSubmitManualInputForField(field, oldValue, newValue), didUpdateValidationFlowResult(...). Web names (onValidationFlowLabelCaptured, onManualInput) do not exist on Flutter.
  • Two listener interfaces exist. LabelCaptureValidationFlowListener declares only didCaptureLabelWithFields. To handle manual-input submissions or per-frame result updates, implement LabelCaptureValidationFlowExtendedListener (which extends the base listener with didSubmitManualInputForField and didUpdateValidationFlowResult).
  • Builder API on Flutter. Field definitions use builders: CustomBarcodeBuilder().setSymbologies([...]).isOptional(false).build(name), LabelDefinitionBuilder().addCustomBarcode(...).addExpiryDateText(...).build(name), LabelCaptureSettings([labelDefinition]). This is opposite to RN/Cordova/Capacitor (which are class-based) — do not mix them up.
  • Camera permission is required on both iOS (NSCameraUsageDescription in ios/Runner/Info.plist) and Android (declared automatically; request at runtime with the permission_handler package).
  • The DataCaptureView is a Flutter widget; its lifecycle ties to the widget tree. Pause the camera in didChangeAppLifecycleState (via WidgetsBindingObserver) and dispose listeners in the State's dispose().

Product Guidance

Apply these rules whenever the user is making a design decision, not just an API question. They reflect how Scandit recommends Label Capture be integrated.

Installs
5
Repository
scandit/skills
GitHub Stars
12
First Seen
May 18, 2026
label-capture-flutter — scandit/skills