INFRA: Set Up Project.
This commit is contained in:
49
lib/models/working_hours_model.dart
Normal file
49
lib/models/working_hours_model.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
class WorkingHoursModel {
|
||||
String? day;
|
||||
List<Timeslot>? timeslot;
|
||||
|
||||
WorkingHoursModel({this.day, this.timeslot});
|
||||
|
||||
WorkingHoursModel.fromJson(Map<String, dynamic> json) {
|
||||
day = json['day'];
|
||||
if (json['timeslot'] != null) {
|
||||
timeslot = <Timeslot>[];
|
||||
json['timeslot'].forEach((v) {
|
||||
timeslot!.add(Timeslot.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['day'] = day;
|
||||
if (timeslot != null) {
|
||||
data['timeslot'] = timeslot!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Timeslot {
|
||||
String? from;
|
||||
String? to;
|
||||
|
||||
String? date;
|
||||
|
||||
Timeslot({
|
||||
this.from,
|
||||
this.to,
|
||||
});
|
||||
|
||||
Timeslot.fromJson(Map<String, dynamic> json) {
|
||||
from = json['from'];
|
||||
to = json['to'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['from'] = from;
|
||||
data['to'] = to;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user