MobileScannerController class

The controller for the MobileScanner widget.

Inheritance

Constructors

MobileScannerController({bool autoStart = true, Size? cameraResolution, DetectionSpeed detectionSpeed = DetectionSpeed.normal, int detectionTimeoutMs = 250, CameraFacing facing = CameraFacing.back, List<BarcodeFormat> formats = const <BarcodeFormat>[], bool returnImage = false, bool torchEnabled = false, bool useNewCameraSelector = false})
Construct a new MobileScannerController instance.

Properties

autoStart bool
Automatically start the scanner on initialization.
final
barcodes Stream<BarcodeCapture>
Get the stream of scanned barcodes.
no setter
cameraResolution Size?
The desired resolution for the camera.
final
detectionSpeed DetectionSpeed
The detection speed for the scanner.
final
detectionTimeoutMs int
The detection timeout, in milliseconds, for the scanner.
final
facing CameraFacing
The facing direction for the camera.
final
formats List<BarcodeFormat>
The formats that the scanner should detect.
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
returnImage bool
Whether the BarcodeCapture.image bytes should be provided.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
torchEnabled bool
Whether the flashlight should be turned on when the camera is started.
final
useNewCameraSelector bool
Use the new resolution selector.
final
value MobileScannerState
The current value stored in this notifier.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
analyzeImage(String path, {List<BarcodeFormat> formats = const <BarcodeFormat>[]}) Future<BarcodeCapture?>
Analyze an image file.
buildCameraView() Widget
Build a camera preview widget.
dispose() Future<void>
Dispose the controller.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resetZoomScale() Future<void>
Reset the zoom scale of the camera.
setZoomScale(double zoomScale) Future<void>
Set the zoom scale of the camera.
start({CameraFacing? cameraDirection}) Future<void>
Start scanning for barcodes.
stop() Future<void>
Stop the camera.
switchCamera() Future<void>
Switch between the front and back camera.
toggleTorch() Future<void>
Switches the flashlight on or off.
toString() String
A string representation of this object.
inherited
updateScanWindow(Rect? window) Future<void>
Update the scan window with the given window rectangle.

Operators

operator ==(Object other) bool
The equality operator.
inherited