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:58:16 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1f5c02d5710aab907d71878b8c39a97dd5614051
1f5c02d5
1 parent
e8ea2336
move PersonName to its own file
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
48 deletions
lib/mobile_scanner.dart
lib/src/objects/barcode.dart
lib/src/objects/contact_info.dart
lib/src/objects/person_name.dart
lib/mobile_scanner.dart
View file @
1f5c02d
...
...
@@ -20,6 +20,7 @@ export 'src/objects/driver_license.dart';
export
'src/objects/email.dart'
;
export
'src/objects/geo_point.dart'
;
export
'src/objects/mobile_scanner_arguments.dart'
;
export
'src/objects/person_name.dart'
;
export
'src/objects/sms.dart'
;
export
'src/objects/url_bookmark.dart'
;
export
'src/objects/wifi.dart'
;
...
...
lib/src/objects/barcode.dart
View file @
1f5c02d
...
...
@@ -141,54 +141,6 @@ class Address {
type
=
AddressType
.
values
[
data
[
'type'
]
as
int
];
}
/// A person's name, both formatted version and individual name components.
class
PersonName
{
/// Gets first name.
///
/// Returns null if not available.
final
String
?
first
;
/// Gets middle name.
///
/// Returns null if not available.
final
String
?
middle
;
/// Gets last name.
///
/// Returns null if not available.
final
String
?
last
;
/// Gets prefix of the name.
///
/// Returns null if not available.
final
String
?
prefix
;
/// Gets suffix of the person's name.
///
/// Returns null if not available.
final
String
?
suffix
;
/// Gets the properly formatted name.
///
/// Returns null if not available.
final
String
?
formattedName
;
/// Designates a text string to be set as the kana name in the phonebook. Used for Japanese contacts.
///
/// Returns null if not available.
final
String
?
pronunciation
;
/// Create a [PersonName] from native data.
PersonName
.
fromNative
(
Map
data
)
:
first
=
data
[
'first'
]
as
String
?,
middle
=
data
[
'middle'
]
as
String
?,
last
=
data
[
'last'
]
as
String
?,
prefix
=
data
[
'prefix'
]
as
String
?,
suffix
=
data
[
'suffix'
]
as
String
?,
formattedName
=
data
[
'formattedName'
]
as
String
?,
pronunciation
=
data
[
'pronunciation'
]
as
String
?;
}
/// Phone number info.
class
Phone
{
/// Gets phone number.
...
...
lib/src/objects/contact_info.dart
View file @
1f5c02d
import
'package:mobile_scanner/src/objects/barcode.dart'
;
import
'package:mobile_scanner/src/objects/email.dart'
;
import
'package:mobile_scanner/src/objects/person_name.dart'
;
/// A person's or organization's business card.
/// For example a VCARD.
...
...
lib/src/objects/person_name.dart
0 → 100644
View file @
1f5c02d
/// A person's name, divided into individual components.
class
PersonName
{
/// Create a new [PersonName] instance.
const
PersonName
({
this
.
first
,
this
.
middle
,
this
.
last
,
this
.
prefix
,
this
.
suffix
,
this
.
formattedName
,
this
.
pronunciation
,
});
/// Create a [PersonName] from a map.
factory
PersonName
.
fromNative
(
Map
<
Object
?,
Object
?>
data
)
{
return
PersonName
(
first:
data
[
'first'
]
as
String
?,
middle:
data
[
'middle'
]
as
String
?,
last:
data
[
'last'
]
as
String
?,
prefix:
data
[
'prefix'
]
as
String
?,
suffix:
data
[
'suffix'
]
as
String
?,
formattedName:
data
[
'formattedName'
]
as
String
?,
pronunciation:
data
[
'pronunciation'
]
as
String
?,
);
}
/// The person's first name.
final
String
?
first
;
/// The person's middle name.
final
String
?
middle
;
/// The person's last name.
final
String
?
last
;
/// The prefix of the person's name.
final
String
?
prefix
;
/// The suffix of the person's name.
final
String
?
suffix
;
/// The person's name in a structured format.
final
String
?
formattedName
;
/// The pronunciation of the person's name.
///
/// This is used for the "kana" name in Japanese phonebooks.
final
String
?
pronunciation
;
}
...
...
Please
register
or
login
to post a comment