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:22:54 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1763300226e57de28c6305ff6573380a5228d194
17633002
1 parent
acdcfb0d
move SMS to its own file
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
19 deletions
CHANGELOG.md
lib/mobile_scanner.dart
lib/src/objects/barcode.dart
lib/src/objects/sms.dart
CHANGELOG.md
View file @
1763300
## NEXT
Improvements:
*
The
`type` of an `Email`
is no longer null.
*
The
`type` of an `Email`
is now non-null.
*
The
`phoneNumber` of an `SMS`
is now non-null.
## 3.5.0
New Features:
...
...
lib/mobile_scanner.dart
View file @
1763300
...
...
@@ -18,4 +18,5 @@ export 'src/objects/calendar_event.dart';
export
'src/objects/driver_license.dart'
;
export
'src/objects/email.dart'
;
export
'src/objects/mobile_scanner_arguments.dart'
;
export
'src/objects/sms.dart'
;
export
'src/objects/wifi.dart'
;
...
...
lib/src/objects/barcode.dart
View file @
1763300
...
...
@@ -9,6 +9,7 @@ import 'package:mobile_scanner/src/enums/phone_type.dart';
import
'package:mobile_scanner/src/objects/calendar_event.dart'
;
import
'package:mobile_scanner/src/objects/driver_license.dart'
;
import
'package:mobile_scanner/src/objects/email.dart'
;
import
'package:mobile_scanner/src/objects/sms.dart'
;
import
'package:mobile_scanner/src/objects/wifi.dart'
;
/// Represents a single recognized barcode and its value.
...
...
@@ -274,24 +275,6 @@ class Phone {
type
=
PhoneType
.
values
[
data
[
'type'
]
as
int
];
}
/// A sms message from a 'SMS:' or similar QRCode type.
class
SMS
{
/// Gets the message content of the sms.
///
/// Returns null if not available.
final
String
?
message
;
/// Gets the phone number of the sms.
///
/// Returns null if not available.
final
String
?
phoneNumber
;
/// Create a [SMS] from native data.
SMS
.
fromNative
(
Map
data
)
:
message
=
data
[
'message'
]
as
String
?,
phoneNumber
=
data
[
'phoneNumber'
]
as
String
?;
}
/// A URL and title from a 'MEBKM:' or similar QRCode type.
class
UrlBookmark
{
/// Gets the title of the bookmark.
...
...
lib/src/objects/sms.dart
0 → 100644
View file @
1763300
/// An sms message from a `SMS:` or similar QRCode type.
class
SMS
{
/// Construct a new [SMS] instance.
const
SMS
({
this
.
message
,
required
this
.
phoneNumber
,
});
/// Construct a new [SMS] instance from the given [data].
factory
SMS
.
fromNative
(
Map
<
Object
?,
Object
?>
data
)
{
return
SMS
(
message:
data
[
'message'
]
as
String
?,
phoneNumber:
data
[
'phoneNumber'
]
as
String
?
??
''
,
);
}
/// The message contained in the sms.
final
String
?
message
;
/// The phone number which sent the sms.
final
String
phoneNumber
;
}
...
...
Please
register
or
login
to post a comment