LocalAuthAdapter class

Authentication adapter that stores data on the local terminal.

Use for application development that does not require external storage of values.

For mobile and desktop, data is encrypted and stored in external files, and for the Web, data is encrypted and stored in LocalStorage.

ローカル端末にデータを保存する認証アダプター。

外部に値を保存する必要のないアプリ開発に利用します。

モバイルやデスクトップは外部ファイルに暗号化してデータが保存されWebの場合はLocalStorageに暗号化されデータが保存されます。

Inheritance
Available Extensions

Constructors

LocalAuthAdapter({AuthDatabase? database, String? initialUserId, List<AuthInitialValue>? initialValue})
Authentication adapter that stores data on the local terminal.
const

Properties

accessToken Future<String?>
Returns the access token used during sign-in and authentication.
no setteroverride
activeProviderIds List<String>?
Please return a list of IDs of authenticated providers.
no setteroverride
database AuthDatabase
Designated database.
no setter
hashCode int
The hash code for this object.
no setteroverride
isAnonymously bool
For anonymous or guest authentication, return true.
no setteroverride
isSignedIn bool
If you are signed in, return true.
no setteroverride
isVerified bool
Return true if the registration has been authenticated.
no setteroverride
isWaitingConfirmation bool
Return true if confirmSignIn or confirmChange is required.
no setteroverride
refreshToken String?
Returns a refresh token used during sign-in and authentication.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userEmail String?
Make sure to return the user's email address.
no setteroverride
userId String?
When signing in, make sure to return the user ID on the authentication platform.
no setteroverride
userName String?
Make sure to return the user name.
no setteroverride
userPhoneNumber String?
Be sure to return the user's phone number.
no setteroverride
userPhotoURL String?
Please make sure to return the URL of the user's icon image.
no setteroverride

Methods

change({required ChangeAuthProvider provider, required VoidCallback onUserStateChanged}) Future<void>
Used to change the registered information.
override
confirmChange({required ConfirmChangeAuthProvider provider, required VoidCallback onUserStateChanged}) Future<void>
If you change with ChangePhoneNumberAuthProvider, for example, you need to check the authentication code you received from an email or SMS. In that case, use this method to finalize the change.
override
confirmSignIn({required ConfirmSignInAuthProvider provider, required VoidCallback onUserStateChanged}) Future<void>
If you signIn with EmailLinkSignInAuthProvider or SmsSignInAuthProvider, you need to check the authentication code received from email or SMS. In that case, use this method to finalize the sign-in.
override
create({required CreateAuthProvider provider, required VoidCallback onUserStateChanged}) Future<String?>
Register users by passing a class inheriting from CreateAuthProvider in provider.
override
delete({required VoidCallback onUserStateChanged}) Future<void>
Deletes already registered users.
override
dispose() → void
Discard the adapter.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reauth({required ReAuthProvider provider}) Future<bool>
If you are signed in, this is used to perform an authentication check just before changing information for authentication (e.g., email address).
override
register({required RegisterAuthProvider provider, required VoidCallback onUserStateChanged}) Future<void>
Register a user by passing a class inheriting from RegisterAuthProvider in provider.
override
reset({required ResetAuthProvider provider}) Future<void>
Used to reset the password.
override
signIn({required SignInAuthProvider provider, required VoidCallback onUserStateChanged}) Future<void>
Sign-in is performed by passing a class inheriting from SignInAuthProvider as provider.
override
signOut({required VoidCallback onUserStateChanged}) Future<void>
Sign out if you are already signed in.
override
toString() String
A string representation of this object.
inherited
tryRestoreAuth({bool retryWhenTimeout = false, required VoidCallback onUserStateChanged}) Future<bool>
Running the application at startup will automatically re-authenticate the user.
override
verify({required VerifyAuthProvider provider, required VoidCallback onUserStateChanged}) Future<void>
Used to prove possession of the e-mail address.
override

Operators

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

Static Properties

sharedDatabase AuthDatabase
A common database throughout the application.
final