TaskCachePolicy<T> class

Configuration for caching a task's result.

Constructors

TaskCachePolicy({String? key, required Duration ttl, required Map<String, dynamic> toJson(T value), required T fromJson(Map<String, dynamic> json)})
Creates a caching policy.
const

Properties

fromJson → T Function(Map<String, dynamic> json)
Function to deserialize the task result from JSON.
final
hashCode int
The hash code for this object.
no setterinherited
key String?
Unique key for the cached result. If null, the task ID is used.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toJson Map<String, dynamic> Function(T value)
Function to serialize the task result to JSON.
final
ttl Duration
Time-to-live for the cached result.
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