startCustomizedWorkout method
Implementation
@override
Future<void> startCustomizedWorkout({
required SMKitWorkout workout,
void Function(SMKitStatus)? onHandle,
}) async {
final argument = {
'smWorkout': workout.toJson().toString(),
};
final subscription =
eventChannel.receiveBroadcastStream().listen((Object? event) {
_onEvent(event, onHandle);
});
try {
await methodChannel.invokeMethod<String>(
'startCustomizedWorkout', argument);
subscription.cancel();
} on PlatformException catch (e) {
debugPrint('PlatformException: ${e.code} ${e.message}');
}
}