AuthService class
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearAuth(
) → Future< void> - Clear stored auth
-
getReqId(
) → Future< String?> - Returns reqId from prefs (or null)
-
getToken(
) → Future< String?> - Returns token from prefs (or null)
-
hasValidAuth(
) → Future< bool> - Convenience: returns whether there's a valid saved token+reqId
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restoreToAppState(
) → Future< bool> - Reads token+reqId from prefs, validates token age, and if valid, restores them into AppStateProvider. Returns true if restore succeeded (token present & valid and reqId present)
-
saveAuth(
{required String token, String? reqId}) → Future< void> - Persist token + reqId + timestamp
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → AuthService
-
final