Add phone number field to UserModel and update ProfileContent to display user phone number

This commit is contained in:
Van Leemput Dayron
2025-11-13 15:06:42 +01:00
parent 0971b4cb3d
commit 2ca30088ca
2 changed files with 244 additions and 72 deletions

View File

@@ -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,
};
}
}