DSFirebaseAuthProvider class
Firebase authentication provider implementation for DartStream. This class integrates Firebase Authentication with the DartStream framework by implementing the DSAuthProvider interface.
Handles:
- User authentication via Firebase
- Token management
- Session tracking
- Event handling
- Error mapping
Constructors
- DSFirebaseAuthProvider({required String projectId, required String privateKeyPath, required String apiKey})
-
Factory method to create a new instance of the Firebase authentication provider
factory
Properties
- apiKey → String
-
Path to the Firebase private key file
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- privateKeyPath → String
-
Firebase private key file path
final
- projectId → String
-
Firebase project identifier
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createAccount(
String email, String password, {String? displayName}) → Future< void> -
creates a new user account with email and password
override
-
deleteUser(
) → Future< void> - Deletes the current user account
-
dispose(
) → void - Cleans up resources used by the provider
-
getCurrentUser(
) → Future< DSAuthUser> -
Retrieves the currently authenticated user
override
-
getUser(
String userId) → Future< DSAuthUser> -
Retrieves user information by user ID
override
-
initialize(
Map< String, dynamic> config) → Future<void> -
Initializes the Firebase authentication provider and its dependencies
override
-
isEmailVerified(
) → Future< bool> - Checks if the current user's email is verified
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onLoginSuccess(
DSAuthUser user) → Future< void> -
Handles successful login events
override
-
onLogout(
) → Future< void> -
Handles successful logout events
override
-
refreshToken(
String refreshToken) → Future< String> -
Refreshes an authentication token
override
-
sendEmailVerification(
) → Future< void> - Sends email verification to the current user
-
sendPasswordResetEmail(
String email) → Future< void> - Sends a password reset email to the user
-
signIn(
String username, String password) → Future< void> -
Signs in a user with username/email and password
override
-
signOut(
) → Future< void> -
Signs out the current user and cleans up sessions
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateEmail(
String newEmail) → Future< void> - Updates the current user's email address
-
updatePassword(
String newPassword) → Future< void> - Updates the current user's password
-
updateProfile(
{String? displayName, String? photoURL}) → Future< void> - Updates the current user's profile information
-
verifyToken(
[String? token]) → Future< bool> -
Verifies the validity of an authentication token
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited