2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-07-30 17:21:28 +00:00
Oliver Walters
2021-02-09 21:38:50 +11:00
parent 90072904a0
commit 33bb6148de
11 changed files with 162 additions and 167 deletions

View File

@@ -66,14 +66,11 @@ class BarcodeHandler {
);
}
Future<void> processBarcode(BuildContext context, QRViewController _controller, String barcode, {String url = "barcode/", bool show_dialog = false}) {
Future<void> processBarcode(BuildContext context, QRViewController _controller, String barcode, {String url = "barcode/"}) {
this._context = context;
this._controller = _controller;
print("Scanned barcode data: ${barcode}");
if (show_dialog) {
showProgressDialog(context, "Scanning", "Sending barcode data to server");
}
// Send barcode request to server
InvenTreeAPI().post(
@@ -83,10 +80,6 @@ class BarcodeHandler {
}
).then((var response) {
if (show_dialog) {
hideProgressDialog(context);
}
if (response.statusCode != 200) {
showErrorDialog(
context,
@@ -119,10 +112,6 @@ class BarcodeHandler {
Duration(seconds: 5)
).catchError((error) {
if (show_dialog) {
hideProgressDialog(context);
}
showErrorDialog(
context,
"Error",