Application/medcify/lib/models/api/timing_response.dart

19 lines
513 B
Dart
Raw Normal View History

2022-09-26 06:33:52 +00:00
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;
}
}