toJson method
Converts the interval step to a JSON object
Implementation
Map<String, dynamic> toJson() {
return {
'purpose': purpose.toString().split('.').last,
'goal': goal?.toJson(),
'step': step?.toJson(),
'alert': alert?.toJson(),
};
}