Showing
3 changed files
with
3 additions
and
3 deletions
| @@ -50,7 +50,7 @@ class _BarcodeScannerWithScanWindowState | @@ -50,7 +50,7 @@ class _BarcodeScannerWithScanWindowState | ||
| 50 | return Stack( | 50 | return Stack( |
| 51 | children: [ | 51 | children: [ |
| 52 | MobileScanner( | 52 | MobileScanner( |
| 53 | - fit: BoxFit.contain, | 53 | + fit: BoxFit.cover, |
| 54 | scanWindow: scanWindow, | 54 | scanWindow: scanWindow, |
| 55 | controller: controller, | 55 | controller: controller, |
| 56 | onDetect: (barcode, args) { | 56 | onDetect: (barcode, args) { |
| @@ -92,7 +92,7 @@ class _MobileScannerState extends State<MobileScanner> | @@ -92,7 +92,7 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 92 | /// map the texture size to get its new size after fitted to screen | 92 | /// map the texture size to get its new size after fitted to screen |
| 93 | final fittedSizes = applyBoxFit(fit, textureSize, widgetSize); | 93 | final fittedSizes = applyBoxFit(fit, textureSize, widgetSize); |
| 94 | final fittedTextureSize = fittedSizes.destination; | 94 | final fittedTextureSize = fittedSizes.destination; |
| 95 | - | 95 | + |
| 96 | /// create a new rectangle that represents the texture on the screen | 96 | /// create a new rectangle that represents the texture on the screen |
| 97 | final minX = widgetSize.width / 2 - fittedTextureSize.width / 2; | 97 | final minX = widgetSize.width / 2 - fittedTextureSize.width / 2; |
| 98 | final minY = widgetSize.height / 2 - fittedTextureSize.height / 2; | 98 | final minY = widgetSize.height / 2 - fittedTextureSize.height / 2; |
| @@ -156,7 +156,7 @@ class MobileScannerController { | @@ -156,7 +156,7 @@ class MobileScannerController { | ||
| 156 | // Set the starting arguments for the camera | 156 | // Set the starting arguments for the camera |
| 157 | final Map arguments = {}; | 157 | final Map arguments = {}; |
| 158 | arguments['facing'] = facing.index; | 158 | arguments['facing'] = facing.index; |
| 159 | - /* if (scanWindow != null) { | 159 | + /* if (scanWindow != null) { |
| 160 | arguments['scanWindow'] = [ | 160 | arguments['scanWindow'] = [ |
| 161 | scanWindow!.left, | 161 | scanWindow!.left, |
| 162 | scanWindow!.top, | 162 | scanWindow!.top, |
-
Please register or login to post a comment