Schedule.fromJson constructor
Creates a Schedule object from a JSON object.
Implementation
factory Schedule.fromJson(Map<String, dynamic> json) {
return Schedule(
direction0: (json[ApiFields.direction0] as List<dynamic>? ?? [])
.map((direction) =>
ScheduleDirection.fromJson(direction as Map<String, dynamic>))
.toList(),
direction1: (json[ApiFields.direction1] as List<dynamic>? ?? [])
.map((direction) =>
ScheduleDirection.fromJson(direction as Map<String, dynamic>))
.toList(),
name: json[ApiFields.name] ?? '',
);
}