ScanOptions class
Options for configuring the QR/Barcode scanning behavior
Constructors
-
ScanOptions({List<
BarcodeFormat> formats = const [], bool enableFlash = false, bool autoFocus = true, bool multiScan = false, int maxScans = 1, bool beepOnScan = true, bool vibrateOnScan = true, bool showOverlay = true, int overlayColor = 0xFF00FF00, bool restrictScanArea = false, double scanAreaRatio = 0.7, int timeoutSeconds = 0, bool returnImage = false, double imageQuality = 0.8, bool detectInverted = false, CameraResolution cameraResolution = CameraResolution.medium, CameraFacing cameraFacing = CameraFacing.back}) -
const
-
ScanOptions.fromJson(Map<
String, dynamic> json) -
Creates options from a JSON map
factory
Properties
- autoFocus → bool
-
Whether to enable auto-focus
final
- beepOnScan → bool
-
Whether to play a beep sound when a code is detected
final
- cameraFacing → CameraFacing
-
Camera facing preference
final
- cameraResolution → CameraResolution
-
Camera resolution preference
final
- detectInverted → bool
-
Whether to detect inverted (white on black) codes
final
- enableFlash → bool
-
Whether to enable the camera flash/torch
final
-
formats
→ List<
BarcodeFormat> -
List of barcode formats to scan for (if empty, scans all supported formats)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageQuality → double
-
Image quality for returned images (0.0 to 1.0)
final
- maxScans → int
-
Maximum number of codes to scan in multi-scan mode (0 = unlimited)
final
- multiScan → bool
-
Whether to scan multiple codes in a single session
final
- overlayColor → int
-
Color of the scanning overlay
final
- restrictScanArea → bool
-
Whether to restrict scanning to a specific area
final
- returnImage → bool
-
Whether to return the raw image data along with scan results
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scanAreaRatio → double
-
Scan area as a percentage of the screen (0.0 to 1.0)
final
- showOverlay → bool
-
Whether to show a scanning overlay with guidelines
final
- timeoutSeconds → int
-
Timeout for scanning in seconds (0 = no timeout)
final
- vibrateOnScan → bool
-
Whether to vibrate when a code is detected
final
Methods
-
copyWith(
{List< BarcodeFormat> ? formats, bool? enableFlash, bool? autoFocus, bool? multiScan, int? maxScans, bool? beepOnScan, bool? vibrateOnScan, bool? showOverlay, int? overlayColor, bool? restrictScanArea, double? scanAreaRatio, int? timeoutSeconds, bool? returnImage, double? imageQuality, bool? detectInverted, CameraResolution? cameraResolution, CameraFacing? cameraFacing}) → ScanOptions - Creates a copy of this options with the given fields replaced
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts the options to a JSON map for platform communication
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited