CacheOptions class
Constructors
- CacheOptions({bool shouldCache = false, Duration cacheDuration = const Duration(minutes: 5)})
-
const
Properties
- cacheDuration → Duration
-
How long to cache the response.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldCache → bool
-
Whether to cache the response.
final
Methods
-
copyWith(
{bool? shouldCache, Duration? cacheDuration}) → CacheOptions -
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
Constants
- defaultOptions → const CacheOptions
- longApiCache → const CacheOptions
- Predefined options for requests with a long cache duration (1 hour).
- mediumApiCache → const CacheOptions
- Predefined options for requests with a medium cache duration (15 minutes).
- noApiCache → const CacheOptions
- Predefined options for requests that should never be cached.
- shortApiCache → const CacheOptions
- Predefined options for requests with a short cache duration (1 minute).