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