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.
car_customer_app/lib/models/user/register_user.dart

118 lines
3.9 KiB
Dart

// To parse this JSON data, do
//
// final user = userFromMap(jsonString);
import 'dart:convert';
RegisterUser userFromMap(String str) => RegisterUser.fromJson(json.decode(str));
String userToMap(RegisterUser data) => json.encode(data.toMap());
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: json["data"] == null ? null : Data.fromMap(json["data"]),
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
message: json["message"] == null ? null : json["message"],
);
Map<String, dynamic> toMap() => {
"totalItemsCount": totalItemsCount,
"data": data == null ? null : data!.toMap(),
"messageStatus": messageStatus == null ? null : messageStatus,
"message": message == null ? null : message,
};
}
class Data {
Data({
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.isProvider,
this.providerId,
this.customerId,
});
int? id;
String? userId;
dynamic? firstName;
dynamic? lastName;
String? mobileNo;
String? email;
dynamic? userImageUrl;
int? roleId;
dynamic? roleName;
bool? isEmailVerified;
List<dynamic>? serviceProviderBranch;
bool? isVerified;
List<dynamic>? userRoles;
bool? isCustomer;
bool? isProvider;
dynamic? providerId;
dynamic? customerId;
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"],
);
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,
};
}