// To parse this JSON data, do // // final refundResponse = refundResponseFromJson(jsonString); import 'dart:convert'; RefundResponse refundResponseFromJson(String str) => RefundResponse.fromJson(json.decode(str)); String refundResponseToJson(RefundResponse data) => json.encode(data.toJson()); class RefundResponse { List data; Links links; Meta meta; RefundResponse({ required this.data, required this.links, required this.meta, }); factory RefundResponse.fromJson(Map json) => RefundResponse( data: List.from(json["data"].map((x) => RefundInfo.fromJson(x))), links: Links.fromJson(json["links"]), meta: Meta.fromJson(json["meta"]), ); Map toJson() => { "data": List.from(data.map((x) => x.toJson())), "links": links.toJson(), "meta": meta.toJson(), }; } class RefundInfo { int id; String orderCode; String amount; String productName; String status; dynamic reson; String date; RefundInfo({ required this.id, required this.orderCode, required this.amount, required this.productName, required this.status, this.reson, required this.date, }); factory RefundInfo.fromJson(Map json) => RefundInfo( id: json["id"], orderCode: json["order_code"], amount: json["amount"], productName: json["product_name"], status: json["status"], reson: json["reson"], date: json["date"], ); Map toJson() => { "id": id, "order_code": orderCode, "amount": amount, "product_name": productName, "status": status, "reson": reson, "date": date, }; } class Links { String first; String last; dynamic prev; dynamic next; Links({ required this.first, required this.last, this.prev, this.next, }); factory Links.fromJson(Map json) => Links( first: json["first"], last: json["last"], prev: json["prev"], next: json["next"], ); Map toJson() => { "first": first, "last": last, "prev": prev, "next": next, }; } class Meta { int currentPage; int? from; int lastPage; List links; String path; String perPage; int? to; int total; Meta({ required this.currentPage, this.from, required this.lastPage, required this.links, required this.path, required this.perPage, this.to, required this.total, }); factory Meta.fromJson(Map json) => Meta( currentPage: json["current_page"], from: json["from"], lastPage: json["last_page"], links: List.from(json["links"].map((x) => Link.fromJson(x))), path: json["path"], perPage: json["per_page"], to: json["to"], total: json["total"], ); Map toJson() => { "current_page": currentPage, "from": from, "last_page": lastPage, "links": List.from(links.map((x) => x.toJson())), "path": path, "per_page": perPage, "to": to, "total": total, }; } class Link { String? url; String label; bool active; Link({ this.url, required this.label, required this.active, }); factory Link.fromJson(Map json) => Link( url: json["url"], label: json["label"], active: json["active"], ); Map toJson() => { "url": url, "label": label, "active": active, }; }