Barcode Capture

Defined in library scandit_datacapture_barcode

BarcodeCapture
class BarcodeCapture : DataCaptureMode

Added in version 6.7.0

Capture mode for single barcode scanning. Learn more on how to use barcode capture in our Get Started With Barcode Capture guide. This capture mode uses the barcode scanning capability.

For MatrixScan-based barcode capture, use BarcodeTracking instead.

It cannot be used together with other capture modes that require the same capabilities, e.g. BarcodeTracking.

BarcodeCapture.forContext(context, settings)
BarcodeCapture.forContext(DataCaptureContext context,
        BarcodeCaptureSettings settings)

Added in version 6.7.0

Construct a new barcode capture mode with the provided context and settings.

isEnabled
bool isEnabled

Added in version 6.7.0

Implemented from DataCaptureMode. See DataCaptureMode.isEnabled.

applySettings(settings)
Future<void> applySettings(BarcodeCaptureSettings settings)

Added in version 6.7.0

Asynchronously applies the new settings to the barcode scanner. If the scanner is currently running, the task will complete when the next frame is processed, and will use the new settings for that frame. If the scanner is currently not running, the task will complete as soon as the settings have been stored and won’t wait until the next frame is going to be processed.

feedback
BarcodeCaptureFeedback feedback

Added in version 6.7.0

Instance of BarcodeCaptureFeedback that is used by the barcode scanner to notify users about Success and Failure events.

The default instance of the Feedback will have both sound and vibration enabled. A default beep sound will be used for the sound.

To change the feedback emitted, the BarcodeCaptureFeedback can be modified as shown below, or a new one can be assigned.

var barcodeCapture = ...;
barcodeCapture.feedback.success = Feedback(null, Sound.defaultSound);
addListener(listener)
void addListener(BarcodeCaptureListener listener)

Added in version 6.7.0

Adds the listener to this barcode capture instance.

In case the same listener is already observing this instance, calling this method will not add the listener again.

addAdvancedListener(listener)
void addAdvancedListener(BarcodeCaptureAdvancedListener listener)

Added in version 6.14.0

Adds the advanced listener to this barcode capture instance.

In case the same listener is already observing this instance, calling this method will not add the listener again.

removeListener(listener)
void removeListener(BarcodeCaptureListener listener)

Added in version 6.7.0

Removes a previously added listener from this barcode capture instance.

In case the listener is not currently observing this instance, calling this method has no effect.

removeAdvancedListener(listener)
void removeAdvancedListener(BarcodeCaptureAdvancedListener listener)

Added in version 6.14.0

Removes a previously added advanced listener from this barcode capture instance.

In case the listener is not currently observing this instance, calling this method has no effect.

recommendedCameraSettings
static CameraSettings get recommendedCameraSettings

Added in version 6.7.0

Returns the recommended camera settings for use with barcode capture.

context
DataCaptureContext? get context

Added in version 6.7.0

Implemented from DataCaptureMode. See DataCaptureMode.context.