UiGraphCacheManager class

Owns the on-device UI-graph cache: capture debouncing, the navigating gate, per-path write serialization, the manifest, eviction, and the handoff to the sync engine.

Implemented types

Constructors

UiGraphCacheManager({CacheStore? store, String now()?, Duration captureDebounce = const Duration(milliseconds: 400), Duration captureMaxWait = const Duration(seconds: 2), Duration flushTimeout = const Duration(seconds: 3), int maxScreens = 6})

Properties

captureDebounce → Duration
final
captureMaxWait → Duration
Ceiling on how long a continuous trigger burst may defer a capture.
final
flushTimeout → Duration
final
graph → RouteGraphFile
no setter
hashCode → int
The hash code for this object.
no setterinherited
isNavigating → bool
no setter
maxScreens → int
The backend is the durable store, so only a handful of screen files live on device at a time.
final
metrics → CacheMetrics
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
store → CacheStore
no setteroverride

Methods

acceptSnapshot(Object handle, UiSnapshot snapshot) → Future<void>
Fan out the live pump's complete capture before its transport budget is applied. During a call this replaces the cache's second semantics walk.
clearAll() → Future<void>
Wipe everything (logout, account switch, host-requested clear).
dispose() → void
Stops timers only.
enableSync({required UiGraphTransport transport, required Future<String?> getAppUserId(), required String sdkName, required String sdkVersion, required String platform, required String appVersion()}) → void
Attach the uploader.
endNavigating(int token) → void
Close the gate, but only if token is the current hold.
flush(String reason) → Future<void>
Upload now.
init({required UiSnapshot? captureSnapshot(), bool isInScope(String screen)?, bool scheduleSharedCapture()?, Future<void>? captureSharedNow()?}) → Future<Object>
Load persisted state.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCapture(String reason) → void
A capture-worthy event happened (scroll settle, tap, route change, overlay).
onNavigate(String to, {String? from}) → Future<bool>
Record a transition to to.
release(Object handle) → void
Let go of one capture source.
serialize(String logicalPath, Future<void> op()) → Future<void>
Serialize a read-modify-write against everything else touching the same logical path — captures against each other, and captures against the sync engine's compare-and-swap.
override
setNavigating(bool value) → int
Open/close the navigating gate.
toString() → String
A string representation of this object.
inherited

Operators

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