mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-17 02:25:16 +00:00
profile
This commit is contained in:
@ -4,34 +4,42 @@ class UserModel {
|
||||
static String userUuidKey = 'userUuid';
|
||||
final String? uuid;
|
||||
final String? email;
|
||||
final String? name;
|
||||
final String? photoUrl;
|
||||
|
||||
final String? firstName;
|
||||
final String? lastName;
|
||||
final String? profilePicture;
|
||||
final String? phoneNumber;
|
||||
|
||||
final bool? isEmailVerified;
|
||||
|
||||
final String? regionName;
|
||||
final String? timeZone;
|
||||
final bool? isAgreementAccepted;
|
||||
|
||||
UserModel({
|
||||
required this.uuid,
|
||||
required this.email,
|
||||
required this.name,
|
||||
required this.photoUrl,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
required this.profilePicture,
|
||||
required this.phoneNumber,
|
||||
required this.isEmailVerified,
|
||||
required this.isAgreementAccepted,
|
||||
required this.regionName, // Add this line
|
||||
required this.timeZone, // Add this line
|
||||
|
||||
});
|
||||
|
||||
factory UserModel.fromJson(Map<String, dynamic> json) {
|
||||
return UserModel(
|
||||
uuid: json['id'],
|
||||
uuid: json['uuid'],
|
||||
email: json['email'],
|
||||
name: json['name'],
|
||||
photoUrl: json['photoUrl'],
|
||||
firstName: json['firstName'],
|
||||
lastName: json['lastName'],
|
||||
profilePicture: json['profilePicture'],
|
||||
phoneNumber: json['phoneNumber'],
|
||||
isEmailVerified: json['isEmailVerified'],
|
||||
isAgreementAccepted: json['isAgreementAccepted'],
|
||||
regionName: json['region']?['regionName'], // Extract regionName
|
||||
timeZone: json['timeZone']?['timeZoneOffset'], // Extract regionName
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -44,11 +52,16 @@ class UserModel {
|
||||
return UserModel(
|
||||
uuid: tempJson['uuid'].toString(),
|
||||
email: tempJson['email'],
|
||||
name: null,
|
||||
photoUrl: null,
|
||||
lastName: tempJson['lastName'],
|
||||
firstName:tempJson['firstName'] ,
|
||||
profilePicture: tempJson['profilePicture'],
|
||||
phoneNumber: null,
|
||||
isEmailVerified: null,
|
||||
isAgreementAccepted: null,
|
||||
regionName: tempJson['region']?['regionName'],
|
||||
timeZone: tempJson['timezone']?['timeZoneOffset'],
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -56,8 +69,9 @@ class UserModel {
|
||||
return {
|
||||
'id': uuid,
|
||||
'email': email,
|
||||
'name': name,
|
||||
'photoUrl': photoUrl,
|
||||
'lastName': lastName,
|
||||
'firstName': firstName,
|
||||
'photoUrl': profilePicture,
|
||||
'phoneNumber': phoneNumber,
|
||||
'isEmailVerified': isEmailVerified,
|
||||
'isAgreementAccepted': isAgreementAccepted,
|
||||
|
Reference in New Issue
Block a user