Application/medcify/lib/models/api/timing_response.dart
2022-09-26 12:03:52 +05:30

19 lines
513 B
Dart

import 'package:medcify/models/timing_item.dart';
class TimingResponse{
bool? status;
String? message;
List<TimingItem>? timings;
TimingResponse.fromJson(Map<String, dynamic> json){
status = (json["Code"] ?? "0") != "0";
timings = (json["Data"] != null) ? json["Data"].map<TimingItem>((e) => TimingItem.fromJson(e)).toList() : [];
message = json["Message"] ?? "Something went wrong";
}
TimingResponse.withError(String err){
status = false;
timings = [];
message = err;
}
}