driver_license.dart
2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/// A driver license or ID card.
class DriverLicense {
/// Create a new [DriverLicense].
const DriverLicense({
this.addressCity,
this.addressState,
this.addressStreet,
this.addressZip,
this.birthDate,
this.documentType,
this.expiryDate,
this.firstName,
this.gender,
this.issueDate,
this.issuingCountry,
this.lastName,
this.licenseNumber,
this.middleName,
});
/// Create a [DriverLicense] from a map.
factory DriverLicense.fromNative(Map<Object?, Object?> data) {
return DriverLicense(
addressCity: data['addressCity'] as String?,
addressState: data['addressState'] as String?,
addressStreet: data['addressStreet'] as String?,
addressZip: data['addressZip'] as String?,
birthDate: data['birthDate'] as String?,
documentType: data['documentType'] as String?,
expiryDate: data['expiryDate'] as String?,
firstName: data['firstName'] as String?,
gender: data['gender'] as String?,
issueDate: data['issueDate'] as String?,
issuingCountry: data['issuingCountry'] as String?,
lastName: data['lastName'] as String?,
licenseNumber: data['licenseNumber'] as String?,
middleName: data['middleName'] as String?,
);
}
/// The city of the holder's address.
final String? addressCity;
/// The state of the holder's address.
final String? addressState;
/// The street address of the holder's address.
final String? addressStreet;
/// The postal code of the holder's address.
final String? addressZip;
/// The holder's birth date.
final String? birthDate;
/// The type of the license.
///
/// This is either "DL" for driver licenses or "ID" for ID cards.
final String? documentType;
/// The expiry date of the license.
final String? expiryDate;
/// The holder's first name.
final String? firstName;
/// The holder's gender.
///
/// This is either '1' for male or '2' for female.
final String? gender;
/// The issue date of the license.
///
/// The date format depends on the issuing country.
/// For example `MMDDYYYY` is used in the US,
/// and `YYYYMMDD` is used in Canada.
final String? issueDate;
/// The three-letter country code in which this license was issued.
final String? issuingCountry;
/// The holder's last name.
final String? lastName;
/// The identifying number for this license.
final String? licenseNumber;
/// The holder's middle name.
final String? middleName;
}