Auth réparée
This commit is contained in:
@ -5,27 +5,38 @@ class UserProvider extends ChangeNotifier {
|
||||
String? _firstName;
|
||||
String? _lastName;
|
||||
String? _role;
|
||||
String? _profilePictureUrl;
|
||||
// String? _profilePictureUrl;
|
||||
String? _email;
|
||||
String? _phoneNumber;
|
||||
// String? _phoneNumber;
|
||||
|
||||
String? get uid => _uid;
|
||||
String? get firstName => _firstName;
|
||||
String? get lastName => _lastName;
|
||||
String? get role => _role;
|
||||
String? get profilePhotoUrl => _profilePictureUrl;
|
||||
// String? get profilePhotoUrl => _profilePictureUrl;
|
||||
String? get email => _email;
|
||||
String? get phoneNumber => _phoneNumber;
|
||||
// String? get phoneNumber => _phoneNumber;
|
||||
|
||||
// void setUserData(Map<String, dynamic> userData, String uid) {
|
||||
// _uid = uid;
|
||||
// _firstName = userData['firstName'];
|
||||
// _lastName = userData['lastName'];
|
||||
// _role = userData['role'] ?? 'USER'; // Default role if not provided
|
||||
// // _profilePictureUrl = userData['profilePhotoUrl'];
|
||||
// _email = userData['email'];
|
||||
// // _phoneNumber = userData['phoneNumber'];
|
||||
// notifyListeners(); // Notify listeners that state has changed
|
||||
// }
|
||||
void setUserData(Map<String, dynamic> userData, String uid) {
|
||||
_uid = uid;
|
||||
_firstName = userData['firstName'];
|
||||
_lastName = userData['lastName'];
|
||||
_role = userData['role'] ?? 'USER'; // Default role if not provided
|
||||
_profilePictureUrl = userData['profilePhotoUrl'];
|
||||
_email = userData['email'];
|
||||
_phoneNumber = userData['phoneNumber'];
|
||||
notifyListeners(); // Notify listeners that state has changed
|
||||
|
||||
print("User data set: $_firstName $_lastName ($_email)");
|
||||
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void clearUserData() {
|
||||
@ -33,9 +44,9 @@ class UserProvider extends ChangeNotifier {
|
||||
_firstName = null;
|
||||
_lastName = null;
|
||||
_role = null;
|
||||
_profilePictureUrl = null;
|
||||
// _profilePictureUrl = null;
|
||||
_email = null;
|
||||
_phoneNumber = null;
|
||||
// _phoneNumber = null;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user