Funxtion.com|SDK Documentation
v0.1.0
Funxtion SDK

Build fitness experiences in minutes

Drop in pre-built UI components for video classes, audio workouts, training plans, and discovery — across Flutter, iOS, and Android.

Flutter — DartiOS 16+ — Swift SPMAndroid API 24+ — KotlinMIT License

Rich UI Components

Workout cards, search, filters, and players — ready to embed.

Analytics Built-in

30+ events tracked automatically. Works with Firebase & Mixpanel.

3 Languages

EN, PL, AR with full RTL support for Arabic.

Training Finder

AI-powered questionnaire to match users to the right plan.

Theming System

Light/dark mode with full color and typography customization.

Platform support

PlatformLanguageMin versionStatus
FlutterDartiOS 16+, Android API 24+Stable
iOSSwiftiOS 16+Stable
AndroidKotlin 1.7.20+API 24 (Android 7.0)Stable

Requirements

RequirementMinimum
FlutterLatest stable recommended
DartLatest stable recommended
PlatformsiOS 16+, Android API 24+ (Android 7.0)

Bundle size

~5 MB increase on Android. iOS final app size increase is currently being measured.

Permissions

Android — add to AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

iOS — No Info.plist permission keys required.

Offline support not available

When there is no internet connection, users will see an offline error screen. Content is not cached for offline viewing.

Authentication

The integration token is passed as a parameter during SDK initialisation. On Android the token exists in memory only and is not stored locally. On iOS, how the token is stored is determined by the partner app — it can be passed to the SDK as a parameter.

Security

Certificate pinning is not currently implemented. ProGuard/R8 rules are not required.

Installation

Add the Funxtion SDK as a git dependency in your pubspec.yaml.

dependencies:
  funxtion:
    git:
      url: https://github.com/Funxtion-International/funxtion-flutter-sdk.git
      ref: main

The Flutter SDK provides drop-in UI components for video classes, audio workouts, training plans, and discovery.

DiscoveryVideo ClassesAudio ClassesWorkoutsTraining PlansTraining Finder

Initialize SDK

Call Funxtion.init() with your API key, environment, locale, and analytics configuration.

await Funxtion.init(
  apiKey: 'your-api-key',
  environment: FunxtionEnvironment.staging,
  locale: 'en',
  analyticsConfig: FunxtionAnalyticsConfig(
    callback: (event) => trackEvent(event),
    userIdentification: FXTUserIdentification(
      tenantId: 'your-tenant',
    ),
  ),
);

Add localizations

Add FunxtionLocalizations.delegate to your MaterialApp.

return MaterialApp(
  localizationsDelegates: [
    ...FunxtionLocalizations.delegate,
    GlobalMaterialLocalizations.delegate,
    GlobalCupertinoLocalizations.delegate,
  ],
  home: const FXTDashboardView(),
);

Launch dashboard

Set FXTDashboardView as home in your MaterialApp to launch the full fitness dashboard.

Training Finder

Configure FXTSettings with dashboard sections order and Training Finder settings.

settings: FXTSettings(
  dashboard: FXTDashboardSettings(
    sectionsOrder: [
      FXTDashboardSectionType.trainingFinderCard,
    ],
  ),
  recommend: FXTTrainingFinderSettings(
    showTrainingFinder: true,
  ),
),

Analytics events

All events fire automatically. Use the analytics callback to forward them to your own tracking tool.

EventTrigger
didOpenVideoClassPlayerUser opens a video class player
didStartWorkoutUser begins a workout session
didCompleteWorkoutUser finishes a workout
didFollowPlanUser starts following a training plan
didCompletePlanUser completes a training plan
didEnterSearchTermUser performs a search query
didFilterWorkoutsUser applies workout filters

Colour system

The SDK uses a DefaultSDKColorScheme that supports light and dark mode. Use copyWith() to override specific tokens:

final customColors = DefaultSDKColorScheme().copyWith(
  textPrimary: Colors.purple,
  surfaceBackgroundBase: Colors.grey[50],
);
FunxtionTheme.setDefaultColors(customColors);

Access tokens in widgets:

final colors = FunxtionTheme.getColors(context);
colors.primaryColor          // Main brand colour
colors.primaryColorLight     // Lighter variant
colors.primaryColorDark      // Darker variant
colors.surfaceBackgroundBase       // Main background
colors.surfaceBackgroundSecondary  // Secondary background
colors.surfaceBackgroundTertiary   // Tertiary background
colors.textEmphasis    // High emphasis text
colors.textSecondary   // Medium emphasis text
colors.textSubtle      // Low emphasis text
colors.borderPrimary   // Primary borders
colors.borderSecondary // Secondary borders

Typography

final fontStyle = FunxtionTheme.getFont(context);

// Available type styles:
fontStyle.titleXL      // 24sp Bold — page titles
fontStyle.titleLG      // 18sp Bold — section titles
fontStyle.titleXS      // 14sp Bold — card titles
fontStyle.paragraphMD  // 14sp Normal — body text
fontStyle.paragraphSM  // 12sp Normal — small text
fontStyle.labelMD      // 14sp Medium — button labels
fontStyle.labelSM      // 12sp Medium — small labels

// Spacing system:
final spacing = FunxtionTheme.getSpacing(context);

Dashboard layout Flutter only

Operators can reorder dashboard sections and buttons. The order of items in the sections array determines the render order on the dashboard. Remove a type entirely to hide that section.

FunxtionSDKConfig(
  dashboard: FXTDashboardSettings(
    sections: [
      FXTDashboardSectionType.workout,
      FXTDashboardSectionType.trainingPlan,
      FXTDashboardSectionType.buttons,
      FXTDashboardSectionType.video,
      FXTDashboardSectionType.trainingFinderCard,
      FXTDashboardSectionType.followedTrainingPlan,
    ],
    buttons: [
      FXTDashboardButtonType.trainingPlan,
      FXTDashboardButtonType.video,
      FXTDashboardButtonType.workout,
    ],
    dashboardSearchBar: FXTWidgetSettings(
      backgroundColor: Colors.white,
    ),
  ),
)
Note: This configuration is Flutter-specific. iOS and Kotlin dashboards use a fixed layout with section visibility controlled via feature toggles.

Component shadows Flutter only

Configure shadows on buttons and content cards (workouts, videos, training plans).

// Button shadow
FunxtionTheme.setDefaultButtonShadow([
  FXTShadow(
    color: Color(0xFF000000),
    opacity: 0.5,
  ),
]);

// Content card shadow (workouts, videos, training plans)
FunxtionTheme.setDefaultWidgetShadow([
  FXTShadow(),
]);
Note: Shadow settings currently apply to the dashboard interface only.

Workout player theming

The Flutter workout player inherits from the main colour scheme set via FunxtionTheme.setDefaultColors(). No separate provider is needed.

Support

Need help?

Full API docs at docs.funxtion.com · Email development@funxtion.com · Demo apps available on GitHub for all three platforms.

Example
Initialization
// Initialize the SDK
await Funxtion.init(
  apiKey: 'your-api-key',
  environment: FunxtionEnvironment.staging,
  locale: 'en',
  analyticsConfig: FunxtionAnalyticsConfig(
    enabled: true,
    callback: (event) {
      FirebaseAnalytics.logEvent(event);
    },
    userIdentification:
      FXTUserIdentification(
        tenantId: 'your-tenant',
      ),
  ),
);
Dashboard
return MaterialApp(
  localizationsDelegates: [
    ...FunxtionLocalizations.delegate,
    GlobalMaterialLocalizations.delegate,
  ],
  home: const FXTDashboardView(),
);