|
|
|
@ -20,12 +20,14 @@ class ReaderWidget extends StatefulWidget {
|
|
|
|
|
this.onControllerCreated, |
|
|
|
|
this.onMultiScanModeChanged, |
|
|
|
|
this.isMultiScan = false, |
|
|
|
|
this.multiScanModeAlignment = Alignment.bottomRight, |
|
|
|
|
this.multiScanModePadding = const EdgeInsets.all(10), |
|
|
|
|
this.codeFormat = Format.any, |
|
|
|
|
this.tryHarder = false, |
|
|
|
|
this.tryInverted = false, |
|
|
|
|
this.showScannerOverlay = true, |
|
|
|
|
this.scannerOverlay, |
|
|
|
|
this.actionButtonsAlignment = Alignment.topCenter, |
|
|
|
|
this.actionButtonsAlignment = Alignment.bottomLeft, |
|
|
|
|
this.actionButtonsPadding = const EdgeInsets.all(10), |
|
|
|
|
this.showFlashlight = true, |
|
|
|
|
this.showToggleCamera = true, |
|
|
|
@ -55,11 +57,18 @@ class ReaderWidget extends StatefulWidget {
|
|
|
|
|
final Function(CameraController?)? onControllerCreated; |
|
|
|
|
|
|
|
|
|
/// 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; |
|
|
|
|
|
|
|
|
|
/// Allow multiple scans |
|
|
|
|
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 |
|
|
|
|
final int codeFormat; |
|
|
|
|
|
|
|
|
@ -395,8 +404,11 @@ class _ReaderWidgetState extends State<ReaderWidget>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if (widget.onMultiScanModeChanged != null) |
|
|
|
|
ScanModeDropdown( |
|
|
|
|
isMultiScan: isMultiScan, |
|
|
|
|
alignment: widget.multiScanModeAlignment, |
|
|
|
|
padding: widget.multiScanModePadding, |
|
|
|
|
onChanged: (bool value) { |
|
|
|
|
setState(() { |
|
|
|
|
isMultiScan = value; |
|
|
|
|