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
2024-09-04 09:43:30 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0856a59e3791d69c6f2fafdde3dc9b61b5088b49
0856a59e
1 parent
28be45d3
add size to barcode
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
lib/src/objects/barcode.dart
lib/src/objects/barcode.dart
View file @
0856a59
...
...
@@ -28,6 +28,7 @@ class Barcode {
this
.
phone
,
this
.
rawBytes
,
this
.
rawValue
,
this
.
size
=
Size
.
zero
,
this
.
sms
,
this
.
type
=
BarcodeType
.
unknown
,
this
.
url
,
...
...
@@ -38,9 +39,9 @@ class Barcode {
factory
Barcode
.
fromNative
(
Map
<
Object
?,
Object
?>
data
)
{
final
Map
<
Object
?,
Object
?>?
calendarEvent
=
data
[
'calendarEvent'
]
as
Map
<
Object
?,
Object
?>?;
final
List
<
Object
?>?
corners
=
data
[
'corners'
]
as
List
<
Object
?>?;
final
Map
<
Object
?,
Object
?>?
contactInfo
=
data
[
'contactInfo'
]
as
Map
<
Object
?,
Object
?>?;
final
List
<
Object
?>?
corners
=
data
[
'corners'
]
as
List
<
Object
?>?;
final
Map
<
Object
?,
Object
?>?
driverLicense
=
data
[
'driverLicense'
]
as
Map
<
Object
?,
Object
?>?;
final
Map
<
Object
?,
Object
?>?
email
=
...
...
@@ -50,9 +51,13 @@ class Barcode {
final
Map
<
Object
?,
Object
?>?
phone
=
data
[
'phone'
]
as
Map
<
Object
?,
Object
?>?;
final
Map
<
Object
?,
Object
?>?
sms
=
data
[
'sms'
]
as
Map
<
Object
?,
Object
?>?;
final
Map
<
Object
?,
Object
?>?
size
=
data
[
'size'
]
as
Map
<
Object
?,
Object
?>?;
final
Map
<
Object
?,
Object
?>?
url
=
data
[
'url'
]
as
Map
<
Object
?,
Object
?>?;
final
Map
<
Object
?,
Object
?>?
wifi
=
data
[
'wifi'
]
as
Map
<
Object
?,
Object
?>?;
final
double
?
barcodeWidth
=
size
?[
'width'
]
as
double
?;
final
double
?
barcodeHeight
=
size
?[
'height'
]
as
double
?;
return
Barcode
(
calendarEvent:
calendarEvent
==
null
?
null
...
...
@@ -81,6 +86,9 @@ class Barcode {
phone:
phone
==
null
?
null
:
Phone
.
fromNative
(
phone
),
rawBytes:
data
[
'rawBytes'
]
as
Uint8List
?,
rawValue:
data
[
'rawValue'
]
as
String
?,
size:
barcodeWidth
==
null
||
barcodeHeight
==
null
?
Size
.
zero
:
Size
(
barcodeWidth
,
barcodeHeight
),
sms:
sms
==
null
?
null
:
SMS
.
fromNative
(
sms
),
type:
BarcodeType
.
fromRawValue
(
data
[
'type'
]
as
int
?
??
0
),
url:
url
==
null
?
null
:
UrlBookmark
.
fromNative
(
url
),
...
...
@@ -144,6 +152,11 @@ class Barcode {
/// This is null if the raw value is not available.
final
String
?
rawValue
;
/// The size of the barcode bounding box.
///
/// If the bounding box is unavailable, this will be [Size.zero].
final
Size
size
;
/// The SMS message that is embedded in the barcode.
final
SMS
?
sms
;
...
...
Please
register
or
login
to post a comment