AutologinPlatform class abstract
The interface that implementations of autologin must implement.
Platform implementations should extend this class rather than implement it
as Autologin
. Extending this class (using extends
) ensures that the
subclass will get the default implementation, while platform implementations
that implements
this interface will be broken by newly added
AutologinPlatform methods.
- Inheritance
-
- Object
- PlatformInterface
- AutologinPlatform
- Implementers
Constructors
- AutologinPlatform()
- Constructs a AutologinPlatform.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isPlatformSupported
→ Future<
bool> -
Returns
true
when the current platform is supported.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
deleteLoginToken(
) → Future< bool> -
Delete the saved login token, returns
true
when successful. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
performCompatibilityChecks(
) → Future< Compatibilities> - Return the Compatibilities which depends on the platform or the browser in case of web.
-
requestCredentials(
) → Future< Credential?> -
Returns the saved Credential when set by saveCredentials or is
null
when not found. -
requestLoginToken(
) → Future< String?> -
Returns the saved token which was set by saveLoginToken or is
null
when not found. This can be a refresh token or anything else which you can use to identify the user. You should validate that this token is still valid before authenticating the user. Depending on your use case asking for a second factor would be a good idea. -
saveCredentials(
Credential credential) → Future< bool> -
Returns
true
when the Credentials could be saved, otherwisefalse
. -
saveLoginToken(
String token) → Future< bool> -
Returns
true
when thetoken
could be saved, otherwisefalse
. This token is intended to be synchronized by the platform you are using. This can be a refresh token or anything else which you can use to identify the user. For security reasons you should not store credentials. -
setup(
{String? domain, String? appId, String? appName}) → void -
Depending on your target platforms you need to setup attentional data. For
iOS and MacOS the
domain
is required to ask the operating system for credentials for that domain. For Linux is anappId
anappName
required to select the credentials of your app (the name is in fact just for the label in the password manager). If you don't target those platforms you can omit this call. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ AutologinPlatform
-
The default instance of AutologinPlatform to use.
getter/setter pair