RequestOptions<T> class
Options for configuring the behavior of useRequest.
Constructors
- RequestOptions.new({bool manual = false, T? initialData, Duration? debounceInterval, Duration? throttleInterval, Duration? pollingInterval, bool pollingWhenHidden = true, Duration? loadingDelay, int retryCount = 0, String? cacheKey, void onSuccess(T data)?, void onError(Object error)?, void onFinally()?})
-
const
Properties
- cacheKey → String?
-
The key to use for caching the data.
final
- debounceInterval → Duration?
-
The debounce interval for the request.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialData → T?
-
The initial data to use before the request has completed.
final
- loadingDelay → Duration?
-
The delay before the loading state is set to true.
final
- manual → bool
-
If true, the request will not be run automatically when the widget is built.
You need to call
run()
manually.final - onError → void Function(Object error)?
-
A callback that is called when the request fails.
final
- onFinally → void Function()?
-
A callback that is called when the request is finished (either success or error).
final
- onSuccess → void Function(T data)?
-
A callback that is called when the request succeeds.
final
- pollingInterval → Duration?
-
The polling interval for the request.
If set, the request will be re-run periodically.
final
- pollingWhenHidden → bool
-
If true, polling will continue even when the widget is not visible.
final
- retryCount → int
-
The number of times to retry the request if it fails.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- throttleInterval → Duration?
-
The throttle interval for the request.
final
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