import 'dart:convert'; List biddingCartviewModelFromJson(String str) => List.from(json.decode(str).map((x) => BiddingCartviewModel.fromJson(x))); String biddingCartviewModelToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); class BiddingCartviewModel { String? id; String? medicinename_bidding ; int? quantity_bidding; double? price_bidding; List? medicine_timings; BiddingCartviewModel({ this.id, this.medicinename_bidding , this.quantity_bidding, this.price_bidding, this.medicine_timings, }); factory BiddingCartviewModel.fromJson(Map json) => BiddingCartviewModel( id: json["_id"], medicinename_bidding : json["medicinename"], quantity_bidding: json["quantity"], price_bidding: json["price"]?.toDouble(), medicine_timings: json["medicine_timings"] == null ? [] : List.from(json["medicine_timings"]!.map((x) => MedicineTiming.fromJson(x))), ); Map toJson() => { "_id": id, "medicinename": medicinename_bidding , "quantity": quantity_bidding, "price": price_bidding, "medicine_timings": medicine_timings == null ? [] : List.from(medicine_timings!.map((x) => x.toJson())), }; } class MedicineTiming { String? id; String? medicineTimings; MedicineTiming({ this.id, this.medicineTimings, }); factory MedicineTiming.fromJson(Map json) => MedicineTiming( id: json["_id"], medicineTimings: json["medicine_timings"], ); Map toJson() => { "_id": id, "medicine_timings": medicineTimings, }; }