flutter_smkit_ui 1.4.1
flutter_smkit_ui: ^1.4.1 copied to clipboard
Flutter Plugin for Sency's SMKitUI
SMKitUI Flutter Plugin (v1.4.1) #
A Flutter plugin for integrating Sency's SMKitUI SDK, supporting both iOS and Android. Run fitness, body360, strength, cardio, and custom assessments and workouts with unified user data, summary options, skeleton visualization, and runtime modifications.
Requirements #
- Flutter: 3.3.0+
- Dart: 3.3.4+
- iOS: 16.0+, SMKitUI 1.5.3, SMKit (auto-pulled)
- Android: minSdk 26, compileSdk 36, SMKitUI 1.5.1, Kotlin 2.0, Java 17
Getting Started #
1. Configure #
final _smkitUiFlutterPlugin = SmkitUiFlutterPlugin();
await _smkitUiFlutterPlugin.configure(key: apiPublicKey);
2. Apply SDK Config (Optional) #
await _smkitUiFlutterPlugin.setConfig(
config: SMKitConfig(
enableIntelligenceRest: true,
allowAudioMixing: false,
instructionVideoConfig: InstructionVideoConfig(
displayMode: InstructionVideoDisplayMode.mediumCycle,
mediumSizeCycles: 2,
),
skeletonConfig: SkeletonConfig(preset: SkeletonPreset.neonGlow),
pauseTypes: [SMKitPauseType.resume, SMKitPauseType.quit],
),
);
3. Set Preferences (Optional, fire-and-forget) #
_smkitUiFlutterPlugin.setSessionLanguage(language: SMKitLanguage.english);
_smkitUiFlutterPlugin.setCounterPreferences(counterPreferences: SMKitCounterPreferences.perfectOnly);
_smkitUiFlutterPlugin.setEndExercisePreferences(endExercisePrefernces: SMKitEndExercisePreferences.targetBased);
4. Start an Assessment #
_smkitUiFlutterPlugin.startAssessment(
type: AssessmentTypes.body360, // fitness, body360, strength, cardio, custom
userData: {
'gender': 'Male', // or 'Female', 'Idle'
'birthday': DateTime(1990, 1, 1).millisecondsSinceEpoch,
},
showSummary: true,
forceShowUserDataScreen: false,
modifications: {
'primaryColor': '#4CAF50',
'phoneCalibration': {'enabled': true},
},
onHandle: (status) {
if (status.operation == SMKitOperation.assessmentSummaryData) {
final summary = status.data as SMKitAssessmentSummaryData;
} else if (status.operation == SMKitOperation.error) {
final error = status.data as SMKitError;
}
},
);
5. Start a Customized Workout #
_smkitUiFlutterPlugin.startCustomizedWorkout(
workout: SMKitWorkout(
id: '1',
name: 'My Workout',
exercises: [...],
),
modifications: {'primaryColor': '#2196F3'},
onHandle: (status) { ... },
);
6. Start a Customized Assessment #
_smkitUiFlutterPlugin.startCustomizedAssessment(
assessment: myAssessment,
showSummary: true,
forceShowUserDataScreen: false,
modifications: {'primaryColor': '#FF9800'},
onHandle: (status) { ... },
);
7. Start a Workout Program #
_smkitUiFlutterPlugin.startWorkoutProgram(
config: WorkoutConfig(
programId: 'my-program-id',
week: 1,
bodyZone: BodyZone.fullBody,
difficultyLevel: DifficultyLevel.midDifficulty,
workoutDuration: WorkoutDuration.short,
language: SencySupportedLanguage.english,
),
modifications: {'primaryColor': '#4CAF50'},
onHandle: (status) { ... },
);
SMKitConfig Reference #
| Field | Type | Description |
|---|---|---|
enableIntelligenceRest |
bool? |
Enable AI-based rest detection |
allowAudioMixing |
bool? |
Allow app audio to mix with SDK audio |
showExternalAudioControl |
bool? |
Show external audio control button |
enableWatchCompanion |
bool? |
Enable Apple Watch companion |
accuratePoseEstimation |
bool? |
Enable high-accuracy pose estimation |
showRowingPhoneCalibration |
bool? |
Show rowing phone calibration screen |
skeletonConfig |
SkeletonConfig? |
Skeleton visualization settings |
pauseTypes |
List<SMKitPauseType>? |
Pause overlay buttons |
instructionVideoConfig |
InstructionVideoConfig? |
Instruction video display mode |
SkeletonConfig #
Customize skeleton overlay: preset, connectionStyle, jointShape, dotsOpacity, connectionsOpacity, dotsInnerColor, dotsOuterColor, dotsGlow, connectionsGlow, lineWidthScale, outlineScale, softness, animationDuration, hidden.
Modifications Map #
| Key | Type | Description |
|---|---|---|
primaryColor |
String |
Hex color for UI theme (maps to green/blue/orange/purple/silver/gold/pink) |
phoneCalibration.enabled |
bool |
Show/hide phone calibration screen |
Platform Notes #
forceShowUserDataScreenis iOS-only.SMKitPauseType.restandswitchExerciseare Android-only.WorkoutConfigenums use PascalCase on the wire (FullBody,MidDifficulty,Short,English).
Changelog #
See CHANGELOG.md for details.
License #
MIT