ServiceWorkerResource<T> class

A network resource fetched and cached by a service worker in a browser environment.

Inheritance

Constructors

ServiceWorkerResource({@required ServiceWorkerCacheEntry<T> cache, CacheStrategy strategy, Parser parser})

Properties

cache LocalResource<T>
The local copy of the data fetched from url.
final, inherited
data → T
Synchronously get the most recently loaded data.
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isExpired Future<bool>
Returns true if cache does not exist, false if it exists but maxAge is null; otherwise compares the cache's age to maxAge.
read-only, inherited
location String
The location (a path or url) of the resource.
final, inherited
maxAge Duration
Determines when the cache copy has expired and should be refetched.
final, inherited
parser Parser<T>
This parser will override the cache.parser.
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
strategy CacheStrategy
final, inherited
url String
The location of the data to fetch and cache.
read-only, inherited

Methods

fetchContents() Future
Fetch the raw contents from the underlying platform. [...]
override
get({bool forceReload: false, bool allowCacheFallback: true, bool skipCacheWrite: false}) Future<T>
Retrieve the data from RAM if possible, otherwise fallback to cache or network, depending on the strategy. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited