MobileScanner class

The MobileScanner widget displays a live camera preview.

Inheritance

Constructors

MobileScanner({MobileScannerController? controller, MobileScannerErrorBuilder? errorBuilder, required void onDetect(BarcodeCapture barcodes), required Widget cameraPreviewBuilder(BuildContext context, Widget texture, MobileScannerArguments arguments), Rect? scanWindowBuilder(MobileScannerArguments)?, @Deprecated('Use onScannerStarted() instead.') void onStart(MobileScannerArguments? arguments)?, void onScannerStarted(MobileScannerArguments? arguments)?, Widget placeholderBuilder(BuildContext, Widget?)?, bool startDelay = false, Color borderColor = const Color(0xFF00BA88), double borderWidth = 10, Key? key})
Create a new MobileScanner using the provided controller and onBarcodeDetected callback.
const

Properties

borderColor Color
final
borderWidth double
final
cameraPreviewBuilder Widget Function(BuildContext context, Widget texture, MobileScannerArguments arguments)
⚡️ Added function from the original package
final
controller MobileScannerController?
The controller that manages the barcode scanner.
final
errorBuilder MobileScannerErrorBuilder?
The function that builds an error widget when the scanner could not be started.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDetect → void Function(BarcodeCapture barcodes)
The function that signals when new codes were detected by the controller.
final
onScannerStarted → void Function(MobileScannerArguments? arguments)?
The function that signals when the barcode scanner is started.
final
onStart → void Function(MobileScannerArguments? arguments)?
The function that signals when the barcode scanner is started.
final
placeholderBuilder Widget Function(BuildContext, Widget?)?
The function that builds a placeholder widget when the scanner is not yet displaying its camera preview.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scanWindowBuilder Rect? Function(MobileScannerArguments)?
⚡️ Added function from the original package
final
startDelay bool
Only set this to true if you are starting another instance of mobile_scanner right after disposing the first one, like in a PageView.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MobileScanner>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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