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 16:58:00 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
86524920c225bc52fc972664714568333d6db26b
86524920
1 parent
5eb93f86
move email class to its own file; make Email type non-null
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
32 deletions
CHANGELOG.md
lib/mobile_scanner.dart
lib/src/objects/barcode.dart
lib/src/objects/email.dart
CHANGELOG.md
View file @
8652492
## NEXT
Improvements:
*
The
`type` of an `Email`
is no longer null.
## 3.5.0
New Features:
*
Added the option to switch between bundled and unbundled MLKit for Android. (thanks @woolfred !)
...
...
lib/mobile_scanner.dart
View file @
8652492
...
...
@@ -14,4 +14,5 @@ export 'src/mobile_scanner_controller.dart';
export
'src/mobile_scanner_exception.dart'
;
export
'src/objects/barcode.dart'
;
export
'src/objects/barcode_capture.dart'
;
export
'src/objects/email.dart'
;
export
'src/objects/mobile_scanner_arguments.dart'
;
...
...
lib/src/objects/barcode.dart
View file @
8652492
...
...
@@ -5,9 +5,9 @@ import 'package:mobile_scanner/src/barcode_utility.dart';
import
'package:mobile_scanner/src/enums/address_type.dart'
;
import
'package:mobile_scanner/src/enums/barcode_format.dart'
;
import
'package:mobile_scanner/src/enums/barcode_type.dart'
;
import
'package:mobile_scanner/src/enums/email_type.dart'
;
import
'package:mobile_scanner/src/enums/encryption_type.dart'
;
import
'package:mobile_scanner/src/enums/phone_type.dart'
;
import
'package:mobile_scanner/src/objects/email.dart'
;
/// Represents a single recognized barcode and its value.
class
Barcode
{
...
...
@@ -383,37 +383,6 @@ class DriverLicense {
middleName
=
data
[
'middleName'
]
as
String
?;
}
/// An email message from a 'MAILTO:' or similar QRCode type.
class
Email
{
/// Gets email's address.
///
/// Returns null if not available.
final
String
?
address
;
/// Gets email's body.
///
/// Returns null if not available.
final
String
?
body
;
/// Gets email's subject.
///
/// Returns null if not available.
final
String
?
subject
;
/// Gets type of the email.
///
/// See also [EmailType].
/// Returns null if not available.
final
EmailType
?
type
;
/// Create a [Email] from native data.
Email
.
fromNative
(
Map
data
)
:
address
=
data
[
'address'
]
as
String
?,
body
=
data
[
'body'
]
as
String
?,
subject
=
data
[
'subject'
]
as
String
?,
type
=
EmailType
.
values
[
data
[
'type'
]
as
int
];
}
/// GPS coordinates from a 'GEO:' or similar QRCode type.
class
GeoPoint
{
/// Gets the latitude.
...
...
lib/src/objects/email.dart
0 → 100644
View file @
8652492
import
'package:mobile_scanner/src/enums/email_type.dart'
;
/// An email message from a 'MAILTO:' or similar QRCode type.
class
Email
{
/// Construct a new [Email] instance.
const
Email
({
this
.
address
,
this
.
body
,
this
.
subject
,
this
.
type
=
EmailType
.
unknown
,
});
/// Construct an [Email] from the given [data].
factory
Email
.
fromNative
(
Map
<
Object
?,
Object
?>
data
)
{
return
Email
(
address:
data
[
'address'
]
as
String
?,
body:
data
[
'body'
]
as
String
?,
subject:
data
[
'subject'
]
as
String
?,
type:
EmailType
.
fromRawValue
(
data
[
'type'
]
as
int
?
??
0
),
);
}
/// The email address.
final
String
?
address
;
/// The body of the email.
final
String
?
body
;
/// The subject of the email.
final
String
?
subject
;
/// The type of the email.
final
EmailType
type
;
}
...
...
Please
register
or
login
to post a comment