AuthManager class

AuthManager class helps to creating and managing Firebase Auth user. Supported platforms: Android ,IOS , Web This class is singleton. You can call with AuthManager(). or with Provider. Be sure to ensureInitialized() is called.

Inheritance

Constructors

AuthManager()
factory

Properties

auth ↔ FirebaseAuth?
getter/setter pair
consumerKey String?
getter/setter pair
consumerSecretKey String?
getter/setter pair
googleAuth ↔ GoogleSignInAuthentication
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
indicatorOn bool
getter/setter pair
localeInfo String
sigleton instance
getter/setter pair
onAuthStateChanged Stream<User?>
Listen for user changes.
no setter
persistenceState ↔ Persistence
getter/setter pair
phoneCode String?
getter/setter pair
phoneCodeListen bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
user ↔ User?
getter/setter pair
verifyErrorMobile bool
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
checkIsUserExist() → User?
it returns current user
deleteUser() Future<AuthResponse>
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
ensureInitialized() Future<void>
initializer. Bu sure it is called.
getMessageFromErrorCode(String errorCode) String
firebase auth error code detector. it returns error messages.
googleSignInOnMobile() Future<AuthResponse>
call signInWithGoogle() instead.
googleSignInOnWeb() Future<AuthResponse>
call signInWithGoogle() instead.
linkCredentialWithEmailPass(String mail, String pass) Future<AuthResponse>
linkCredentialWithGoogle() Future<AuthResponse>
linkCredentialWithPhone(String number, BuildContext context) Future<AuthResponse>
if you call this, you need to call verifyLinkCredentialWithPhone after.
listenUser() → void
listen user changes and change user field. don't call this
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
phoneSignInOnMobile(String number, BuildContext context) Future<AuthResponse>
this method returns waiting response. if you call this, you need to call veriftPhoneSign after.
phoneSignInOnWeb(String number) Future<AuthResponse>
this method returns waiting response. if you call this, you need to call veriftPhoneSignForWeb after.
printAuthStats() → void
show to currenct user datas
reloadUser() Future<AuthResponse>
firebase auth do not listen for any changes. if you remove or block an account, it won't block instantly, call this when you need to be sure this user is fresh.
removeIndicator(BuildContext context) → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reSignWithCredential() Future<AuthResponse>
sign in with same credential. I do not recommend to use this function.
sendEmailVerification() Future<AuthResponse>
use "user.emailVerified" for only verified user situation.
sendPasswordResetEmail(String email) Future<AuthResponse?>
it will send a link to mail for reset password directly.
setLocale(String locale) → void
set locale for set popup language.
setPersistence(Persistence persistence) Future<void>
set persistence. Persistence.LOCAL Persistence.SESSION Persistence.NONE
setTwitterConsumerKeys(String consumerKey, String consumerSecretKey) → void
if you will use twitter sign in method. you need to initialize consumer keys. https://developer.twitter.com/en
signInAnonymous() Future<AuthResponse>
signInWithGoogle() Future<AuthResponse>
sign in and sign up with google.this can work with mobile and web
signInWithMailPass(String mail, String pass) Future<AuthResponse>
signInWithPhone(String number, BuildContext context) Future<AuthResponse>
it can cost much. be carefull
signOut() Future<void>
signUpWithMailPass(String mail, String pass) Future<AuthResponse>
toString() String
A string representation of this object.
inherited
verifyLinkCredentialWithPhone(String smsCode) Future<AuthResponse>
verify with sms to link account.
verifyPhoneSign(BuildContext context, String code) Future<AuthResponse>
complete verification for sign in. call this with sms code
verifyPhoneSignForWeb(String code) Future<AuthResponse>
complete verification for sign in. call this with sms code

Operators

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

Constants

PHONE_VERIFY_DELAY → const int