|
|
@ -20,12 +20,14 @@ class ReaderWidget extends StatefulWidget { |
|
|
|
this.onControllerCreated, |
|
|
|
this.onControllerCreated, |
|
|
|
this.onMultiScanModeChanged, |
|
|
|
this.onMultiScanModeChanged, |
|
|
|
this.isMultiScan = false, |
|
|
|
this.isMultiScan = false, |
|
|
|
|
|
|
|
this.multiScanModeAlignment = Alignment.bottomRight, |
|
|
|
|
|
|
|
this.multiScanModePadding = const EdgeInsets.all(10), |
|
|
|
this.codeFormat = Format.any, |
|
|
|
this.codeFormat = Format.any, |
|
|
|
this.tryHarder = false, |
|
|
|
this.tryHarder = false, |
|
|
|
this.tryInverted = false, |
|
|
|
this.tryInverted = false, |
|
|
|
this.showScannerOverlay = true, |
|
|
|
this.showScannerOverlay = true, |
|
|
|
this.scannerOverlay, |
|
|
|
this.scannerOverlay, |
|
|
|
this.actionButtonsAlignment = Alignment.topCenter, |
|
|
|
this.actionButtonsAlignment = Alignment.bottomLeft, |
|
|
|
this.actionButtonsPadding = const EdgeInsets.all(10), |
|
|
|
this.actionButtonsPadding = const EdgeInsets.all(10), |
|
|
|
this.showFlashlight = true, |
|
|
|
this.showFlashlight = true, |
|
|
|
this.showToggleCamera = true, |
|
|
|
this.showToggleCamera = true, |
|
|
@ -55,11 +57,18 @@ class ReaderWidget extends StatefulWidget { |
|
|
|
final Function(CameraController?)? onControllerCreated; |
|
|
|
final Function(CameraController?)? onControllerCreated; |
|
|
|
|
|
|
|
|
|
|
|
/// Called when the multi scan mode is changed |
|
|
|
/// Called when the multi scan mode is changed |
|
|
|
|
|
|
|
/// When set to null, the multi scan mode button will not be displayed |
|
|
|
final Function(bool)? onMultiScanModeChanged; |
|
|
|
final Function(bool)? onMultiScanModeChanged; |
|
|
|
|
|
|
|
|
|
|
|
/// Allow multiple scans |
|
|
|
/// Allow multiple scans |
|
|
|
final bool isMultiScan; |
|
|
|
final bool isMultiScan; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Alignment for multi scan mode button |
|
|
|
|
|
|
|
final AlignmentGeometry multiScanModeAlignment; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Padding for multi scan mode button |
|
|
|
|
|
|
|
final EdgeInsetsGeometry multiScanModePadding; |
|
|
|
|
|
|
|
|
|
|
|
/// Code format to scan |
|
|
|
/// Code format to scan |
|
|
|
final int codeFormat; |
|
|
|
final int codeFormat; |
|
|
|
|
|
|
|
|
|
|
@ -395,15 +404,18 @@ class _ReaderWidgetState extends State<ReaderWidget> |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
ScanModeDropdown( |
|
|
|
if (widget.onMultiScanModeChanged != null) |
|
|
|
isMultiScan: isMultiScan, |
|
|
|
ScanModeDropdown( |
|
|
|
onChanged: (bool value) { |
|
|
|
isMultiScan: isMultiScan, |
|
|
|
setState(() { |
|
|
|
alignment: widget.multiScanModeAlignment, |
|
|
|
isMultiScan = value; |
|
|
|
padding: widget.multiScanModePadding, |
|
|
|
}); |
|
|
|
onChanged: (bool value) { |
|
|
|
widget.onMultiScanModeChanged?.call(value); |
|
|
|
setState(() { |
|
|
|
}, |
|
|
|
isMultiScan = value; |
|
|
|
), |
|
|
|
}); |
|
|
|
|
|
|
|
widget.onMultiScanModeChanged?.call(value); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|