Skip to main content

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 to pubspec.yaml:
Install:

Requirements

  • Flutter >= 3.10.0
  • Dart >= 3.0.0
  • iOS 12.0+, Android minSdk 21

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:
The map holds 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 interactions
  • BehaviorEventType.tap - Tap interactions
  • BehaviorEventType.swipe - Swipe interactions
  • BehaviorEventType.app_switch - Foreground / background app-switch events
  • BehaviorEventType.notification - Notification events
  • BehaviorEventType.call - Call events
  • BehaviorEventType.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. Set emitRawMotionSamples: true, subscribe to onMotionSample and forward the raw 50 Hz accelerometer batches to the runtime’s motion classifier.

Permissions

Since 0.4.1 the plugin’s Android manifest merges BIND_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

For comprehensive documentation, see the full README on GitHub.