AuthStore class
Base authentication store management service that keep tracks of the authenticated User/Admin model and its token.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isValid → bool
-
Loosely checks if the current AuthStore has valid auth data
(eg. whether the token is expired or not).
no setter
- model → dynamic
-
Returns the saved auth model (if any).
no setter
-
onChange
→ Stream<
AuthStoreEvent> -
Stream that gets triggered on each auth store change
(aka. on save() and clear() call).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token → String
-
Returns the saved auth token (if any).
no setter
Methods
-
clear(
) → void - Clears the previously stored token and model auth data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
String newToken, dynamic newModel) → void -
Saves the provided
newToken
andnewModel
auth data into the store. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited