BackgroundCache class final

Small LRU of gradient shaders and pattern pictures.

Constructors

BackgroundCache({int capacity = 8})

Properties

builds ↔ int
Times a shader or picture was built (tests).
getter/setter pair
capacity → int
Entries kept per kind.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Drops (and disposes) everything.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
picture(BackgroundSpec spec, Size size, Picture build()) → Picture
The cached picture for spec at size, built by build on a miss.
scenePicture(Object key, Picture build()) → Picture
A family scene's cached picture for key (value equality: e.g. a record of the spec, the size and the text-safe area), built by build on a miss; evicted pictures are disposed.
shader(BackgroundSpec spec, Size size, Shader build()) → Shader
The cached shader for spec at size, built by build on a miss.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → BackgroundCache
The app-wide cache.
final