Navaron Bracke

move PersonName to its own file

... ... @@ -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';
... ...
... ... @@ -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.
... ...
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.
... ...
/// 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;
}
... ...