mirror of
				https://github.com/inventree/inventree-app.git
				synced 2025-11-03 23:05:44 +00:00 
			
		
		
		
	Update form field with scanned barcode
This commit is contained in:
		@@ -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(
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user