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 21:33:24 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
798689dcf031dd1562e1c0cfbf8241dd6a8fa0bb
798689dc
1 parent
1ba52a62
handle non null corners
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
example/lib/barcode_scanner_window.dart
lib/mobile_scanner_web_plugin.dart
lib/src/mobile_scanner_controller.dart
example/lib/barcode_scanner_window.dart
View file @
798689d
...
...
@@ -151,7 +151,7 @@ class BarcodeOverlay extends CustomPainter {
@override
void
paint
(
Canvas
canvas
,
Size
size
)
{
if
(
barcode
.
corners
==
null
)
{
if
(
barcode
.
corners
.
isEmpty
)
{
return
;
}
...
...
@@ -183,7 +183,7 @@ class BarcodeOverlay extends CustomPainter {
}
final
List
<
Offset
>
adjustedOffset
=
[];
for
(
final
offset
in
barcode
.
corners
!
)
{
for
(
final
offset
in
barcode
.
corners
)
{
adjustedOffset
.
add
(
Offset
(
offset
.
dx
/
ratioWidth
+
horizontalPadding
,
...
...
lib/mobile_scanner_web_plugin.dart
View file @
798689d
...
...
@@ -130,8 +130,6 @@ class MobileScannerWebPlugin {
_barCodeStreamSubscription
=
barCodeReader
.
detectBarcodeContinuously
().
listen
((
code
)
{
if
(
code
!=
null
)
{
final
List
<
Offset
>?
corners
=
code
.
corners
;
controller
.
add
({
'name'
:
'barcodeWeb'
,
'data'
:
{
...
...
@@ -140,8 +138,8 @@ class MobileScannerWebPlugin {
'format'
:
code
.
format
.
rawValue
,
'displayValue'
:
code
.
displayValue
,
'type'
:
code
.
type
.
rawValue
,
if
(
corners
!=
null
&&
corners
.
isNotEmpty
)
'corners'
:
corners
if
(
code
.
corners
.
isNotEmpty
)
'corners'
:
code
.
corners
.
map
(
(
Offset
c
)
=>
<
Object
?,
Object
?>{
'x'
:
c
.
dx
,
'y'
:
c
.
dy
},
)
...
...
lib/src/mobile_scanner_controller.dart
View file @
798689d
...
...
@@ -444,7 +444,8 @@ class MobileScannerController {
corners:
toCorners
(
(
barcode
[
'corners'
]
as
List
<
Object
?>?
??
[])
.
cast
<
Map
<
Object
?,
Object
?>>(),
),
)
??
const
<
Offset
>[],
),
],
),
...
...
Please
register
or
login
to post a comment