digit_scanner
A Scanner package used for scanning QR Codes and GS1 Barcodes.
Getting Started
To use this package, add the following dependency to your pubspec.yaml
file:
dependencies:
digit_scanner: 0.0.0-dev.1
Initialize the DigitScannerBloc provider in your application
BlocProvider(
create: (_) {
return DigitScannerBloc(
const DigitScannerState(),
);
},
),
To Clear the scanner state
context.read<DigitScannerBloc>().add(
const DigitScannerEvent.handleScanner(),
);
Navigating to DigitScanner Page
context.router.push(DigitScannerRoute(
quantity: 1, // Max no. of codes to be scanned
isGS1code: false, // Set Flag to true for scanning GS1 barcode
singleValue: true, // Set Flag to false for scanning mutiple codes
));
Wrap the DigitScannerListener or DigitScannerBuilder in your widget tree wherever you need the Scanned codes.
BlocListener<DigitScannerBloc, DigitScannerState>(
listener: (context, scannerState) {
if (scannerState.qrCodes.isNotEmpty) {
//
}
},
child: BlocBuilder<DigitScannerBloc, DigitScannerState>(
builder: (context, scannerState) {
if(scannerState.qrCodes.isNotEmpty){
return Text(scannerState.qrCodes.last); ///Get the scanned codes after scanning from the scanner State
}
else {
return Container();}
}
));
Libraries
- blocs/app_localization
- blocs/scanner
- blocs/scanner_listeners
- blocs/scanner_localization_delegate
- digit_scanner
- pages/qr_scanner
- router/digit_scanner_router
- router/digit_scanner_router.gm
- utils/constants
- utils/extensions/extensions
- utils/i18_key_constants
- utils/scanner_utils
- widgets/localized
- widgets/vision_detector_views/camera_view
- widgets/vision_detector_views/detector_view
- widgets/vision_detector_views/painters/barcode_detector_painter
- widgets/vision_detector_views/painters/coordinates_translator
- widgets/vision_detector_views/utils