toJson method
Converts the interval block to a JSON object
Implementation
Map<String, dynamic> toJson() {
return {
'iterations': iterations,
'steps': steps.map((step) => step.toJson()).toList(),
'type': type.toString().split('.').last,
};
}