mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-27 21:16:48 +00:00
Barcode handler code cleanup
This commit is contained in:
parent
b423d43db8
commit
07017c4745
@ -292,9 +292,6 @@ class StockItemBarcodeAssignmentHandler extends BarcodeHandler {
|
||||
|
||||
failureTone();
|
||||
|
||||
// Close the barcode scanner
|
||||
_controller?.dispose();
|
||||
|
||||
Navigator.of(context).pop();
|
||||
|
||||
showSnackIcon(
|
||||
@ -317,10 +314,6 @@ class StockItemBarcodeAssignmentHandler extends BarcodeHandler {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class StockItemScanIntoLocationHandler extends BarcodeHandler {
|
||||
/*
|
||||
* Barcode handler for scanning a provided StockItem into a scanned StockLocation
|
||||
@ -338,7 +331,16 @@ class StockItemScanIntoLocationHandler extends BarcodeHandler {
|
||||
// If the barcode points to a 'stocklocation', great!
|
||||
if (data.containsKey('stocklocation')) {
|
||||
// Extract location information
|
||||
int location = data['stocklocation']['pk'] as int;
|
||||
int location = (data['stocklocation']['pk'] ?? -1) as int;
|
||||
|
||||
if (location == -1) {
|
||||
showSnackIcon(
|
||||
L10().invalidStockLocation,
|
||||
success: false,
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Transfer stock to specified location
|
||||
final result = await item.transferStock(location);
|
||||
@ -347,9 +349,6 @@ class StockItemScanIntoLocationHandler extends BarcodeHandler {
|
||||
|
||||
successTone();
|
||||
|
||||
// Close the scanner
|
||||
_controller?.dispose();
|
||||
|
||||
Navigator.of(context).pop();
|
||||
|
||||
showSnackIcon(
|
||||
|
@ -475,7 +475,7 @@ packages:
|
||||
name: qr_code_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.1"
|
||||
version: "0.5.2"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -24,7 +24,7 @@ dependencies:
|
||||
cupertino_icons: ^1.0.3
|
||||
http: ^0.13.0
|
||||
cached_network_image: ^3.0.0 # Download and cache remote images
|
||||
qr_code_scanner: ^0.5.1 # Barcode scanning
|
||||
qr_code_scanner: ^0.5.2 # Barcode scanning
|
||||
package_info_plus: ^1.0.4 # App information introspection
|
||||
device_info_plus: ^2.1.0 # Information about the device
|
||||
font_awesome_flutter: ^9.1.0 # FontAwesome icon set
|
||||
|
Loading…
x
Reference in New Issue
Block a user