|
|
|
|
@ -1,12 +1,12 @@
|
|
|
|
|
// To parse this JSON data, do
|
|
|
|
|
//
|
|
|
|
|
// final user = userFromMap(jsonString);
|
|
|
|
|
// final registerUser = registerUserFromJson(jsonString);
|
|
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
RegisterUser userFromMap(String str) => RegisterUser.fromJson(json.decode(str));
|
|
|
|
|
RegisterUser registerUserFromJson(String str) => RegisterUser.fromJson(json.decode(str));
|
|
|
|
|
|
|
|
|
|
String userToMap(RegisterUser data) => json.encode(data.toMap());
|
|
|
|
|
String registerUserToJson(RegisterUser data) => json.encode(data.toJson());
|
|
|
|
|
|
|
|
|
|
class RegisterUser {
|
|
|
|
|
RegisterUser({
|
|
|
|
|
@ -16,28 +16,56 @@ class RegisterUser {
|
|
|
|
|
this.message,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dynamic totalItemsCount;
|
|
|
|
|
dynamic? totalItemsCount;
|
|
|
|
|
Data? data;
|
|
|
|
|
int? messageStatus;
|
|
|
|
|
String? message;
|
|
|
|
|
|
|
|
|
|
factory RegisterUser.fromJson(Map<String, dynamic> json) => RegisterUser(
|
|
|
|
|
totalItemsCount: json["totalItemsCount"],
|
|
|
|
|
data: json["data"] == null ? null : Data.fromMap(json["data"]),
|
|
|
|
|
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
|
|
|
|
message: json["message"] == null ? null : json["message"],
|
|
|
|
|
);
|
|
|
|
|
totalItemsCount: json["totalItemsCount"],
|
|
|
|
|
data: Data.fromJson(json["data"]),
|
|
|
|
|
messageStatus: json["messageStatus"],
|
|
|
|
|
message: json["message"],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toMap() => {
|
|
|
|
|
"totalItemsCount": totalItemsCount,
|
|
|
|
|
"data": data == null ? null : data!.toMap(),
|
|
|
|
|
"messageStatus": messageStatus == null ? null : messageStatus,
|
|
|
|
|
"message": message == null ? null : message,
|
|
|
|
|
};
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
|
"totalItemsCount": totalItemsCount,
|
|
|
|
|
"data": data!.toJson(),
|
|
|
|
|
"messageStatus": messageStatus,
|
|
|
|
|
"message": message,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Data {
|
|
|
|
|
Data({
|
|
|
|
|
this.accessToken,
|
|
|
|
|
this.refreshToken,
|
|
|
|
|
this.expiryDate,
|
|
|
|
|
this.userInfo,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
String? accessToken;
|
|
|
|
|
String? refreshToken;
|
|
|
|
|
DateTime? expiryDate;
|
|
|
|
|
UserInfo? userInfo;
|
|
|
|
|
|
|
|
|
|
factory Data.fromJson(Map<String, dynamic> json) => Data(
|
|
|
|
|
accessToken: json["accessToken"],
|
|
|
|
|
refreshToken: json["refreshToken"],
|
|
|
|
|
expiryDate: DateTime.parse(json["expiryDate"]),
|
|
|
|
|
userInfo: UserInfo.fromJson(json["userInfo"]),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
|
"accessToken": accessToken,
|
|
|
|
|
"refreshToken": refreshToken,
|
|
|
|
|
"expiryDate": expiryDate!.toIso8601String(),
|
|
|
|
|
"userInfo": userInfo!.toJson(),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class UserInfo {
|
|
|
|
|
UserInfo({
|
|
|
|
|
this.id,
|
|
|
|
|
this.userId,
|
|
|
|
|
this.firstName,
|
|
|
|
|
@ -52,66 +80,74 @@ class Data {
|
|
|
|
|
this.isVerified,
|
|
|
|
|
this.userRoles,
|
|
|
|
|
this.isCustomer,
|
|
|
|
|
this.isProvider,
|
|
|
|
|
this.isProviderDealership,
|
|
|
|
|
this.isDealershipUser,
|
|
|
|
|
this.providerId,
|
|
|
|
|
this.customerId,
|
|
|
|
|
this.dealershipId,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
int? id;
|
|
|
|
|
String? userId;
|
|
|
|
|
dynamic? firstName;
|
|
|
|
|
dynamic? lastName;
|
|
|
|
|
String? firstName;
|
|
|
|
|
String? lastName;
|
|
|
|
|
String? mobileNo;
|
|
|
|
|
String? email;
|
|
|
|
|
dynamic? userImageUrl;
|
|
|
|
|
String? userImageUrl;
|
|
|
|
|
int? roleId;
|
|
|
|
|
dynamic? roleName;
|
|
|
|
|
String? roleName;
|
|
|
|
|
bool? isEmailVerified;
|
|
|
|
|
List<dynamic>? serviceProviderBranch;
|
|
|
|
|
bool? isVerified;
|
|
|
|
|
List<dynamic>? userRoles;
|
|
|
|
|
bool? isCustomer;
|
|
|
|
|
bool? isProvider;
|
|
|
|
|
bool? isProviderDealership;
|
|
|
|
|
bool? isDealershipUser;
|
|
|
|
|
dynamic? providerId;
|
|
|
|
|
dynamic? customerId;
|
|
|
|
|
int? customerId;
|
|
|
|
|
dynamic? dealershipId;
|
|
|
|
|
|
|
|
|
|
factory Data.fromMap(Map<String, dynamic> json) => Data(
|
|
|
|
|
id: json["id"] == null ? null : json["id"],
|
|
|
|
|
userId: json["userID"] == null ? null : json["userID"],
|
|
|
|
|
firstName: json["firstName"],
|
|
|
|
|
lastName: json["lastName"],
|
|
|
|
|
mobileNo: json["mobileNo"] == null ? null : json["mobileNo"],
|
|
|
|
|
email: json["email"] == null ? null : json["email"],
|
|
|
|
|
userImageUrl: json["userImageUrl"],
|
|
|
|
|
roleId: json["roleID"] == null ? null : json["roleID"],
|
|
|
|
|
roleName: json["roleName"],
|
|
|
|
|
isEmailVerified: json["isEmailVerified"] == null ? null : json["isEmailVerified"],
|
|
|
|
|
serviceProviderBranch: json["serviceProviderBranch"] == null ? null : List<dynamic>.from(json["serviceProviderBranch"].map((x) => x)),
|
|
|
|
|
isVerified: json["isVerified"] == null ? null : json["isVerified"],
|
|
|
|
|
userRoles: json["userRoles"] == null ? null : List<dynamic>.from(json["userRoles"].map((x) => x)),
|
|
|
|
|
isCustomer: json["isCustomer"] == null ? null : json["isCustomer"],
|
|
|
|
|
isProvider: json["isProvider"] == null ? null : json["isProvider"],
|
|
|
|
|
providerId: json["providerID"],
|
|
|
|
|
customerId: json["customerID"],
|
|
|
|
|
);
|
|
|
|
|
factory UserInfo.fromJson(Map<String, dynamic> json) => UserInfo(
|
|
|
|
|
id: json["id"],
|
|
|
|
|
userId: json["userID"],
|
|
|
|
|
firstName: json["firstName"],
|
|
|
|
|
lastName: json["lastName"],
|
|
|
|
|
mobileNo: json["mobileNo"],
|
|
|
|
|
email: json["email"],
|
|
|
|
|
userImageUrl: json["userImageUrl"],
|
|
|
|
|
roleId: json["roleID"],
|
|
|
|
|
roleName: json["roleName"],
|
|
|
|
|
isEmailVerified: json["isEmailVerified"],
|
|
|
|
|
serviceProviderBranch: List<dynamic>.from(json["serviceProviderBranch"].map((x) => x)),
|
|
|
|
|
isVerified: json["isVerified"],
|
|
|
|
|
userRoles: List<dynamic>.from(json["userRoles"].map((x) => x)),
|
|
|
|
|
isCustomer: json["isCustomer"],
|
|
|
|
|
isProviderDealership: json["isProviderDealership"],
|
|
|
|
|
isDealershipUser: json["isDealershipUser"],
|
|
|
|
|
providerId: json["providerID"],
|
|
|
|
|
customerId: json["customerID"],
|
|
|
|
|
dealershipId: json["dealershipID"],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toMap() => {
|
|
|
|
|
"id": id == null ? null : id,
|
|
|
|
|
"userID": userId == null ? null : userId,
|
|
|
|
|
"firstName": firstName,
|
|
|
|
|
"lastName": lastName,
|
|
|
|
|
"mobileNo": mobileNo == null ? null : mobileNo,
|
|
|
|
|
"email": email == null ? null : email,
|
|
|
|
|
"userImageUrl": userImageUrl,
|
|
|
|
|
"roleID": roleId == null ? null : roleId,
|
|
|
|
|
"roleName": roleName,
|
|
|
|
|
"isEmailVerified": isEmailVerified == null ? null : isEmailVerified,
|
|
|
|
|
"serviceProviderBranch": serviceProviderBranch == null ? null : List<dynamic>.from(serviceProviderBranch!.map((x) => x)),
|
|
|
|
|
"isVerified": isVerified == null ? null : isVerified,
|
|
|
|
|
"userRoles": userRoles == null ? null : List<dynamic>.from(userRoles!.map((x) => x)),
|
|
|
|
|
"isCustomer": isCustomer == null ? null : isCustomer,
|
|
|
|
|
"isProvider": isProvider == null ? null : isProvider,
|
|
|
|
|
"providerID": providerId,
|
|
|
|
|
"customerID": customerId,
|
|
|
|
|
};
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
|
"id": id,
|
|
|
|
|
"userID": userId,
|
|
|
|
|
"firstName": firstName,
|
|
|
|
|
"lastName": lastName,
|
|
|
|
|
"mobileNo": mobileNo,
|
|
|
|
|
"email": email,
|
|
|
|
|
"userImageUrl": userImageUrl,
|
|
|
|
|
"roleID": roleId,
|
|
|
|
|
"roleName": roleName,
|
|
|
|
|
"isEmailVerified": isEmailVerified,
|
|
|
|
|
"serviceProviderBranch": List<dynamic>.from(serviceProviderBranch!.map((x) => x)),
|
|
|
|
|
"isVerified": isVerified,
|
|
|
|
|
"userRoles": List<dynamic>.from(userRoles!.map((x) => x)),
|
|
|
|
|
"isCustomer": isCustomer,
|
|
|
|
|
"isProviderDealership": isProviderDealership,
|
|
|
|
|
"isDealershipUser": isDealershipUser,
|
|
|
|
|
"providerID": providerId,
|
|
|
|
|
"customerID": customerId,
|
|
|
|
|
"dealershipID": dealershipId,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|