Showing
1 changed file
with
8 additions
and
1 deletions
| @@ -7,6 +7,13 @@ import 'package:mobile_scanner/src/mobile_scanner_exception.dart'; | @@ -7,6 +7,13 @@ import 'package:mobile_scanner/src/mobile_scanner_exception.dart'; | ||
| 7 | import 'package:mobile_scanner/src/objects/barcode_capture.dart'; | 7 | import 'package:mobile_scanner/src/objects/barcode_capture.dart'; |
| 8 | import 'package:mobile_scanner/src/objects/mobile_scanner_arguments.dart'; | 8 | import 'package:mobile_scanner/src/objects/mobile_scanner_arguments.dart'; |
| 9 | 9 | ||
| 10 | +/// The function signature for the error builder. | ||
| 11 | +typedef MobileScannerErrorBuilder = Widget Function( | ||
| 12 | + BuildContext, | ||
| 13 | + MobileScannerException, | ||
| 14 | + Widget?, | ||
| 15 | +); | ||
| 16 | + | ||
| 10 | /// The [MobileScanner] widget displays a live camera preview. | 17 | /// The [MobileScanner] widget displays a live camera preview. |
| 11 | class MobileScanner extends StatefulWidget { | 18 | class MobileScanner extends StatefulWidget { |
| 12 | /// The controller that manages the barcode scanner. | 19 | /// The controller that manages the barcode scanner. |
| @@ -19,7 +26,7 @@ class MobileScanner extends StatefulWidget { | @@ -19,7 +26,7 @@ class MobileScanner extends StatefulWidget { | ||
| 19 | /// | 26 | /// |
| 20 | /// If this is null, defaults to a black [ColoredBox] | 27 | /// If this is null, defaults to a black [ColoredBox] |
| 21 | /// with a centered white [Icons.error] icon. | 28 | /// with a centered white [Icons.error] icon. |
| 22 | - final Widget Function(BuildContext, Object, Widget?)? errorBuilder; | 29 | + final MobileScannerErrorBuilder? errorBuilder; |
| 23 | 30 | ||
| 24 | /// The [BoxFit] for the camera preview. | 31 | /// The [BoxFit] for the camera preview. |
| 25 | /// | 32 | /// |
-
Please register or login to post a comment