DimenCache class abstract final

EN: Snapshot-partitioned memoization shared by code APIs, widgets and every strategy satellite. The dominant families bypass the hash entirely on the default path because one multiply (~2 ns native) beats a lookup — exactly like the Kotlin engine (shouldBypassCache).

PT: Memoização particionada por snapshot compartilhada por APIs de código, widgets e todos os satélites de estratégia. As famílias dominantes ignoram o hash no caminho padrão porque uma multiplicação vence a consulta — como no motor Kotlin (shouldBypassCache).

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

currentMetrics DimenMetrics
The snapshot currently driving resolutions (scope → published → fallback).
no setter
fallbackMetrics DimenMetrics
Fallback snapshot used when nothing was published yet.
no setter
isEnabled bool
Enables/disables memoization (math always runs the full path when off).
getter/setter pair

Static Methods

addResetListener(void listener()) → void
Registers a listener invoked whenever partitions are invalidated.
clear() → void
Clears everything (tests / low-memory hooks).
getOrPut(CacheKey key, double compute()) double
Resolves key against the current snapshot partition.
getOrPutFor(DimenMetrics metrics, CacheKey key, double compute()) double
Resolves key against an explicit coherent metrics snapshot.
init(ScreenConfiguration configuration) → void
Publishes the fallback snapshot (no-op when equal to the current one).
invalidate([DimenMetrics? metrics]) → void
Drops the partition of metrics (or all partitions when null).
invalidateOnConfigChange(ScreenConfiguration configuration) → void
Event-driven hook: call when a window configuration changes. Partitions are keyed by exact snapshot, so correctness never depends on this — it only releases memory earlier.
metricsFor(AppDimensContextLike context) DimenMetrics
Coherent snapshot for an explicit context (never retained).
notifyResetListeners() → void
peek(CacheKey key) double?
Reads without computing.
removeResetListener(void listener()) → void
resetDiagnostics() → void
Resets diagnostic counters.
shouldBypassCache(CacheKey key) bool
True when this key's family must skip the hash on the default path.
stats() CacheStats
Aggregated diagnostics for BenchLab.

Constants

adjustmentScale → const double
invBaseRatio → const double
maxSnapshotCaches → const int
sensitivityDefault → const double
snapshotCacheSize → const int