AuthFailureNotifier class

A broadcast notifier that signals an authentication failure to the rest of the app.

AuthFailureInterceptor calls notify when a Dio request fails with an UnauthorizedException. Listeners — typically AuthRepository — subscribe to stream to force a logout and redirect to the login screen.

Must be disposed when the app is shutting down or the owner is destroyed. After dispose is called, further calls to notify are silently ignored.

See also:

Constructors

AuthFailureNotifier()
Creates an auth failure notifier.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<void>
A broadcast stream that emits a void event each time an authentication failure is detected.
no setter

Methods

dispose() Future<void>
Closes the underlying stream controller and releases resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify() → void
Emits an authentication failure event to all current listeners.
toString() String
A string representation of this object.
inherited

Operators

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