PictureCache class
Advanced Picture Cache with automatic LRU eviction and memory tracking.
Prevents OOM crashes on large charts by disposing unused ui.Pictures.
Constructors
- PictureCache({int maxMemoryBytes = 64 * 1024 * 1024})
Properties
- currentMemoryBytes → int
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxMemoryBytes → int
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
no setter
- stats → PictureCacheStats
-
no setter
Methods
-
clear(
{bool resetMetrics = true}) → void -
estimateMemoryBytes(
Size size) → int -
getOrBuild(
String key, Size size, void builder(Canvas canvas, Size size)) → Picture -
getOrBuildWithReport(
String key, Size size, void builder(Canvas canvas, Size size)) → PictureCacheResult -
invalidate(
String key) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resetStats(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited