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 23:12:22 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4dc9bce56808f3b412e74396cf543e4bf62a1d27
4dc9bce5
1 parent
680c4f06
remove toSize() helper
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
lib/src/barcode_utility.dart
lib/src/mobile_scanner_controller.dart
lib/src/barcode_utility.dart
View file @
4dc9bce
import
'package:flutter/material.dart'
;
import
'package:mobile_scanner/mobile_scanner.dart'
;
Size
toSize
(
Map
data
)
{
final
width
=
data
[
'width'
]
as
double
;
final
height
=
data
[
'height'
]
as
double
;
return
Size
(
width
,
height
);
}
List
<
Offset
>?
toCorners
(
List
<
Map
<
Object
?,
Object
?>>?
data
)
{
if
(
data
==
null
)
{
return
null
;
...
...
lib/src/mobile_scanner_controller.dart
View file @
4dc9bce
...
...
@@ -287,14 +287,26 @@ class MobileScannerController {
torchState
.
value
=
TorchState
.
on
;
}
final
Size
size
;
if
(
kIsWeb
)
{
size
=
Size
(
startResult
[
'videoWidth'
]
as
double
?
??
0
,
startResult
[
'videoHeight'
]
as
double
?
??
0
,
);
}
else
{
final
Map
<
Object
?,
Object
?>?
sizeInfo
=
startResult
[
'size'
]
as
Map
<
Object
?,
Object
?>?;
size
=
Size
(
sizeInfo
?[
'width'
]
as
double
?
??
0
,
sizeInfo
?[
'height'
]
as
double
?
??
0
,
);
}
isStarting
=
false
;
return
startArguments
.
value
=
MobileScannerArguments
(
size:
kIsWeb
?
Size
(
startResult
[
'videoWidth'
]
as
double
?
??
0
,
startResult
[
'videoHeight'
]
as
double
?
??
0
,
)
:
toSize
(
startResult
[
'size'
]
as
Map
?
??
{}),
size:
size
,
hasTorch:
hasTorch
,
textureId:
kIsWeb
?
null
:
startResult
[
'textureId'
]
as
int
?,
webId:
kIsWeb
?
startResult
[
'ViewID'
]
as
String
?
:
null
,
...
...
Please
register
or
login
to post a comment