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

20 lines
556 B
Dart
Raw Normal View History

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