mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
error dialog if the barcode cannot be converted to JSON!
This commit is contained in:
parent
200d2edc9a
commit
d0f1a4d4ce
2 changed files with 28 additions and 1 deletions
|
|
@ -21,8 +21,16 @@ Future<void> scanQrCode(BuildContext context) async {
|
|||
|
||||
print("Scanned: $result");
|
||||
|
||||
Map<String, dynamic> data;
|
||||
|
||||
// Look for JSON data in the result...
|
||||
final data = json.decode(result);
|
||||
try {
|
||||
data = json.decode(result);
|
||||
} on FormatException {
|
||||
showErrorDialog(context, "Bad barcode data", result);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
showProgressDialog(context, "Querying Server", "Sending barcode data to server");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue