Appearance
Flutter SDK
The trainingkit_flutter package is a ready-to-use Flutter bridge for FizzUp TrainingKit. It lets your Flutter application launch TrainingKit workouts without copying any native bridge code into the host app.
The package handles both classic workouts and video workouts. Your application owns the GraphQL client and manages authentication; the package handles dispatching the session payload to the correct native SDK.
At a glance
Two functions cover the whole integration: identify the device on your GraphQL requests, then launch a workout from the session payload the backend returns.
dart
import 'package:trainingkit_flutter/trainingkit_flutter.dart';
// 1. Send the device id with your GraphQL requests
final headers = {'X-TrainingKit-Device': await deviceIdentifier()};
// 2. Launch the workout from the session payload (it carries trainingKitToken)
await launchWorkout(session);launchWorkout inspects the session and opens the classic or video native experience automatically. See Usage for the full flow.
What the package provides
| Export | Description |
|---|---|
deviceIdentifier() | Returns the native TrainingKit device identifier, required as an HTTP header on GraphQL requests. Returns a Future<String>. |
launchWorkout(session) | Launches the native workout experience from a GraphQL session payload. Dispatches to the classic or video native controller automatically. |
Platform coverage
| Platform | Status |
|---|---|
| iOS | Included. The plugin is a Swift Package that depends on the TrainingKit iOS SDK (getfizzup/trainingkit-ios-sdk), resolved via Swift Package Manager. |
| Android | Included. The TrainingKit Android SDK is resolved from GitHub Packages via the package Gradle configuration. |
Flutter plugin autolinking handles native registration on both platforms.
Requirements
- Flutter 3.3 or later (Dart 3)
- A Mac with Xcode to build the iOS app (iOS builds are macOS-only), with Flutter's Swift Package Manager enabled and an iOS deployment target of 15.1+
- Android API level 24 or higher, and a GitHub account with access to the FizzUp GitHub Packages Maven repository
- A contract with FizzUp granting access to the GraphQL API and a launch token
In this section
- Installation: Add the package to an existing Flutter app and configure each platform.
- Quickstart: Run the demo app to validate the full workout launch flow.
- Usage: Wire a GraphQL client, list workouts, and launch a session.
- Authentication: Device identifier and token flow.
- Reference: Full API reference for exported functions and types.
- Troubleshooting: Common installation and build errors.
