SfSymbolCache class
Shares rendered symbols between widgets.
Rendering a symbol costs a native texture and a pixel buffer, so a list of a hundred rows showing the same icon would otherwise hold a hundred copies of one image. Identical SfSymbolConfigs share a single texture instead, and a symbol that is already cached is handed over synchronously, without the frame of empty space an asynchronous load would leave behind.
Symbols no longer on screen are kept for a while in case they come back — scrolling a list destroys and rebuilds rows constantly — up to maximumUnusedEntries, after which the least recently released is dropped.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
How many symbols are rendered, in use or not.
no setter
- maximumUnusedEntries ↔ int
-
How many off-screen symbols to keep rendered. Symbols still on screen are
always kept, and are not counted against this.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unusedLength → int
-
How many rendered symbols are currently off screen.
no setter
Methods
-
acquire(
SfSymbolConfig config) → Future< SfSymbolTexture?> -
Renders
config, or takes a reference to it if it is already rendered. -
acquireCached(
SfSymbolConfig config) → SfSymbolTexture? -
Takes a reference to
configif it is already rendered. -
clear(
) → void - Drops everything, on screen or not. Only for tests.
-
contains(
SfSymbolConfig config) → bool -
Whether
configis rendered and ready to hand out. -
evictUnused(
) → void - Releases every rendered symbol that is not currently on screen.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
precache(
SfSymbolConfig config) → Future< void> -
Renders
configahead of time, so a later SfSymbol draws immediately. -
release(
SfSymbolConfig config) → void - Drops a reference taken by acquire or acquireCached.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → SfSymbolCache
-
final