cacheKey property

Object? cacheKey
final

Identifies what widget draws, for providers that draw markers as bitmaps (Google Maps, the Mapbox SDK).

Without it a marker is compared by its widget, and a widget built inline is new on every build — so every rebuild drew every marker again. With it, two markers with the same key are the same picture: an unchanged marker is left alone, and a bitmap drawn once for a key is reused. Make it change whenever the picture does — a label, a selected state, a colour.

Implementation

final Object? cacheKey;