SnapshotPump class
Captures a fresh UiSnapshot on demand and pushes the diff against the prior snapshot as a UiDiffMessage.
Constructors
-
SnapshotPump({required UiSnapshot? captureSnapshot(), required SendPayload send, void onCaptured(UiSnapshot snapshot)?, bool canTransmit(UiSnapshot snapshot)?, Map<
String, Object?> envelope()?, Duration debounce = const Duration(milliseconds: 500), Duration maxWait = const Duration(seconds: 2), bool watchSemantics = true})
Properties
- canTransmit → bool Function(UiSnapshot snapshot)?
-
Checked before any live observation, diffing, or enqueueing.
final
- captureSnapshot → UiSnapshot? Function()
-
final
- debounce → Duration
-
final
-
envelope
→ Map<
String, Object?> Function()? -
Envelope keys added to every live tree frame (Android
UiSnapshot.toWireparity:app_user_id,app_version,sdk {sdk_name, sdk_version, platform}). Read per push so a USER_DATA arriving mid-call is picked up. Keys the diff already carries are never overwritten, and the byte budget is reduced by exactly these bytes so the enriched frame still fits kSnapshotSendCapBytes.final - hasBaseline → bool
-
Whether the receiver currently holds a tree this pump sent (so the next
push can be a delta rather than a full baseline).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxWait → Duration
-
Ceiling on how long a continuous trigger burst may defer a push.
final
- onCaptured → void Function(UiSnapshot snapshot)?
-
Fan out the same unbudgeted capture to independent consumers such as
the persistent cache, even when live transmission is disabled.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- send → SendPayload
-
final
Methods
-
dispose(
) → void -
forcePush(
) → Future< void> - Explicit pulls and reconnects must replace the receiver's entire tree, even when the current UI is identical to our previous capture.
-
invalidateBaseline(
) → void - Drop the diff baseline, so the NEXT push is a full snapshot.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pushNow(
) → Future< void> - Capture and push NOW — a delta against the last pushed tree, or a full baseline only when there is none. For callers that need the capture to have happened before they continue (lifecycle flushes), without forcing the receiver to replace an up-to-date tree each time.
-
schedulePush(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited