Skip to main content

Overview

The Synheart Wear Flutter SDK provides a unified API for streaming biometric data from Apple Watch, Fitbit, Garmin, Whoop, and Samsung devices in Flutter applications. Key Features:
  • Cross-platform support (iOS + Android)
  • Real-time HR and HRV streaming
  • Unified data schema across all devices
  • Encrypted local storage
  • Consent-based permissions

Installation

Add to your pubspec.yaml:
Install dependencies:

Platform Configuration

iOS Configuration

Add to ios/Runner/Info.plist:

Android Configuration

Add to android/app/src/main/AndroidManifest.xml:
Important: Your MainActivity must extend FlutterFragmentActivity (not FlutterActivity) for Android 14+.

Basic Usage

Recommended Pattern (Explicit Permission Control):
Alternative Pattern (Simplified): If you don’t need to provide a custom reason, you can let initialize() handle permissions automatically:
Note: initialize() validates that wearable data is available and not stale (>24 hours old). If no data is available or data is too old, it will throw a SynheartWearError with codes NO_WEARABLE_DATA or STALE_DATA.

Real-Time Streaming

Complete Example

Data Schema

Access metrics using the WearMetrics object:

Error Handling

Common Error Codes:
  • NO_WEARABLE_DATA: No health data available from connected devices
  • STALE_DATA: Latest data is older than 24 hours
  • PERMISSION_DENIED: User denied required permissions
  • DEVICE_UNAVAILABLE: Health data source is not available

BLE Heart Rate Monitor

Connect directly to any standard Bluetooth LE heart rate monitor (WHOOP Broadcast, Polar, Wahoo, Garmin HRM straps) for real-time HR streaming. No cloud backend needed.

Platform Setup

Android — Add to AndroidManifest.xml:
iOS — Add to Info.plist:

Usage

HeartRateSample

Each sample from the stream contains:

Error Handling

BLE HRM uses structured error codes returned as PlatformException:

Notes

  • WHOOP devices require “Broadcast Heart Rate” enabled in the WHOOP app settings
  • RR intervals are available on some devices (e.g. Polar chest straps) but not all
  • Reconnection is automatic: 3 retries with exponential backoff (1s, 2s, 4s)
  • Only one BLE HRM device can be connected at a time

Cloud Providers

WhoopProvider

GarminProvider (Cloud)

Full Garmin Connect integration via OAuth PKCE. Supports 12 summary types through the Garmin Health API backfill endpoint: dailies, epochs, sleeps, stressDetails, hrv, userMetrics, bodyComps, pulseox, respiration, healthSnapshot, bloodPressures, and skinTemp.

GarminHealth (Native RTS)

The GarminHealth facade provides native Garmin device integration for scanning, pairing, and real-time streaming. All method signatures use generic SDK-owned types (ScannedDevice, PairedDevice, WearMetrics), never Garmin-specific types.
Important: The Garmin Health SDK Real-Time Streaming (RTS) capability requires a separate license from Garmin. This facade is available on demand for licensed integrations. The underlying Garmin Health SDK code is proprietary to Garmin and is not distributed as open source.

Platform-Specific Notes

Android

  • HRV: Only HRV_RMSSD is supported by Health Connect
  • Distance: Uses DISTANCE_DELTA type
  • Requires Health Connect app installed
  • MainActivity must extend FlutterFragmentActivity

iOS

  • Full support for all metrics via HealthKit
  • Requires HealthKit capability enabled in Xcode
  • Background delivery available for real-time updates

API Reference

SynheartWear

Main SDK class for interacting with wearable devices. Constructor:
Methods:

SynheartWearConfig

Configuration for the SDK. Constructor:

WearMetrics

Biometric data container. Methods: Properties:

Resources