toJson method
Converts the workout to a JSON object
Implementation
@override
Map<String, dynamic> toJson() {
return {
'activityType': activityType.toString().split('.').last,
'workoutType': workoutType.toString().split('.').last,
'location': location.toString().split('.').last,
'displayName': displayName,
'warmup': warmup?.toJson(),
'blocks': blocks.map((block) => block.toJson()).toList(),
'cooldown': cooldown?.toJson(),
};
}