BaselinesSnapshot class

A typed aggregate of the host-visible baseline state at a point in time.

Produced by the SDK's Baselines facade whenever a new sleep score is ingested or the wearable reference refreshes. Consumers read this to render a "your normal" / SRM overview without having to touch FFI or parse raw JSON.

Constructors

BaselinesSnapshot({required WearableReferenceView? reference, required SleepScoreResult? latestSleepScore, RecoveryScoreResult? latestRecoveryScore, ReadinessScoreResult? latestReadinessScore, List<int> recentSleepScores = const [], required int capturedAtMs})
const

Properties

capturedAtMs → int
Millisecond timestamp when this snapshot was assembled.
final
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
True when nothing has been ingested and the engine hasn't produced a reference — useful for rendering an empty/warming state in UI.
no setter
isReady → bool
True when the reference is present and reports READY status — all five primary SRM dimensions are mature enough for personalized scoring.
no setter
latestReadinessScore → ReadinessScoreResult?
The most recent daily Readiness Score, computed automatically each time a Recovery Score lands. Layers fatigue (sleep debt + recovery slope) and history (consecutive overload) on top of the Recovery anchor. Null until at least one Recovery Score has been computed this session.
final
latestRecoveryScore → RecoveryScoreResult?
The most recent daily Recovery Score, computed alongside the sleep ingest when overnight HR or HRV is available in the same payload. Null when the user has only sleep data (sleep-only recovery is forbidden by design) or the runtime hasn't computed one yet this session.
final
latestSleepScore → SleepScoreResult?
The most recently computed batch SleepScoreResult, or null if no sleep event has ever been ingested. Survives an app restart: the runtime persists the Path-B ring and the SDK persists this rich per-night result through Baselines.exportRecoveryStateJson / loadRecoveryStateJson — the same host-owned blob that carries the latest Recovery / Readiness results.
final
nightsLoggedCount → int
Number of nights captured in the Path-B ring this session (capped at 7). This is the right "nights logged" surface for the user — priorNightCount reflects what the scorer saw, not the cumulative count of attaches.
no setter
priorNightCount → int?
Number of prior nights behind the live score, when available.
no setter
recentMedian → int?
Median of the recent ring; available immediately after the 3rd attach, regardless of HSI window state. Falls back to the reference's median when the ring isn't populated locally.
no setter
recentSleepScores → List<int>
Path-B 7-night rolling-window scores in attach order (oldest → newest), read directly from the longitudinal snapshot. Updates the moment a score is attached, so consumers can show "N/7 nights logged" + median without waiting for an HSI window to close. Empty until first ingest.
final
reference → WearableReferenceView?
Longitudinal-SRM reference view (status, per-dimension medians, Path-B recent_sleep_score_median). Null before the first reference is produced — an HSI window has to close before the engine flushes the ring → reference.
final
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