mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 18:25:26 +00:00
Barcode Scanning Updates (#448)
* Add new setting for controlling manual barcode scan * Adds ability to pause and resume scanning with button - Camera is still "live" during this * Add UI elements * Change scan setting - "Continuous" scanning - Enabled by default * Update release notes * Scanner updates - Use "hold to pause" in continuous scan - Use "tap to pause" in single scan * Improve barcode scanning options - Allow tap-to-pause or hold-to-pause - More obvious user interactions * Ensure consistent icon placement * Remove separate setting for barcode pause mode
This commit is contained in:
@ -18,6 +18,7 @@ class _InvenTreeBarcodeSettingsState extends State<InvenTreeBarcodeSettingsWidge
|
||||
|
||||
int barcodeScanDelay = 500;
|
||||
int barcodeScanType = BARCODE_CONTROLLER_CAMERA;
|
||||
bool barcodeScanSingle = false;
|
||||
|
||||
final TextEditingController _barcodeScanDelayController = TextEditingController();
|
||||
|
||||
@ -30,6 +31,7 @@ class _InvenTreeBarcodeSettingsState extends State<InvenTreeBarcodeSettingsWidge
|
||||
Future<void> loadSettings() async {
|
||||
barcodeScanDelay = await InvenTreeSettingsManager().getValue(INV_BARCODE_SCAN_DELAY, 500) as int;
|
||||
barcodeScanType = await InvenTreeSettingsManager().getValue(INV_BARCODE_SCAN_TYPE, BARCODE_CONTROLLER_CAMERA) as int;
|
||||
barcodeScanSingle = await InvenTreeSettingsManager().getBool(INV_BARCODE_SCAN_SINGLE, false);
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
@ -153,6 +155,20 @@ class _InvenTreeBarcodeSettingsState extends State<InvenTreeBarcodeSettingsWidge
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(L10().barcodeScanSingle),
|
||||
subtitle: Text(L10().barcodeScanSingleDetail),
|
||||
leading: Icon(Icons.barcode_reader),
|
||||
trailing: Switch(
|
||||
value: barcodeScanSingle,
|
||||
onChanged: (bool v) {
|
||||
InvenTreeSettingsManager().setValue(INV_BARCODE_SCAN_SINGLE, v);
|
||||
setState(() {
|
||||
barcodeScanSingle = v;
|
||||
});
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user