You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.7 KiB
57 lines
1.7 KiB
1 year ago
|
import 'dart:convert';
|
||
|
|
||
|
List<BiddingCartviewModel> biddingCartviewModelFromJson(String str) => List<BiddingCartviewModel>.from(json.decode(str).map((x) => BiddingCartviewModel.fromJson(x)));
|
||
|
|
||
|
String biddingCartviewModelToJson(List<BiddingCartviewModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||
|
|
||
|
class BiddingCartviewModel {
|
||
|
String? id;
|
||
|
String? medicinename_bidding ;
|
||
|
int? quantity_bidding;
|
||
|
double? price_bidding;
|
||
|
List<MedicineTiming>? medicine_timings;
|
||
|
|
||
|
BiddingCartviewModel({
|
||
|
this.id,
|
||
|
this.medicinename_bidding ,
|
||
|
this.quantity_bidding,
|
||
|
this.price_bidding,
|
||
|
this.medicine_timings,
|
||
|
});
|
||
|
|
||
|
factory BiddingCartviewModel.fromJson(Map<String, dynamic> 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<MedicineTiming>.from(json["medicine_timings"]!.map((x) => MedicineTiming.fromJson(x))),
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
"_id": id,
|
||
|
"medicinename": medicinename_bidding ,
|
||
|
"quantity": quantity_bidding,
|
||
|
"price": price_bidding,
|
||
|
"medicine_timings": medicine_timings == null ? [] : List<dynamic>.from(medicine_timings!.map((x) => x.toJson())),
|
||
|
};
|
||
|
}
|
||
|
|
||
|
class MedicineTiming {
|
||
|
String? id;
|
||
|
String? medicineTimings;
|
||
|
|
||
|
MedicineTiming({
|
||
|
this.id,
|
||
|
this.medicineTimings,
|
||
|
});
|
||
|
|
||
|
factory MedicineTiming.fromJson(Map<String, dynamic> json) => MedicineTiming(
|
||
|
id: json["_id"],
|
||
|
medicineTimings: json["medicine_timings"],
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
"_id": id,
|
||
|
"medicine_timings": medicineTimings,
|
||
|
};
|
||
|
}
|