75 lines
2.0 KiB
Dart
75 lines
2.0 KiB
Dart
class UserData {
|
|
User? user;
|
|
String? accessToken;
|
|
|
|
UserData(
|
|
{ this.user, this.accessToken});
|
|
|
|
UserData.fromJson(Map<String, dynamic> json) {
|
|
user = json['user'] != null ? new User.fromJson(json['user']) : null;
|
|
accessToken = json['access_token'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
if (this.user != null) {
|
|
data['user'] = this.user!.toJson();
|
|
}
|
|
data['access_token'] = this.accessToken;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class User {
|
|
String? firstName;
|
|
String? emailAddress;
|
|
int? principalTypeXid;
|
|
int? principalSourceXid;
|
|
String? dateOfBirth;
|
|
String? addressLine1;
|
|
String? phoneNumber;
|
|
String? updatedAt;
|
|
String? createdAt;
|
|
int? id;
|
|
|
|
User(
|
|
{this.firstName,
|
|
this.emailAddress,
|
|
this.principalTypeXid,
|
|
this.principalSourceXid,
|
|
this.dateOfBirth,
|
|
this.addressLine1,
|
|
this.phoneNumber,
|
|
this.updatedAt,
|
|
this.createdAt,
|
|
this.id});
|
|
|
|
User.fromJson(Map<String, dynamic> json) {
|
|
firstName = json['first_name'];
|
|
emailAddress = json['email_address'];
|
|
principalTypeXid = json['principal_type_xid'];
|
|
principalSourceXid = json['principal_source_xid'];
|
|
dateOfBirth = json['date_of_birth'];
|
|
addressLine1 = json['address_line1'];
|
|
phoneNumber = json['phone_number'];
|
|
updatedAt = json['updated_at'];
|
|
createdAt = json['created_at'];
|
|
id = json['id'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['first_name'] = this.firstName;
|
|
data['email_address'] = this.emailAddress;
|
|
data['principal_type_xid'] = this.principalTypeXid;
|
|
data['principal_source_xid'] = this.principalSourceXid;
|
|
data['date_of_birth'] = this.dateOfBirth;
|
|
data['address_line1'] = this.addressLine1;
|
|
data['phone_number'] = this.phoneNumber;
|
|
data['updated_at'] = this.updatedAt;
|
|
data['created_at'] = this.createdAt;
|
|
data['id'] = this.id;
|
|
return data;
|
|
}
|
|
}
|