Auth class

Constructors

Auth({FirebaseOptions? firebaseOptions, SignInOption signInOption = SignInOption.standard, List<String> scopes = const <String>[], String? hostedDomain, void listen(GoogleSignInAccount? account)?, void listener(User? user)?, List<String>? facebookPermissions, String? key, String? secret})
factory

Properties

accessToken String
no setter
authTime DateTime
no setter
claims Map
no setter
displayName String
no setter
email String
no setter
eventErrors bool
no setter
expirationTime DateTime
no setter
facebookAuth FacebookAuth?
no setter
firebaseAuth FirebaseAuth?
no setter
googleSignIn GoogleSignIn?
no setter
googleUser GoogleSignInAccount?
The currently signed in account, or null if the user is signed out.
no setter
hasError bool
no setter
hashCode int
The hash code for this object.
no setterinherited
idToken String
no setter
idTokenResult IdTokenResult?
no setter
inError bool
no setter
isAnonymous bool
no setter
isEmailVerified bool
no setter
isNewUser bool
no setter
issuedAtTime DateTime
no setter
listen GoogleListener
no getter
listener FireBaseListener
no getter
message String
no setter
phoneNumber String
no setter
photoUrl String
no setter
providerId String
no setter
result UserCredential?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signInProvider String
no setter
uid String
getter/setter pair
user User?
no setter
userInfo AdditionalUserInfo?
no setter
username String
no setter

Methods

addListen(GoogleListener? f) bool
Add a Google listener
addListener(FireBaseListener? f) bool
Add a Firebase Listener
alreadyLoggedIn([GoogleSignInAccount? googleUser]) bool
Already logged in as a Firebase user
applyActionCode(String? code) Future<void>
Applies a verification code sent to the user by email or other out-of-band mechanism.
checkActionCode(String? code) Future<ActionCodeInfo>?
Checks a verification code sent to the user by email or other out-of-band mechanism.
confirmPasswordReset({String? code, String? newPassword}) Future<void>
Completes the password reset process, given a confirmation code and new password.
createUserWithEmailAndPassword({required String email, required String password, void listener(User? user)?}) Future<bool>
Tries to create a new user account with the given email address and password.
currentUser() User?
Returns the currently signed-in User or null if there is none.
delete() Future<bool>
Deletes the current user (also signs out the user).
disconnect() Future<void>
Disconnects the current user from the app and revokes previous authentication.
dispose() Future<void>
Important to call this function when terminating the you app.
fetchSignInMethodsForEmail({required String email}) Future<List<String>?>
Returns a list of sign-in methods that can be used to sign in a given user (identified by its main email address).
getError() Exception?
Get the last error but clear it.
getEventError() List<Exception>?
getIdToken({bool refresh = false}) Future<IdTokenResult?>
Obtains the id token result for the current user, forcing a refresh if desired.
getRedirectResult() Future<UserCredential>
Returns a UserCredential from the redirect-based sign-in flow.
googleListener(GoogleListener f) bool
idTokenChanges() Stream<User?>
Notifies about changes to the user's sign-in state (such as sign-in or sign-out) and also token refresh events.
initAsync() Future<bool>
isLoggedIn() bool
FireBase Logged in.
isSignedIn() bool
Google Signed in.
Checks if an incoming link is a sign-in with email link.
linkWithCredential(AuthCredential credential) Future<UserCredential?>
Associates a user account from a third-party identity provider with this user and returns additional identity provider data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reauthenticateWithCredential(AuthCredential credential) Future<UserCredential?>
Renews the user’s authentication tokens by validating a fresh set of credentials supplied by the user and returns additional identity provider data.
reload() Future<void>
Manually refreshes the data of the current user (for example, attached providers, display name, and so on).
removeListen(GoogleListener? f) bool
removeListener(FireBaseListener f) bool
sendEmailVerification() Future<void>
Initiates email verification for the user.
sendPasswordResetEmail({required String email}) Future<bool>
Triggers the Firebase Authentication backend to send a password-reset email to the given email address, which must correspond to an existing user of your app.
setError(Object ex) → void
setLanguageCode(String language) Future<void>
Sets the user-facing language code for auth operations that can be internationalized, such as sendEmailVerification. This language code should follow the conventions defined by the IETF in BCP47.
setSettings({bool? appVerificationDisabledForTesting, String? userAccessGroup}) Future<void>
Updates the current instance with the provided settings.
signedInFirebase() bool
True if signed into Firebase
signedInGoogle() bool
True if signed into a Google account
signInAnonymously({void listener(User? user)?}) Future<bool>
Asynchronously creates and becomes an anonymous user.
signInFacebook({List<String>? permissions, void listener(User? user)?}) Future<bool>
SignIn using Facebook.
signInGoogle({void listen(GoogleSignInAccount? user)?, bool firebaseUser = true}) Future<bool>
Log into Firebase using Google
signInSilently({String? key, String? secret, void listener(User? user)?, void listen(GoogleSignInAccount? user)?, bool suppressErrors = true}) Future<bool>
Attempt to sign in with one of the 'online' accounts: Google, Facebook and Twitter.
signInTwitter({String? key, String? secret, void listener(User? user)?}) Future<bool>
SignIn using Twitter.
signInWithCredential({required AuthCredential credential, void listener(User? user)?}) Future<bool>
Asynchronously signs in to Firebase with the given 3rd-party credentials (e.g. a Facebook login Access Token, a Google ID Token/Access Token pair, etc.) and returns additional identity provider data.
signInWithCustomToken({required String token, void listener(User? user)?}) Future<bool>
Tries to sign in a user with a given Custom Token token.
signInWithEmailAndPassword({required String email, required String password, void listener(User? user)?}) Future<bool>
Tries to sign in a user with the given email address and password.
signInWithFacebook({List<String>? permissions, void listener(User? user)?, bool? silently}) Future<bool>
Sign into Firebase by logging into Facebook
signInWithFacebookSilently({List<String>? permissions, void listener(User? user)?}) Future<bool>
Silently Sign into Firebase with Facebook
signInWithGoogle({void listen(GoogleSignInAccount? event)?, Function? onError, void onDone()?, bool cancelOnError = false, bool? popup}) Future<bool>
Force the user to interactively sign in
signInWithGoogleSilently({void listen(GoogleSignInAccount? user)?, bool suppressErrors = true}) Future<bool>
Attempts to sign in a previously authenticated user without interaction.
signInWithTwitter({String? key, String? secret, void listener(User? user)?, bool silently = false, bool forceLogin = false, bool suppressAsserts = false}) Future<bool>
Sign into Firebase by logging into Twitter
signInWithTwitterSilently({String? key, String? secret, void listener(User? user)?}) Future<bool>
Silently Sign into Firebase with Twitter
signOut() Future<void>
Signs out the current user and clears it from the disk cache.
toString() String
A string representation of this object.
inherited
unlinkFromProvider(String provider) Future<void>
Detaches the provider account from the current user.
updateEmail(String email) Future<void>
Updates the email address of the user.
updatePassword(String password) Future<void>
Updates the password of the user.
updatePhoneNumber(AuthCredential credential) Future<void>
updatePhoneNumberCredential(AuthCredential credential) Future<void>
Updates the phone number of the user.
updateProfile(UserInfo userUpdateInfo) Future<void>
Updates the user profile information.
userChanges() Stream<User?>
Notifies about changes to any user updates.

Operators

operator ==(Object other) bool
The equality operator.
inherited