AuthService class
Manages user authentication and profile operations using Firebase.
Provides methods for signing up, signing in, signing out, and managing user profiles, including FCM token storage for notifications.
- Available extensions
Constructors
Properties
- currentUser → User?
-
Gets the currently authenticated Firebase user.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fetchUserProfile(
) → Future< UserModel?> -
Available on AuthService, provided by the ProfileManagement extension
Fetches the current user's profile data from Firestore. -
getUserType(
String uid) → Future< UserType?> - Retrieves the user type for a given user ID from Firestore.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
saveFcmToken(
String userId) → Future< void> - Saves the Firebase Cloud Messaging (FCM) token for a user.
-
signIn(
{required String email, required String password}) → Future< UserModel?> - Signs in a user with Firebase Authentication and retrieves their profile.
-
signOut(
) → Future< void> - Signs out the current user from Firebase Authentication.
-
signUp(
{required String email, required String password, required String fullName, required UserType userType, String? phoneNumber, String? address, String? farmName, String? farmLocation}) → Future< UserModel?> - Registers a new user with Firebase Authentication and Firestore.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateUserProfile(
UserModel profile) → Future< void> -
Available on AuthService, provided by the ProfileManagement extension
Updates a user's profile data in Firestore.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited