Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2023-10-23 20:51:13 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
039f285b3d3ad299ca605eed16bb11e4b22d695d
039f285b
1 parent
ca42c7e6
clean up a Platform check in a sample
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
example/lib/barcode_scanner_window.dart
example/lib/barcode_scanner_window.dart
View file @
039f285
import
'dart:io'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:mobile_scanner/mobile_scanner.dart'
;
...
...
@@ -150,7 +151,10 @@ class BarcodeOverlay extends CustomPainter {
@override
void
paint
(
Canvas
canvas
,
Size
size
)
{
if
(
barcode
.
corners
==
null
)
return
;
if
(
barcode
.
corners
==
null
)
{
return
;
}
final
adjustedSize
=
applyBoxFit
(
boxFit
,
arguments
.
size
,
size
);
double
verticalPadding
=
size
.
height
-
adjustedSize
.
destination
.
height
;
...
...
@@ -167,12 +171,16 @@ class BarcodeOverlay extends CustomPainter {
horizontalPadding
=
0
;
}
final
ratioWidth
=
(
Platform
.
isIOS
?
capture
.
width
!
:
arguments
.
size
.
width
)
/
adjustedSize
.
destination
.
width
;
final
ratioHeight
=
(
Platform
.
isIOS
?
capture
.
height
!
:
arguments
.
size
.
height
)
/
adjustedSize
.
destination
.
height
;
final
double
ratioWidth
;
final
double
ratioHeight
;
if
(!
kIsWeb
&&
Platform
.
isIOS
)
{
ratioWidth
=
capture
.
size
.
width
/
adjustedSize
.
destination
.
width
;
ratioHeight
=
capture
.
size
.
height
/
adjustedSize
.
destination
.
height
;
}
else
{
ratioWidth
=
arguments
.
size
.
width
/
adjustedSize
.
destination
.
width
;
ratioHeight
=
arguments
.
size
.
height
/
adjustedSize
.
destination
.
height
;
}
final
List
<
Offset
>
adjustedOffset
=
[];
for
(
final
offset
in
barcode
.
corners
!)
{
...
...
Please
register
or
login
to post a comment