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().

Intent Routing

Based on the user's request, load the appropriate reference file before responding:

Related skills

More from scandit/scandit-sdk-skills

Installs
3
GitHub Stars
10
First Seen
Apr 28, 2026