Add phone number field to UserModel and update ProfileContent to display user phone number
This commit is contained in:
@@ -75,16 +75,20 @@ class UserModel {
|
||||
/// Platform used for authentication (e.g., 'google', 'apple', 'email').
|
||||
final String? authMethod;
|
||||
|
||||
/// User's phone number (optional).
|
||||
final String? phoneNumber;
|
||||
|
||||
/// Creates a new [UserModel] instance.
|
||||
///
|
||||
/// [id], [email], and [prenom] are required fields.
|
||||
/// [nom] and [authMethod] are optional and can be null.
|
||||
/// [nom], [authMethod], and [phoneNumber] are optional and can be null.
|
||||
UserModel({
|
||||
required this.id,
|
||||
required this.email,
|
||||
required this.prenom,
|
||||
this.nom,
|
||||
this.authMethod,
|
||||
this.phoneNumber,
|
||||
});
|
||||
|
||||
/// Creates a [UserModel] instance from a JSON map.
|
||||
@@ -98,6 +102,7 @@ class UserModel {
|
||||
prenom: json['prenom'] ?? 'Voyageur',
|
||||
nom: json['nom'],
|
||||
authMethod: json['authMethod'] ?? json['platform'],
|
||||
phoneNumber: json['phoneNumber'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -111,6 +116,7 @@ class UserModel {
|
||||
'prenom': prenom,
|
||||
'nom': nom,
|
||||
'authMethod': authMethod,
|
||||
'phoneNumber': phoneNumber,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user