How shirisharyal/zxing_barcode_scanner works
ZXing Barcode Scanner is a Flutter plugin that scans camera frames on Android and iOS with ZXing-cpp, returning decoded barcode text and formats to the Flutter app. The main workflow configures a scanner platform view, obtains camera frames, decodes them, and dispatches results or camera errors through Pigeon to Dart callbacks. Dart-facing controls also start, stop, dispose, and toggle the flash. The README documents resolution and ZXing decoding options; native implementation excerpts are partial, so unverified internal wiring is omitted.
Main entry points: ScannerView.kt Scanner View · ZxingBarcodeScannerView.swift Scanner View · zxing_barcode_scanner_api.g.dart Dart Messages · zxing_barcode_scanner.dart Scanner API
Components 17
Flutter API
- Scanner API
lib/src/zxing_barcode_scanner.dart - Scan Config
lib/src/scanner_config.dart - Public Entry
lib/zxing_barcode_scanner.dart
Platform Bridge
- Dart Messages
lib/generated/zxing_barcode_scanner_api.g.dart
Android Scanner
- Plugin Factory
android/src/main/kotlin/com/shirisharyal/zxing_barcode_scanner/ZxingBarcodeScannerPlugin.kt - Scanner View
android/src/main/kotlin/com/shirisharyal/zxing_barcode_scanner/ScannerView.kt - Scan Config
android/src/main/kotlin/com/shirisharyal/zxing_barcode_scanner/ScannerConfig.kt - Native Messages
android/src/main/kotlin/com/shirisharyal/zxing_barcode_scanner/ZxingBarcodeScanner.kt - CameraX
- ZXing Reader
iOS Scanner
- Plugin Factory
ios/Classes/ZxingBarcodeScannerPlugin.swift - Scanner View
ios/Classes/ZxingBarcodeScannerView.swift - Scan Config
ios/Classes/ScannerConfig.swift - Native Messages
ios/Classes/ZxingBarcodeScanner.swift - AVFoundation
- ZXing Reader
Other components
- Flutter App
Connections 22
- Flutter App → Public Entry: uses
- Public Entry → Scanner API: exposes
- Scanner API → Scan Config: configures
- Scanner API → Dart Messages: sends controls
- Dart Messages → Native Messages: platform messages
- Dart Messages → Native Messages: platform messages
- Plugin Factory → Scanner View: creates view
- Scanner View → Scan Config: reads config
- Scanner View → Native Messages: registers handlers
- Scanner View → CameraX: captures frames
- Scanner View → ZXing Reader: decodes frames
- Scanner View → Native Messages: dispatches results
- Native Messages → Dart Messages: returns results
- Plugin Factory → Scanner View: creates view
- Plugin Factory → Scan Config: parses arguments
- Scanner View → Scan Config: applies options
- Scanner View → Native Messages: registers handlers
- Scanner View → AVFoundation: captures frames
- Scanner View → ZXing Reader: decodes frames
- Scanner View → Native Messages: dispatches results
- Native Messages → Dart Messages: returns results
- Dart Messages → Scanner API: delivers callbacks