rolla_sdk 0.1.12 copy "rolla_sdk: ^0.1.12" to clipboard
rolla_sdk: ^0.1.12 copied to clipboard

Rolla Health & Fitness SDK for Flutter apps — drop-in health, activity tracking, wearable band pairing, and white-label UI.

Rolla SDK #

Rolla SDK is a health & fitness tracking solution — activity tracking, health metrics, workouts, and Rolla fitness-band integration — built with Flutter. It can be consumed as a Flutter package (this pub.flutter-io.cn package) or, for non-Flutter hosts, as a pre-built native iOS CocoaPod / Android Maven artifact.

Key features #

  • Activity tracking — steps, distance, calories, and daily movement
  • Health monitoring — heart rate, sleep analysis, and vital signs
  • Workout sessions — real-time tracking with detailed metrics and maps
  • Band integration — Bluetooth connectivity with Rolla fitness bands
  • White-label UI — branding, theming, and per-partner configuration

Requirements #

Flutter 3.35.6 or later
Dart 3.9.2 or later
iOS Deployment target 14.0+
Android minSdk 26 (Android 8.0) · build JDK 17+ · Kotlin 2.2.0+ · core library desugaring enabled
Mapbox A Mapbox access token (the SDK renders maps for activity tracking)
Credentials A Partner ID and API credentials issued by Rolla

The Android floors are driven by the bundled health plugin (Health Connect): minSdk 26, and Kotlin 2.2.0+ (older Kotlin compilers cannot read its kotlin_module metadata). The SDK AAR ships Java 17 bytecode, so the build JDK must be 17+. See the documentation for the exact Gradle / Info.plist setup.

Installation (Flutter) #

dependencies:
  rolla_sdk: ^0.1.12
flutter pub get

Initialize the SDK with a token from your auth service, then render the SDK home widget:

import 'package:flutter/material.dart';
import 'package:rolla_sdk/rolla_sdk.dart';

Future<void> launchRolla(BuildContext context, String userId) async {
  await RollaSDK.initializeWithToken(
    accessToken: myAccessToken,                 // from your auth service
    userId: userId,                             // your user id
    partnerId: 'partner-456',                   // Rolla-issued partner id
    environment: RollaEnvironment.production,   // or RollaEnvironment.rnd
    branding: const Branding(
      appName: 'My Health App',
      defaultThemeMode: ThemeMode.system,
      primaryColor: Color(0xFF1D68FF),
      secondaryColor: Color(0xFF39507E),
      accentColor: Color(0xFF4CAF50),
      brightness: Brightness.light,
    ),
    onTokenExpired: () async => TokenRefreshResult(
      accessToken: await refreshMyToken(),
    ),
    // Embedding RollaSdkHome on your own Navigator? Pass this so the SDK's
    // back button (showBackButton) can return the user to your app:
    showBackButton: true,
    onRequestDismiss: () => Navigator.of(context).pop(),
  );
}

// After initialization, render the SDK. RollaSdkHome builds its own
// MaterialApp.router and theme — do NOT wrap it in another MaterialApp.
Widget buildRollaScreen(String userId) => RollaSdkHome(userId: userId);

accessToken, userId, and partnerId are required. environment defaults to RollaEnvironment.production and baseUrl is derived from it.

Permissions: iOS requires Bluetooth / Location / Motion / HealthKit usage strings in Info.plist (the app SIGABRT-crashes on first access otherwise); Android requires the matching runtime permissions and core library desugaring. See the documentation's permissions sections. A complete working host is in the Flutter demo app.

Installation (native hosts) #

Non-Flutter apps consume pre-built binaries (no Flutter SDK required).

iOS — CocoaPods (Swift Package Manager is not currently supported):

source 'https://github.com/Rolla-Health-Fitness/rolla-sdk-release-ios.git'
source 'https://cdn.cocoapods.org/'

platform :ios, '14.0'

target 'YourApp' do
  use_frameworks!
  pod 'RollaSDK', '0.1.10'   # check release tags for the latest
end

Android — Maven (settings.gradle.kts):

dependencyResolutionManagement {
  repositories {
    google()
    mavenCentral()
    maven { url = uri("https://rolla-health-fitness.github.io/rolla-sdk-release-android/maven/") }
  }
}
// app/build.gradle.kts
android {
  defaultConfig { minSdk = 26 }
  compileOptions { isCoreLibraryDesugaringEnabled = true }
}
dependencies {
  coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
  implementation("com.rolla.sdk:android_release:0.1.10") // check release tags
}

Authentication #

The SDK uses a JWT issued by the Rolla Partner API; your app obtains it server-side and hands it to the SDK (never ship a partner secret in the app):

curl --location 'https://ross-rnd.rolla.cloud/partners/v1/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'partner_id=YOUR_PARTNER_ID' \
  --data-urlencode 'partner_secret=YOUR_PARTNER_SECRET'
Environment API base URL
R&D (testing) https://ross-rnd.rolla.cloud
Production https://ross.rolla.cloud

Documentation & support #

License #

See the LICENSE file for details.