diff --git a/lib/api_form.dart b/lib/api_form.dart index 74c62ff6..1a7237f6 100644 --- a/lib/api_form.dart +++ b/lib/api_form.dart @@ -332,9 +332,9 @@ class APIFormField { trailing: IconButton( icon: FaIcon(FontAwesomeIcons.qrcode), onPressed: () async { - var handler = UniqueBarcodeHandler((String hash) { - print("Scanned barcode: " + hash); + controller.text = hash; + data["value"] = hash; }); Navigator.push( diff --git a/lib/barcode.dart b/lib/barcode.dart index de6283f0..76bb4fe2 100644 --- a/lib/barcode.dart +++ b/lib/barcode.dart @@ -511,9 +511,16 @@ class UniqueBarcodeHandler extends BarcodeHandler { ); } else { + successTone(); + // Close the barcode scanner Navigator.of(context).pop(); + showSnackIcon( + L10().barcodeAssigned, + success: true + ); + callback(hash); } }