20 lines
556 B
Dart
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;
|
||
|
}
|
||
|
}
|