diff --git a/lib/widgets/scanner.dart b/lib/widgets/scanner.dart index a8b1b2b..f7a5089 100644 --- a/lib/widgets/scanner.dart +++ b/lib/widgets/scanner.dart @@ -19,18 +19,6 @@ class MyScanner extends StatefulWidget { class MyScannerState extends State { bool scanning = false; - void handleError() { - setState(() { - scanning = false; - AwesomeDialog( - context: context, - dialogType: DialogType.error, - title: 'Upss', - desc: 'Da muss etwas schiefgelaufen sein!', - ).show(); - }); - } - void handleSucces(String? rawValue) { String qrText = rawValue!; Map json = stringToJSON(qrText); @@ -51,15 +39,11 @@ class MyScannerState extends State { } void onDetect(capture) { - try { - final List barcodes = capture.barcodes; - for (final barcode in barcodes) { - if (barcode.rawValue != null) { - return handleSucces(barcode.rawValue); - } + final List barcodes = capture.barcodes; + for (final barcode in barcodes) { + if (barcode.rawValue != null) { + return handleSucces(barcode.rawValue); } - } finally { - handleError(); } }