Overview
The Synheart Behavior Flutter SDK collects behavioral events from digital interactions (taps, scrolls, swipes, typing timing, app switches, notifications, calls) and streams them to your app. Since 0.4.0 the SDK is an event producer: it emits events and raw per-session counts, and no longer computes focus, distraction or typing aggregates, or classifies motion. Those are computed downstream by Synheart Core and the runtime.Installation
Add topubspec.yaml:
Requirements
- Flutter >= 3.10.0
- Dart >= 3.0.0
- iOS 12.0+, Android
minSdk21
Quick Start
Basic Usage
Real-Time Event Tracking
Session Management
summary.behavioralMetrics and summary.typingSessionSummary are always
null, and notificationIgnoreRate / notificationClusteringIndex are always
0: the SDK no longer computes them. Focus and distraction scores come from
Synheart Core.On-Demand Metrics Calculation
Get raw counts and context for a custom time range within a session:activity_summary, notification_summary, device_context and
system_state. It no longer includes behavioral_metrics or motion_state.
Failures throw an Exception('Failed to calculate metrics for time range: …').
API Reference
SynheartBehavior
Main Methods:
Permission helpers are listed under Permissions.
Properties:
BehaviorConfig
Parameters:
BehaviorEvent
Properties:
Event Types:
BehaviorEventType.scroll- Scroll interactionsBehaviorEventType.tap- Tap interactionsBehaviorEventType.swipe- Swipe interactionsBehaviorEventType.app_switch- Foreground / background app-switch eventsBehaviorEventType.notification- Notification eventsBehaviorEventType.call- Call eventsBehaviorEventType.typing- Typing session events (timing only — never characters)BehaviorEventType.clipboard- Clipboard activity (copy / paste / cut counts only — never content)
BehaviorSession
Methods:
Properties:
BehaviorSessionSummary
Properties:
Motion classification runs in the Synheart Runtime. SetemitRawMotionSamples: true, subscribe toonMotionSampleand forward the raw 50 Hz accelerometer batches to the runtime’s motion classifier.
Permissions
Since 0.4.1 the plugin’s Android manifest mergesBIND_NOTIFICATION_LISTENER_SERVICE,
READ_PHONE_STATE and the SynheartNotificationListenerService declaration into
your app. If you don’t collect notifications or calls, remove them in your own
manifest:
Notification Permission
Call Permission
Configuration
Update Configuration at Runtime
Resources
- pub.dev: synheart_behavior
- Repository: synheart-behavior-flutter
- Full README: View on GitHub