51 lines
1.4 KiB
Dart
51 lines
1.4 KiB
Dart
class PaymentHistoryModel {
|
|
PaymentHistoryModel({this.status, this.error, required this.data});
|
|
final int? status;
|
|
final bool? error;
|
|
final List<List<DataPaymentHistoryModel>> data;
|
|
}
|
|
|
|
class DataPaymentHistoryModel {
|
|
DataPaymentHistoryModel({
|
|
this.orderId,
|
|
this.title,
|
|
this.thumbnail,
|
|
this.instructor,
|
|
this.totalPrice,
|
|
this.date,
|
|
this.paymentType,
|
|
this.statusPayment,
|
|
});
|
|
final String? orderId;
|
|
final String? title;
|
|
final String? thumbnail;
|
|
final String? instructor;
|
|
final String? totalPrice;
|
|
final String? date;
|
|
final String? paymentType;
|
|
final String? statusPayment;
|
|
|
|
factory DataPaymentHistoryModel.fromJson(Map<String, dynamic> json) =>
|
|
DataPaymentHistoryModel(
|
|
orderId: json['order_id'],
|
|
title: json["title"],
|
|
thumbnail: json["thumbnail"] == null ? null : json["thumbnail"],
|
|
instructor: json["instructor"],
|
|
totalPrice: json["total"],
|
|
date: json["date"],
|
|
paymentType: json["payment_type"],
|
|
statusPayment: json["status"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"order_id": orderId,
|
|
"title": title,
|
|
"thumbnail": thumbnail == null ? null : thumbnail,
|
|
"instructor": instructor,
|
|
"total_price": totalPrice,
|
|
"date": date,
|
|
"payment_type": paymentType,
|
|
"status_payment": statusPayment,
|
|
};
|
|
}
|