toJson method
Converts a CronJobStatus instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempActive = active;
final tempLastScheduleTime = lastScheduleTime;
final tempLastSuccessfulTime = lastSuccessfulTime;
if (tempActive != null) {
jsonData['active'] =
tempActive.map((e) => e.toJson()).toList(growable: false);
}
if (tempLastScheduleTime != null) {
jsonData['lastScheduleTime'] = tempLastScheduleTime;
}
if (tempLastSuccessfulTime != null) {
jsonData['lastSuccessfulTime'] = tempLastSuccessfulTime;
}
return jsonData;
}