You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
Dart
49 lines
1.4 KiB
Dart
class BranchUser {
|
|
int id;
|
|
String? userId;
|
|
int? serviceProviderId;
|
|
int? dealershipUserID;
|
|
String firstName;
|
|
String lastName;
|
|
String mobileNo;
|
|
String email;
|
|
bool isBranchUser;
|
|
|
|
BranchUser({
|
|
required this.id,
|
|
required this.userId,
|
|
required this.serviceProviderId,
|
|
required this.dealershipUserID,
|
|
required this.firstName,
|
|
required this.lastName,
|
|
required this.mobileNo,
|
|
required this.email,
|
|
required this.isBranchUser,
|
|
});
|
|
|
|
factory BranchUser.fromJson(Map<String, dynamic> json) =>
|
|
BranchUser(
|
|
id: json["id"],
|
|
userId: json.containsKey("userID") ? json["userID"] : null,
|
|
serviceProviderId: json.containsKey("serviceProviderID") ? json["serviceProviderID"] : null,
|
|
dealershipUserID: json.containsKey("dealershipUserID") ? json["dealershipUserID"] : null,
|
|
firstName: json["firstName"],
|
|
lastName: json["lastName"],
|
|
mobileNo: json["mobileNo"],
|
|
email: json["email"],
|
|
isBranchUser: json.containsKey("isBranchUser") ? json["isBranchUser"] : false,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() =>
|
|
{
|
|
"id": id,
|
|
"userID": userId,
|
|
"serviceProviderID": serviceProviderId,
|
|
"firstName": firstName,
|
|
"lastName": lastName,
|
|
"mobileNo": mobileNo,
|
|
"email": email,
|
|
"isBranchUser": isBranchUser,
|
|
};
|
|
}
|