76 lines
2.1 KiB
Dart
76 lines
2.1 KiB
Dart
class UserModel {
|
|
final String id;
|
|
final String uniqueId;
|
|
final String name;
|
|
final String email;
|
|
final String mobileNumber;
|
|
final String designation;
|
|
final String userType;
|
|
final String? principalDistributer;
|
|
final String? addedBy;
|
|
final String? kyc;
|
|
final String? fcmToken;
|
|
final String createdAt;
|
|
final String updatedAt;
|
|
final String? mappedSC;
|
|
|
|
UserModel({
|
|
required this.id,
|
|
required this.uniqueId,
|
|
required this.name,
|
|
required this.email,
|
|
required this.mobileNumber,
|
|
required this.designation,
|
|
required this.userType,
|
|
this.principalDistributer,
|
|
this.addedBy,
|
|
this.kyc,
|
|
this.fcmToken,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.mappedSC,
|
|
});
|
|
|
|
factory UserModel.fromJson(Map<String, dynamic> json) {
|
|
return UserModel(
|
|
id: json['_id'],
|
|
uniqueId: json['uniqueId'],
|
|
name: json['name'],
|
|
email: json['email'],
|
|
mobileNumber: json['mobile_number'],
|
|
designation: json['designation'],
|
|
userType: json['userType'],
|
|
principalDistributer: json['principal_distributer'],
|
|
addedBy: json['addedBy'],
|
|
kyc: json['kyc'],
|
|
fcmToken: json['fcm_token'],
|
|
createdAt: json['createdAt'],
|
|
updatedAt: json['updatedAt'],
|
|
mappedSC: json['mappedSC'],
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'_id': id,
|
|
'uniqueId': uniqueId,
|
|
'name': name,
|
|
'email': email,
|
|
'mobile_number': mobileNumber,
|
|
'designation': designation,
|
|
'userType': userType,
|
|
'principal_distributer': principalDistributer,
|
|
'addedBy': addedBy,
|
|
'kyc': kyc,
|
|
'fcm_token': fcmToken,
|
|
'createdAt': createdAt,
|
|
'updatedAt': updatedAt,
|
|
'mappedSC': mappedSC,
|
|
};
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'UserModel{id: $id, uniqueId: $uniqueId, name: $name, email: $email, mobileNumber: $mobileNumber, designation: $designation, userType: $userType, principalDistributer: $principalDistributer, addedBy: $addedBy, kyc: $kyc, fcmToken: $fcmToken, createdAt: $createdAt, updatedAt: $updatedAt, mappedSC: $mappedSC}';
|
|
}
|
|
} |