File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,11 @@ class AiBarcodeScanner extends StatefulWidget {
115115 /// Custom icon for the flashlight when off
116116 final IconData flashOffIcon;
117117
118+ /// Whether to return the raw image data (Uint8List) along with the BarcodeCapture.
119+ /// This can be useful for post-scan image processing such as color analysis or saving the frame.
120+ /// Defaults to `false` .
121+ final bool returnImage;
122+
118123 const AiBarcodeScanner ({
119124 super .key,
120125 this .fit = BoxFit .cover,
@@ -144,6 +149,7 @@ class AiBarcodeScanner extends StatefulWidget {
144149 this .cameraSwitchIcon = CupertinoIcons .arrow_2_circlepath,
145150 this .flashOnIcon = CupertinoIcons .bolt_fill,
146151 this .flashOffIcon = CupertinoIcons .bolt,
152+ this .returnImage = false ,
147153 });
148154
149155 @override
@@ -168,7 +174,10 @@ class _AiBarcodeScannerState extends State<AiBarcodeScanner> {
168174 DeviceOrientation .portraitDown,
169175 ]);
170176 }
171- _controller = widget.controller ?? MobileScannerController ();
177+ _controller = widget.controller ?? MobileScannerController (
178+ // Passes the returnImage flag to control whether frame images are returned with barcode data
179+ returnImage: widget.returnImage,
180+ );
172181 }
173182
174183 @override
You can’t perform that action at this time.
0 commit comments