StacCacheConfig class

Configuration for Stac screen caching behavior.

This class allows fine-grained control over how screens are cached, when they expire, and how updates are handled.

Basic Usage

await Stac.initialize(
  options: StacOptions(...),
  cacheConfig: StacCacheConfig(
    maxAge: Duration(hours: 24),
    strategy: StacCacheStrategy.optimistic,
  ),
);

Constructors

StacCacheConfig({Duration? maxAge, StacCacheStrategy strategy = StacCacheStrategy.networkFirst, bool refreshInBackground = true})
Creates a StacCacheConfig instance.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
maxAge Duration?
Maximum age of cached data before it's considered stale.
final
refreshInBackground bool
Whether to refresh cache in the background.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strategy StacCacheStrategy
The caching strategy to use.
final

Methods

copyWith({Duration? maxAge, StacCacheStrategy? strategy, bool? refreshInBackground}) StacCacheConfig
Creates a copy of this config with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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