You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
3.9 KiB
Dart
128 lines
3.9 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final schedule = scheduleFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
Schedule scheduleFromJson(String str) => Schedule.fromJson(json.decode(str));
|
|
|
|
String scheduleToJson(Schedule data) => json.encode(data.toJson());
|
|
|
|
class Schedule {
|
|
final int? messageStatus;
|
|
final int? totalItemsCount;
|
|
final List<ScheduleData>? data;
|
|
final String? message;
|
|
|
|
Schedule({
|
|
this.messageStatus,
|
|
this.totalItemsCount,
|
|
this.data,
|
|
this.message,
|
|
});
|
|
|
|
factory Schedule.fromJson(Map<String, dynamic> json) => Schedule(
|
|
messageStatus: json["messageStatus"],
|
|
totalItemsCount: json["totalItemsCount"],
|
|
data: json["data"] == null ? [] : List<ScheduleData>.from(json["data"]!.map((x) => ScheduleData.fromJson(x))),
|
|
message: json["message"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"messageStatus": messageStatus,
|
|
"totalItemsCount": totalItemsCount,
|
|
"data": data == null ? [] : List<dynamic>.from(data!.map((x) => x.toJson())),
|
|
"message": message,
|
|
};
|
|
}
|
|
|
|
class ScheduleData {
|
|
final int? id;
|
|
final String? scheduleName;
|
|
final int? serviceProviderBranchId;
|
|
final DateTime? fromDate;
|
|
final DateTime? toDate;
|
|
final String? startTime;
|
|
final String? endTime;
|
|
final int? slotDurationMinute;
|
|
final int? perSlotAppointment;
|
|
final String? branchName;
|
|
final String? address;
|
|
final String? latitude;
|
|
final String? longitude;
|
|
final List<ScheduleService>? scheduleServices;
|
|
String branchId;
|
|
|
|
ScheduleData({
|
|
this.id,
|
|
this.scheduleName,
|
|
this.serviceProviderBranchId,
|
|
this.fromDate,
|
|
this.toDate,
|
|
this.startTime,
|
|
this.endTime,
|
|
this.slotDurationMinute,
|
|
this.perSlotAppointment,
|
|
this.branchName,
|
|
this.address,
|
|
this.latitude,
|
|
this.longitude,
|
|
this.scheduleServices,
|
|
this.branchId = "",
|
|
});
|
|
|
|
factory ScheduleData.fromJson(Map<String, dynamic> json) => ScheduleData(
|
|
id: json["id"],
|
|
scheduleName: json["scheduleName"],
|
|
serviceProviderBranchId: json["serviceProviderBranchID"],
|
|
fromDate: json["fromDate"] == null ? null : DateTime.parse(json["fromDate"]),
|
|
toDate: json["toDate"] == null ? null : DateTime.parse(json["toDate"]),
|
|
startTime: json["startTime"],
|
|
endTime: json["endTime"],
|
|
slotDurationMinute: json["slotDurationMinute"],
|
|
perSlotAppointment: json["perSlotAppointment"],
|
|
branchName: json["branchName"],
|
|
address: json["address"],
|
|
latitude: json["latitude"],
|
|
longitude: json["longitude"],
|
|
scheduleServices: json["scheduleServices"] == null ? [] : List<ScheduleService>.from(json["scheduleServices"]!.map((x) => ScheduleService.fromJson(x))),
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id": id,
|
|
"scheduleName": scheduleName,
|
|
"serviceProviderBranchID": serviceProviderBranchId,
|
|
"fromDate": fromDate?.toIso8601String(),
|
|
"toDate": toDate?.toIso8601String(),
|
|
"startTime": startTime,
|
|
"endTime": endTime,
|
|
"slotDurationMinute": slotDurationMinute,
|
|
"perSlotAppointment": perSlotAppointment,
|
|
"branchName": branchName,
|
|
"address": address,
|
|
"latitude": latitude,
|
|
"longitude": longitude,
|
|
"scheduleServices": scheduleServices == null ? [] : List<dynamic>.from(scheduleServices!.map((x) => x.toJson())),
|
|
};
|
|
}
|
|
|
|
class ScheduleService {
|
|
final int? providerServiceId;
|
|
final String? providerServiceName;
|
|
|
|
ScheduleService({
|
|
this.providerServiceId,
|
|
this.providerServiceName,
|
|
});
|
|
|
|
factory ScheduleService.fromJson(Map<String, dynamic> json) => ScheduleService(
|
|
providerServiceId: json["providerServiceID"],
|
|
providerServiceName: json["providerServiceName"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"providerServiceID": providerServiceId,
|
|
"providerServiceName": providerServiceName,
|
|
};
|
|
}
|