IconCache class

Per-map cache of rasterised marker icons, keyed by icon key, logical size and pixel ratio.

Keeps the maxEntries most recently used icons. Every rasterised image gets a unique PlatformIcon.key, so a diff only re-sends a marker when its image really changed.

Constructors

IconCache({int maxEntries = 500})

Properties

epoch → int
Incremented by every clear: an icon obtained before is no longer the one the map would rasterise.
no setter
hashCode → int
The hash code for this object.
no setterinherited
length → int
no setter
maxEntries → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Empties the cache. Renders still in flight complete for their callers but are not cached.
lookup(Object key, Size size, double pixelRatio) → PlatformIcon?
The cached icon, if any, which becomes the most recently used.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve({required Object key, required Widget child, required Size size, required double pixelRatio, BuildContext? context}) → Future<PlatformIcon>
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

rendersInFlight → int
Icons being rasterised by every cache, for tests that wait for them.
no setter