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 17:52:38 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e8ea2336e6bfffb22c43d6499925b5b723833b84
e8ea2336
1 parent
1581a459
move UrlBookmark to its own file
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
19 deletions
CHANGELOG.md
lib/mobile_scanner.dart
lib/src/barcode_utility.dart
lib/src/objects/barcode.dart
lib/src/objects/url_bookmark.dart
CHANGELOG.md
View file @
e8ea233
...
...
@@ -4,6 +4,7 @@ Improvements:
*
The
`phoneNumber` of an `SMS`
is now non-null.
*
The
`latitude` and `longitude` of a `GeoPoint`
are now non-null.
*
The
`phones` and `urls` of `ContactInfo`
are now non-null.
*
The
`url` of a `UrlBookmark`
is now non-null.
## 3.5.0
New Features:
...
...
lib/mobile_scanner.dart
View file @
e8ea233
...
...
@@ -21,4 +21,5 @@ export 'src/objects/email.dart';
export
'src/objects/geo_point.dart'
;
export
'src/objects/mobile_scanner_arguments.dart'
;
export
'src/objects/sms.dart'
;
export
'src/objects/url_bookmark.dart'
;
export
'src/objects/wifi.dart'
;
...
...
lib/src/barcode_utility.dart
View file @
e8ea233
...
...
@@ -2,7 +2,6 @@ import 'dart:math' as math;
import
'package:flutter/material.dart'
;
import
'package:mobile_scanner/mobile_scanner.dart'
;
import
'package:mobile_scanner/src/objects/geo_point.dart'
;
Size
toSize
(
Map
data
)
{
final
width
=
data
[
'width'
]
as
double
;
...
...
lib/src/objects/barcode.dart
View file @
e8ea233
...
...
@@ -12,6 +12,7 @@ import 'package:mobile_scanner/src/objects/driver_license.dart';
import
'package:mobile_scanner/src/objects/email.dart'
;
import
'package:mobile_scanner/src/objects/geo_point.dart'
;
import
'package:mobile_scanner/src/objects/sms.dart'
;
import
'package:mobile_scanner/src/objects/url_bookmark.dart'
;
import
'package:mobile_scanner/src/objects/wifi.dart'
;
/// Represents a single recognized barcode and its value.
...
...
@@ -206,21 +207,3 @@ class Phone {
:
number
=
data
[
'number'
]
as
String
?,
type
=
PhoneType
.
values
[
data
[
'type'
]
as
int
];
}
/// A URL and title from a 'MEBKM:' or similar QRCode type.
class
UrlBookmark
{
/// Gets the title of the bookmark.
///
/// Returns null if not available.
final
String
?
title
;
/// Gets the url of the bookmark.
///
/// Returns null if not available.
final
String
?
url
;
/// Create a [UrlBookmark] from native data.
UrlBookmark
.
fromNative
(
Map
data
)
:
title
=
data
[
'title'
]
as
String
?,
url
=
data
[
'url'
]
as
String
?;
}
...
...
lib/src/objects/url_bookmark.dart
0 → 100644
View file @
e8ea233
/// A URL and title from a `MEBKM:` or similar QRCode type.
class
UrlBookmark
{
/// Construct a new [UrlBookmark] instance.
const
UrlBookmark
({
this
.
title
,
required
this
.
url
,
});
/// Construct a new [UrlBookmark] instance from the given [data].
factory
UrlBookmark
.
fromNative
(
Map
<
Object
?,
Object
?>
data
)
{
return
UrlBookmark
(
title:
data
[
'title'
]
as
String
?,
url:
data
[
'url'
]
as
String
?
??
''
,
);
}
/// The title of the bookmark.
final
String
?
title
;
/// The url of the bookmark.
final
String
url
;
}
...
...
Please
register
or
login
to post a comment