2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Update form field with scanned barcode

This commit is contained in:
Oliver 2021-10-03 11:41:16 +11:00
parent 6288088a65
commit f75aa4ca0e
2 changed files with 9 additions and 2 deletions

View File

@ -332,9 +332,9 @@ class APIFormField {
trailing: IconButton( trailing: IconButton(
icon: FaIcon(FontAwesomeIcons.qrcode), icon: FaIcon(FontAwesomeIcons.qrcode),
onPressed: () async { onPressed: () async {
var handler = UniqueBarcodeHandler((String hash) { var handler = UniqueBarcodeHandler((String hash) {
print("Scanned barcode: " + hash); controller.text = hash;
data["value"] = hash;
}); });
Navigator.push( Navigator.push(

View File

@ -511,9 +511,16 @@ class UniqueBarcodeHandler extends BarcodeHandler {
); );
} else { } else {
successTone();
// Close the barcode scanner // Close the barcode scanner
Navigator.of(context).pop(); Navigator.of(context).pop();
showSnackIcon(
L10().barcodeAssigned,
success: true
);
callback(hash); callback(hash);
} }
} }