mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
change_password
This commit is contained in:
@ -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'],
|
||||
);
|
||||
|
Reference in New Issue
Block a user