BehaviorModule class
Behavior Module
Captures user-device interaction patterns using synheart_behavior package.
Consent gating policy: no collection at all without consent.
synheart_behavior.initialize() starts native collection, so we only
initialize when behavior consent is granted (inside onStart).
- Inheritance
-
- Object
- BaseSynheartModule
- BehaviorModule
Constructors
- BehaviorModule({required ConsentProvider consent, bool enableMotionLite = false, bool emitRawMotionSamples = false})
Properties
- contextEventsAccepted → int
-
Context events accepted / rejected by the runtime this session.
no setter
- contextEventsRejected → int
-
no setter
- eventStream → BehaviorEventStream
-
Get the event stream for recording events (for manual instrumentation)
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEnabled → bool
-
Whether this module is currently enabled
no setterinherited
- latestMotionState → MotionStateSnapshot?
-
Latest motion-state snapshot from the runtime, or
nullif none has been observed yet (for example when motion-state classification is disabled in the engine config). Updated by ingestHsi.no setter - moduleId → String
-
Module identifier
no setteroverride
-
motionStateUpdates
→ Stream<
MotionStateSnapshot> -
Stream of motion-state updates extracted from HSI snapshots.
Emits one event per HSI window that carries a
motion_statereading.no setter - onRuntimeBehaviorEvent ↔ void Function(BehaviorEventInput event)?
-
Observer for every rich event handed to pushBehaviorEventToRuntime,
called just before it. Lets the facade republish them for a host that
feeds a second runtime; see Synheart.runtimeBehaviorEventStream.
getter/setter pair
- pushAccelToRuntime ← void Function(int tsMs, double ax, double ay, double az)?
-
no getter
- pushBehaviorEventToRuntime ← int? Function(BehaviorEventInput event)?
-
no getter
- pushBehaviorToRuntime ← void Function(int tsMs, int eventType, double value)?
-
no getter
- pushContextEventToRuntime ← int? Function(ContextEventInput event)?
-
no getter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → ModuleStatus
-
Current module status
no setterinherited
- synheartBehavior → SynheartBehavior?
-
Get the synheart_behavior instance for wrapping your app
no setter
Methods
-
clearCache(
) → Future< void> - Clear all cached data
-
dispose(
) → Future< void> -
Dispose of all resources (final cleanup)
inherited
-
ingestHsi(
String hsiJson) → void -
Feed an HSI 1.2 JSON snapshot in and surface the
motion_statereading (when present) on latestMotionState and motionStateUpdates. Cheap to call on every HSI window — bails out fast when the snapshot has no behavior axis or nomotion_statereading. -
initialize(
) → Future< void> -
Initialize the module with required dependencies
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
) → Future< void> -
Called during disposal
override
-
onInitialize(
) → Future< void> -
Called during initialization
override
-
onStart(
) → Future< void> -
Called when starting the module
override
-
onStop(
) → Future< void> -
Called when stopping the module
override
-
pushHostContextEvent(
ContextEventInput event) → void - Push a context event the host derived itself.
-
rawEvents(
WindowType window) → List< BehaviorEvent> -
setStatus(
ModuleStatus newStatus) → void -
Set the module status and notify listeners
inherited
-
start(
) → Future< void> -
Start the module's operation
inherited
-
stop(
) → Future< void> -
Stop the module's operation (can be restarted)
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited