change_password

This commit is contained in:
mohammad
2024-12-30 16:51:35 +03:00
parent 33d2bbc91f
commit 8be05fbd91
16 changed files with 864 additions and 33 deletions

View File

@ -14,6 +14,7 @@ class UserModel {
final bool? isEmailVerified;
final String? regionName;
final String? timeZone;
final String? regionUuid;
final bool? isAgreementAccepted;
UserModel({
@ -24,10 +25,10 @@ class UserModel {
required this.profilePicture,
required this.phoneNumber,
required this.isEmailVerified,
required this.regionUuid,
required this.isAgreementAccepted,
required this.regionName, // Add this line
required this.timeZone, // Add this line
});
factory UserModel.fromJson(Map<String, dynamic> json) {
@ -42,21 +43,23 @@ class UserModel {
isAgreementAccepted: json['isAgreementAccepted'],
regionName: json['region']?['regionName'], // Extract regionName
timeZone: json['timeZone']?['timeZoneOffset'], // Extract regionName
regionUuid: json['region']?['uuid'],
);
}
//uuid to json
//from token
factory UserModel.fromToken(Token token) {
factory UserModel.fromToken(Token token) {
Map<String, dynamic> tempJson = Token.decodeToken(token.accessToken);
return UserModel(
uuid: tempJson['uuid'].toString(),
email: tempJson['email'],
lastName: tempJson['lastName'],
firstName:tempJson['firstName'] ,
firstName: tempJson['firstName'],
profilePicture: UserModel.decodeBase64Image(tempJson['profilePicture']),
phoneNumber: null,
isEmailVerified: null,
isAgreementAccepted: null,
regionUuid: null,
regionName: tempJson['region']?['regionName'],
timeZone: tempJson['timezone']?['timeZoneOffset'],
);