ActivitySnapshot class final

Activity classification captured at a particular instant.

Constructors

ActivitySnapshot({required TrackingActivityType type, required int confidence, required DateTime? recordedAt, ActivityEvidenceState evidenceState = ActivityEvidenceState.fresh, String source = 'platform_activity', String? rawType, Duration? age, Map<TrackingActivityType, int> probabilities = const <TrackingActivityType, int>{}})
Creates an activity reading with a confidence from 0 to 100.
const
ActivitySnapshot.fromMap(Map<Object?, Object?> map)
Decodes a native activity-channel payload.
factory
ActivitySnapshot.unknown()
Creates an unavailable activity reading.
const

Properties

age → Duration?
Age reported by native code when the snapshot was emitted.
final
confidence → int
Platform confidence percentage, clamped to 0–100.
final
evidenceState → ActivityEvidenceState
Whether this reading is fresh enough for a motion decision.
final
hashCode → int
The hash code for this object.
no setterinherited
probabilities → Map<TrackingActivityType, int>
Bounded probable-activity distribution when supplied by the platform.
final
rawType → String?
Platform-native activity value retained for diagnostics.
final
recordedAt → DateTime?
UTC time associated with the activity reading, when available.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source → String
Native evidence source, such as android_activity_recognition.
final
type → TrackingActivityType
Normalized platform activity.
final

Methods

evaluatedAt(DateTime now, Duration freshnessThreshold) → ActivitySnapshot
Returns this reading with freshness evaluated at now.
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