fix profile

This commit is contained in:
Sai Naw Wun
2020-10-11 02:17:23 +06:30
parent b0ce53f856
commit 32e6be2abd
42 changed files with 938 additions and 626 deletions

View File

@@ -0,0 +1,18 @@
import 'package:barcode_scan/barcode_scan.dart';
Future<String> scanBarcode() async {
try {
String barcode = await BarcodeScanner.scan();
if (barcode == null) return null;
String gs = String.fromCharCode(29);
if (barcode.contains(gs)) {
var codes = barcode.split(gs);
barcode = codes.length >= 2 ? codes[1] : barcode;
}
return barcode;
} catch (e) {
print('error: $e');
return null;
}
}