SmartApiHooks class

Global UI hooks that SmartApiClient fires instead of depending on any concrete loader/snackbar/toast package.

Wire these once in main() (see the package README), and every call made through SmartApiClient.instance will drive your app's own loading indicator, message UI, session-expiry navigation and no-internet retry flow automatically.

Constructors

SmartApiHooks()

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

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

Static Properties

hasNetworkOverride ↔ Future<bool> Function()?
Override the built-in connectivity check used before every request.
getter/setter pair
hideLoader ↔ VoidCb?
Called after a request finishes (success or failure).
getter/setter pair
onNoInternet ↔ void Function(VoidCb retry)?
Called when a request fails because there's no internet connection. The supplied VoidCb is a retry callback — call it to re-fire the exact request that failed.
getter/setter pair
onSessionExpired ↔ VoidCb?
Called when a request comes back with a 401/403 status code, so you can navigate to your sign-in screen and clear any stored session.
getter/setter pair
showLoader ↔ VoidCb?
Called right before a request starts (when showLoader is true).
getter/setter pair
showMessage ↔ MessageCb?
Called with a user-facing message whenever a request fails, or whenever you want to surface a message yourself.
getter/setter pair