Skip to content

VVK027/flutter_band_fit

Repository files navigation

Flutter Band Fit

Flutter plugin for UTE smart band / fitness watch BLE connectivity on Android and iOS.

UTE SDK and GloryFit SDK

The UTE SDK is the GloryFit SDK. They are the same native stack: UTE is the vendor/SDK branding used in this project (ute_sdk on Android, UTESmartBandApi on iOS), while GloryFit is the common product name for that same SDK on many fitness bands and companion apps. This plugin does not wrap two different SDKs—it exposes one Flutter API over that single GloryFit/UTE implementation on each platform.

Overview

  • Integrates the native UTE SDK (= GloryFit SDK) for band scan, bind, sync, vitals, dial faces, firmware, and device settings.
  • Primary goal: expose one common Dart platform so Flutter apps do not maintain parallel native SDK integrations on each OS.
  • Reference implementation: the example/ app (flutter_band_fit_app) is a complete demo — pairing, dashboard, detail charts, device settings, dial upload, and health export patterns.

Features

  • Scan, pair, connect, disconnect, and reconnect BLE band devices
  • Sync steps, sleep, heart rate, blood pressure, SpO₂, temperature, and sport data
  • Fetch historical data by date or bulk from on-device storage
  • Device settings: user profile, 24h monitoring, DND, find band, language, weather, call reject
  • Online watch dial transfer and progress events
  • Event streams for connection state, sync progress, and live tests (e.g. blood pressure)

Screenshots

Example app (example/) with a connected UTE / GloryFit band:

Vitals Dashboard (Light) Vitals Dashboard (Dark)
Vitals dashboard (light theme) Vitals dashboard — dark
Activities Heart rate
Daily steps, distance, and calories Heart rate trend and daily stats
Blood pressure SpO₂
BP readings and on-demand test Blood oxygen trend and measurement

Preview

flutter_band_fit_preview

Live Demo

band_preview.mp4

BLE connection workflow

Typical integration order (aligned with the native UTE / GloryFit BLE flow):

flowchart TD
    A["FlutterBandFit() singleton"] --> B["initializeDeviceConnection()"]
    B --> C{BLE supported?}
    C -->|bleNotSupported| X[Stop: unsupported device]
    C -->|ok| D["receiveEventListeners(...)"]
    D --> E{Bluetooth on + permissions?}
    E -->|no| P[Request BT / permissions]
    P --> F["startSearchingDevices()"]
    E -->|yes| F
    F --> G{Devices found?}
    G -->|no| H[Show empty / retry scan]
    G -->|yes| I["connectDevice() / reConnectDevice()"]
    I --> J{Connected?}
    J -->|no| K[Show error / retry]
    J -->|yes| L["setUserParameters + sync + fetch"]
    L --> M[Ongoing: event stream + checkConnectionStatus]
Loading

Quick start in code:

import 'package:flutter_band_fit/flutter_band_fit.dart';

final band = FlutterBandFit();

await band.initializeDeviceConnection();
band.receiveEventListeners(onData: (data) {}, onError: (e) {});

final devices = await band.startSearchingDevices();
// ... user picks device ...
await band.connectDevice(devices.first);

if (await band.checkConnectionStatus()) {
  await band.syncStepsData();
}

band.dispose();

Requirements

  • Flutter ≥ 3.24, Dart ≥ 3.5
  • Android: minSdk 26, Bluetooth permissions (runtime on API 31+)
  • iOS: UTESmartBandApi.framework (included under ios/)

Installation

Add from pub.dev:

dependencies:
  flutter_band_fit: ^0.0.4

For local development:

dependencies:
  flutter_band_fit:
    path: ../flutter_band_fit

Android

Plugin package com.vvk.flutter_band_fit bundles ute_sdk (AAR). Merge BLE/location permissions in your app manifest as required by your targetSdk.

iOS

Use the federated plugin setup from pub get; native code bridges to UTESmartBandApi.

Documentation

Guide Path
Full implementation (workflow + example map) example/docs/plugin/full-implementation-guide.md
Integration steps example/docs/plugin/plugin-integration-guide.md
API by operation example/docs/plugin/plugin-api-workflow.md
Example docs index example/docs/README.md
Example app layout example/ARCHITECTURE.md

Example app

cd example
flutter pub get
flutter run
Area Path
Entry example/lib/main.dartapp/main.dart
BLE / sync example/lib/core/services/activity_service_provider.dart
Pairing example/lib/features/device/
Vitals UI example/lib/features/vitals/

API lifecycle

  • Use one FlutterBandFit instance per app session.
  • Register receiveEventListeners / receiveBPListeners only while needed; call dispose() or cancel subscriptions on teardown.
  • Prefer checkConnectionStatus() before sync, fetch, or test calls (checkConectionStatus() remains as a compatibility alias).
  • Treat platform results as untrusted: branch on BandFitConstants status strings; empty maps mean no data or decode failure.

Project layout

lib/                    # Public Dart API
android/                # Plugin + ute_sdk
ios/                    # Plugin + UTESmartBandApi.framework
example/                # Full reference application
example/docs/           # Integration and architecture docs

License

This project is licensed under the MIT License.

Native UTE SDK (= GloryFit) SDK binaries (ute_sdk.aar, UTESmartBandApi.framework) are third-party.