fix barcode scanning

This commit is contained in:
Sai Naw Wun
2020-10-09 02:42:21 +06:30
parent 3f2442dbf2
commit 776ebf52ee
6 changed files with 43 additions and 23 deletions

View File

@@ -163,6 +163,12 @@ class _ReceivingNewState extends State<ReceivingNew> {
try {
String barcode = await BarcodeScanner.scan();
if (barcode != null) {
String gs = String.fromCharCode(29);
if (barcode.contains(gs)) {
var codes = barcode.split(gs);
barcode = codes.length >= 2 ? codes[1] : barcode;
}
setState(() {
_transcationIDCtl.text = barcode;
});