31 lines
772 B
Dart
31 lines
772 B
Dart
class RouteGuideEntry {
|
|
const RouteGuideEntry({
|
|
required this.routeId,
|
|
required this.wasteType,
|
|
required this.schedule,
|
|
required this.days,
|
|
required this.note,
|
|
});
|
|
|
|
final String routeId;
|
|
final String wasteType;
|
|
final String schedule;
|
|
final List<String> days;
|
|
final String note;
|
|
|
|
factory RouteGuideEntry.fromJson(Map<String, dynamic> json) {
|
|
final daysJson = json['days'];
|
|
final days = daysJson is List
|
|
? daysJson.map((day) => day.toString()).toList(growable: false)
|
|
: <String>[];
|
|
|
|
return RouteGuideEntry(
|
|
routeId: json['routeId'].toString(),
|
|
wasteType: json['wasteType'].toString(),
|
|
schedule: json['schedule'].toString(),
|
|
days: days,
|
|
note: json['note'].toString(),
|
|
);
|
|
}
|
|
}
|