AuthenticationController<T extends Object> class

Manages the AuthenticationProvider

Contains the current AuthenticationState and streams for changes in data

Constructors

AuthenticationController(BuildContext context, {Future<AuthenticationState> initialize() = _di, AuthenticationState? initialState, dynamic onAuthenticate(BuildContext context, {dynamic data, required T user}) = _doa, dynamic onDeauthenticate(BuildContext context, {dynamic data}) = _dod})

Properties

context BuildContext
Root build context of AuthenticationProvider
no setter
hashCode int
The hash code for this object.
no setterinherited
onAuthenticate ↔ dynamic Function(BuildContext context, {dynamic data, required T user})
Called when authenticate is invoked with the root BuildContext
getter/setter pair
onDeauthenticate ↔ dynamic Function(BuildContext context, {dynamic data})
Called when deauthenticate is invoked with the root BuildContext
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state AuthenticationState
Current AuthenticationState of the app
getter/setter pair
stateChanged Stream
Streams a new AuthenticationState when the state is changed.
no setter

Methods

authenticate({required T user, dynamic data}) → void
Call to change state to Authenticated
deauthenticate({dynamic data}) → void
Call to change state to Unauthenticated
dispose() → void
Should be called whenever the widget that created this AuthenticationController instance is disposed of.
initialize() → void
Called the first time the widget loads
loading({dynamic data}) → void
Call to change state to Loading
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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