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

20 lines
556 B
Dart

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