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.
154 lines
3.9 KiB
Dart
154 lines
3.9 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final registerUser = registerUserFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
RegisterUser registerUserFromJson(String str) => RegisterUser.fromJson(json.decode(str));
|
|
|
|
String registerUserToJson(RegisterUser data) => json.encode(data.toJson());
|
|
|
|
class RegisterUser {
|
|
RegisterUser({
|
|
this.totalItemsCount,
|
|
this.data,
|
|
this.messageStatus,
|
|
this.message,
|
|
});
|
|
|
|
dynamic? totalItemsCount;
|
|
Data? data;
|
|
int? messageStatus;
|
|
String? message;
|
|
|
|
factory RegisterUser.fromJson(Map<String, dynamic> json) => RegisterUser(
|
|
totalItemsCount: json["totalItemsCount"],
|
|
data: Data.fromJson(json["data"]),
|
|
messageStatus: json["messageStatus"],
|
|
message: json["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,
|
|
this.lastName,
|
|
this.mobileNo,
|
|
this.email,
|
|
this.userImageUrl,
|
|
this.roleId,
|
|
this.roleName,
|
|
this.isEmailVerified,
|
|
this.serviceProviderBranch,
|
|
this.isVerified,
|
|
this.userRoles,
|
|
this.isCustomer,
|
|
this.isProviderDealership,
|
|
this.isDealershipUser,
|
|
this.providerId,
|
|
this.customerId,
|
|
this.dealershipId,
|
|
});
|
|
|
|
int? id;
|
|
String? userId;
|
|
String? firstName;
|
|
String? lastName;
|
|
String? mobileNo;
|
|
String? email;
|
|
String? userImageUrl;
|
|
int? roleId;
|
|
String? roleName;
|
|
bool? isEmailVerified;
|
|
List<dynamic>? serviceProviderBranch;
|
|
bool? isVerified;
|
|
List<dynamic>? userRoles;
|
|
bool? isCustomer;
|
|
bool? isProviderDealership;
|
|
bool? isDealershipUser;
|
|
dynamic? providerId;
|
|
int? customerId;
|
|
dynamic? dealershipId;
|
|
|
|
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> 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,
|
|
};
|
|
}
|