codigo actual del servidor, con avances de joan
This commit is contained in:
194
source_code/lib/data_model/RefundOrderResponse.dart
Normal file
194
source_code/lib/data_model/RefundOrderResponse.dart
Normal file
@@ -0,0 +1,194 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final refundOrderResponse = refundOrderResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
RefundOrderResponse refundOrderResponseFromJson(String str) => RefundOrderResponse.fromJson(json.decode(str));
|
||||
|
||||
String refundOrderResponseToJson(RefundOrderResponse data) => json.encode(data.toJson());
|
||||
|
||||
class RefundOrderResponse {
|
||||
RefundOrderResponse({
|
||||
this.data,
|
||||
this.links,
|
||||
this.meta,
|
||||
this.success,
|
||||
this.status,
|
||||
});
|
||||
|
||||
List<Datum>? data;
|
||||
Links? links;
|
||||
Meta? meta;
|
||||
bool? success;
|
||||
var status;
|
||||
|
||||
factory RefundOrderResponse.fromJson(Map<String, dynamic> json) => RefundOrderResponse(
|
||||
data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
|
||||
links: Links.fromJson(json["links"]),
|
||||
meta: Meta.fromJson(json["meta"]),
|
||||
success: json["success"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"links": links!.toJson(),
|
||||
"meta": meta!.toJson(),
|
||||
"success": success,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class Datum {
|
||||
Datum({
|
||||
this.id,
|
||||
this.userId,
|
||||
this.orderCode,
|
||||
this.productName,
|
||||
this.productPrice,
|
||||
this.refundStatus,
|
||||
this.refundLabel,
|
||||
this.seller_approval,
|
||||
this.refundReson,
|
||||
this.rejectReson,
|
||||
this.date,
|
||||
});
|
||||
|
||||
int? id;
|
||||
int? userId;
|
||||
String? orderCode;
|
||||
String? productName;
|
||||
String? productPrice;
|
||||
var refundStatus;
|
||||
var seller_approval;
|
||||
String? refundLabel;
|
||||
String? rejectReson;
|
||||
String? refundReson;
|
||||
|
||||
String? date;
|
||||
|
||||
factory Datum.fromJson(Map<String, dynamic> json) => Datum(
|
||||
id: json["id"],
|
||||
userId: json["user_id"],
|
||||
orderCode: json["order_code"],
|
||||
productName: json["product_name"],
|
||||
productPrice: json["product_price"],
|
||||
refundStatus: json["refund_status"],
|
||||
refundLabel: json["refund_label"],
|
||||
seller_approval: json["seller_approval"],
|
||||
refundReson: json["reason"],
|
||||
rejectReson: json["reject_reason"],
|
||||
date: json["date"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"user_id": userId,
|
||||
"order_code": orderCode,
|
||||
"product_name": productName,
|
||||
"product_price": productPrice,
|
||||
"refund_status": refundStatus,
|
||||
"refund_label": refundLabel,
|
||||
"seller_approval": seller_approval,
|
||||
"reason": refundReson,
|
||||
"reject_reason": rejectReson,
|
||||
"date": date,
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.first,
|
||||
this.last,
|
||||
this.prev,
|
||||
this.next,
|
||||
});
|
||||
|
||||
String? first;
|
||||
String? last;
|
||||
dynamic prev;
|
||||
dynamic next;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
first: json["first"],
|
||||
last: json["last"],
|
||||
prev: json["prev"],
|
||||
next: json["next"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"first": first,
|
||||
"last": last,
|
||||
"prev": prev,
|
||||
"next": next,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
Meta({
|
||||
this.currentPage,
|
||||
this.from,
|
||||
this.lastPage,
|
||||
this.links,
|
||||
this.path,
|
||||
this.perPage,
|
||||
this.to,
|
||||
this.total,
|
||||
});
|
||||
|
||||
int? currentPage;
|
||||
int? from;
|
||||
int? lastPage;
|
||||
List<Link>? links;
|
||||
String? path;
|
||||
int? perPage;
|
||||
int? to;
|
||||
int? total;
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
currentPage: json["current_page"],
|
||||
from: json["from"],
|
||||
lastPage: json["last_page"],
|
||||
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
|
||||
path: json["path"],
|
||||
perPage: json["per_page"],
|
||||
to: json["to"],
|
||||
total: json["total"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_page": currentPage,
|
||||
"from": from,
|
||||
"last_page": lastPage,
|
||||
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
|
||||
"path": path,
|
||||
"per_page": perPage,
|
||||
"to": to,
|
||||
"total": total,
|
||||
};
|
||||
}
|
||||
|
||||
class Link {
|
||||
Link({
|
||||
this.url,
|
||||
this.label,
|
||||
this.active,
|
||||
});
|
||||
|
||||
String? url;
|
||||
String? label;
|
||||
bool? active;
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) => Link(
|
||||
url: json["url"] == null ? null : json["url"],
|
||||
label: json["label"],
|
||||
active: json["active"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url == null ? null : url,
|
||||
"label": label,
|
||||
"active": active,
|
||||
};
|
||||
}
|
||||
57
source_code/lib/data_model/addon_response.dart
Normal file
57
source_code/lib/data_model/addon_response.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final addonResponse = addonResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
List<AddonResponse> addonResponseFromJson(String str) => List<AddonResponse>.from(json.decode(str).map((x) => AddonResponse.fromJson(x)).toList());
|
||||
|
||||
String addonResponseToJson(List<AddonResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||
|
||||
class AddonResponse {
|
||||
AddonResponse({
|
||||
this.id,
|
||||
this.name,
|
||||
this.uniqueIdentifier,
|
||||
this.version,
|
||||
this.activated,
|
||||
this.image,
|
||||
this.purchaseCode,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? uniqueIdentifier;
|
||||
String? version;
|
||||
var activated;
|
||||
String? image;
|
||||
String? purchaseCode;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
factory AddonResponse.fromJson(Map<String, dynamic> json) => AddonResponse(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
uniqueIdentifier: json["unique_identifier"],
|
||||
version: json["version"],
|
||||
activated: json["activated"],
|
||||
image: json["image"],
|
||||
purchaseCode: json["purchase_code"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"unique_identifier": uniqueIdentifier,
|
||||
"version": version,
|
||||
"activated": activated,
|
||||
"image": image,
|
||||
"purchase_code": purchaseCode,
|
||||
"created_at": createdAt!.toIso8601String(),
|
||||
"updated_at": updatedAt!.toIso8601String(),
|
||||
};
|
||||
}
|
||||
37
source_code/lib/data_model/business_setting_response.dart
Normal file
37
source_code/lib/data_model/business_setting_response.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final businessSettingListResponse = businessSettingListResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
List<BusinessSettingListResponse> businessSettingListResponseFromJson(String str) => List<BusinessSettingListResponse>.from(json.decode(str).map((x) => BusinessSettingListResponse.fromJson(x)));
|
||||
|
||||
String businessSettingListResponseToJson(List<BusinessSettingListResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||
|
||||
class BusinessSettingListResponse {
|
||||
BusinessSettingListResponse({
|
||||
this.id,
|
||||
this.type,
|
||||
this.value,
|
||||
this.lang,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? type;
|
||||
var value;
|
||||
dynamic lang;
|
||||
|
||||
factory BusinessSettingListResponse.fromJson(Map<String, dynamic> json) => BusinessSettingListResponse(
|
||||
id: json["id"],
|
||||
type: json["type"],
|
||||
value: json["value"],
|
||||
lang: json["lang"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"type": type,
|
||||
"value": value,
|
||||
"lang": lang,
|
||||
};
|
||||
}
|
||||
89
source_code/lib/data_model/category_response.dart
Normal file
89
source_code/lib/data_model/category_response.dart
Normal file
@@ -0,0 +1,89 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final categoryResponse = categoryResponseFromJson(jsonString);
|
||||
//https://app.quicktype.io/
|
||||
import 'dart:convert';
|
||||
|
||||
CategoryResponse categoryResponseFromJson(String str) => CategoryResponse.fromJson(json.decode(str));
|
||||
|
||||
String categoryResponseToJson(CategoryResponse data) => json.encode(data.toJson());
|
||||
|
||||
class CategoryResponse {
|
||||
CategoryResponse({
|
||||
this.categories,
|
||||
this.success,
|
||||
this.status,
|
||||
});
|
||||
|
||||
List<Category>? categories;
|
||||
bool? success;
|
||||
var status;
|
||||
|
||||
factory CategoryResponse.fromJson(Map<String, dynamic> json) => CategoryResponse(
|
||||
categories: List<Category>.from(json["data"].map((x) => Category.fromJson(x))),
|
||||
success: json["success"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(categories!.map((x) => x.toJson())),
|
||||
"success": success,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class Category {
|
||||
Category({
|
||||
this.id,
|
||||
this.name,
|
||||
this.banner,
|
||||
this.icon,
|
||||
this.number_of_children,
|
||||
this.links,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? banner;
|
||||
String? icon;
|
||||
int? number_of_children;
|
||||
Links? links;
|
||||
|
||||
factory Category.fromJson(Map<String, dynamic> json) => Category(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
banner: json["banner"],
|
||||
icon: json["icon"],
|
||||
number_of_children: json["number_of_children"],
|
||||
links: Links.fromJson(json["links"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"banner": banner,
|
||||
"icon": icon,
|
||||
"number_of_children": number_of_children,
|
||||
"links": links!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.products,
|
||||
this.subCategories,
|
||||
});
|
||||
|
||||
String? products;
|
||||
String? subCategories;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
products: json["products"],
|
||||
subCategories: json["sub_categories"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"products": products,
|
||||
"sub_categories": subCategories,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final CategoryWiseProductResponse = CategoryWiseProductResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
List<CategoryWiseProductResponse> categoryWiseProductResponseFromJson(String str) => List<CategoryWiseProductResponse>.from(json.decode(str).map((x) => CategoryWiseProductResponse.fromJson(x)));
|
||||
|
||||
String categoryWiseProductResponseToJson(List<CategoryWiseProductResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||
|
||||
class CategoryWiseProductResponse {
|
||||
CategoryWiseProductResponse({
|
||||
this.name,
|
||||
this.cntProduct,
|
||||
this.banner,
|
||||
});
|
||||
|
||||
String? name;
|
||||
int? cntProduct;
|
||||
String? banner;
|
||||
|
||||
factory CategoryWiseProductResponse.fromJson(Map<String, dynamic> json) => CategoryWiseProductResponse(
|
||||
name: json["name"],
|
||||
cntProduct: json["cnt_product"],
|
||||
banner: json["banner"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"name": name,
|
||||
"cnt_product": cntProduct,
|
||||
"banner": banner,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/chart_response.dart
Normal file
29
source_code/lib/data_model/chart_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final chartResponse = chartResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
List<ChartResponse> chartResponseFromJson(String str) => List<ChartResponse>.from(json.decode(str).map((x) => ChartResponse.fromJson(x)));
|
||||
|
||||
String chartResponseToJson(List<ChartResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||
|
||||
class ChartResponse {
|
||||
ChartResponse({
|
||||
this.total,
|
||||
this.date,
|
||||
});
|
||||
|
||||
double? total;
|
||||
String? date;
|
||||
|
||||
factory ChartResponse.fromJson(Map<String, dynamic> json) => ChartResponse(
|
||||
total: json["total"].toDouble(),
|
||||
date: json["date"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"total": total,
|
||||
"date": date,
|
||||
};
|
||||
}
|
||||
53
source_code/lib/data_model/chat_list_response.dart
Normal file
53
source_code/lib/data_model/chat_list_response.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final ChatListResponse = ChatListResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ChatListResponse chatListResponseFromJson(String str) => ChatListResponse.fromJson(json.decode(str));
|
||||
|
||||
String chatListResponseToJson(ChatListResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ChatListResponse {
|
||||
ChatListResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<Chat>? data;
|
||||
|
||||
factory ChatListResponse.fromJson(Map<String, dynamic> json) => ChatListResponse(
|
||||
data: List<Chat>.from(json["data"].map((x) => Chat.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Chat {
|
||||
Chat({
|
||||
this.id,
|
||||
this.image,
|
||||
this.name,
|
||||
this.title,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? image;
|
||||
String? name;
|
||||
String? title;
|
||||
|
||||
factory Chat.fromJson(Map<String, dynamic> json) => Chat(
|
||||
id: json["id"],
|
||||
image: json["image"],
|
||||
name: json["name"],
|
||||
title: json["title"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"image": image,
|
||||
"name": name,
|
||||
"title": title,
|
||||
};
|
||||
}
|
||||
161
source_code/lib/data_model/commission_history_response.dart
Normal file
161
source_code/lib/data_model/commission_history_response.dart
Normal file
@@ -0,0 +1,161 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final CommissionHistoryResponse = CommissionHistoryResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
CommissionHistoryResponse commissionHistoryResponseFromJson(String str) => CommissionHistoryResponse.fromJson(json.decode(str));
|
||||
|
||||
String commissionHistoryResponseToJson(CommissionHistoryResponse data) => json.encode(data.toJson());
|
||||
|
||||
class CommissionHistoryResponse {
|
||||
CommissionHistoryResponse({
|
||||
this.data,
|
||||
this.links,
|
||||
this.meta,
|
||||
});
|
||||
|
||||
List<Commission>? data;
|
||||
Links? links;
|
||||
Meta? meta;
|
||||
|
||||
factory CommissionHistoryResponse.fromJson(Map<String, dynamic> json) => CommissionHistoryResponse(
|
||||
data: List<Commission>.from(json["data"].map((x) => Commission.fromJson(x))),
|
||||
links: Links.fromJson(json["links"]),
|
||||
meta: Meta.fromJson(json["meta"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"links": links!.toJson(),
|
||||
"meta": meta!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Commission {
|
||||
Commission({
|
||||
this.id,
|
||||
this.orderCode,
|
||||
this.adminCommission,
|
||||
this.sellerEarning,
|
||||
this.createdAt,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? orderCode;
|
||||
var adminCommission;
|
||||
String? sellerEarning;
|
||||
String? createdAt;
|
||||
|
||||
factory Commission.fromJson(Map<String, dynamic> json) => Commission(
|
||||
id: json["id"],
|
||||
orderCode: json["order_code"],
|
||||
adminCommission: json["admin_commission"],
|
||||
sellerEarning: json["seller_earning"],
|
||||
createdAt: json["created_at"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"order_code": orderCode,
|
||||
"admin_commission": adminCommission,
|
||||
"seller_earning": sellerEarning,
|
||||
"created_at": createdAt,
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.first,
|
||||
this.last,
|
||||
this.prev,
|
||||
this.next,
|
||||
});
|
||||
|
||||
String? first;
|
||||
String? last;
|
||||
dynamic prev;
|
||||
dynamic next;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
first: json["first"],
|
||||
last: json["last"],
|
||||
prev: json["prev"],
|
||||
next: json["next"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"first": first,
|
||||
"last": last,
|
||||
"prev": prev,
|
||||
"next": next,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
Meta({
|
||||
this.currentPage,
|
||||
this.from,
|
||||
this.lastPage,
|
||||
this.links,
|
||||
this.path,
|
||||
this.perPage,
|
||||
this.to,
|
||||
this.total,
|
||||
});
|
||||
|
||||
int? currentPage;
|
||||
int? from;
|
||||
int? lastPage;
|
||||
List<Link>? links;
|
||||
String? path;
|
||||
int? perPage;
|
||||
int? to;
|
||||
int? total;
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
currentPage: json["current_page"],
|
||||
from: json["from"],
|
||||
lastPage: json["last_page"],
|
||||
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
|
||||
path: json["path"],
|
||||
perPage: json["per_page"],
|
||||
to: json["to"],
|
||||
total: json["total"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_page": currentPage,
|
||||
"from": from,
|
||||
"last_page": lastPage,
|
||||
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
|
||||
"path": path,
|
||||
"per_page": perPage,
|
||||
"to": to,
|
||||
"total": total,
|
||||
};
|
||||
}
|
||||
|
||||
class Link {
|
||||
Link({
|
||||
this.url,
|
||||
this.label,
|
||||
this.active,
|
||||
});
|
||||
|
||||
String? url;
|
||||
String? label;
|
||||
bool? active;
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) => Link(
|
||||
url: json["url"] == null ? null : json["url"],
|
||||
label: json["label"],
|
||||
active: json["active"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url == null ? null : url,
|
||||
"label": label,
|
||||
"active": active,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/common_response.dart
Normal file
29
source_code/lib/data_model/common_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final CommonResponse = CommonResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
CommonResponse commonResponseFromJson(String str) => CommonResponse.fromJson(json.decode(str));
|
||||
|
||||
String commonResponseToJson(CommonResponse data) => json.encode(data.toJson());
|
||||
|
||||
class CommonResponse {
|
||||
CommonResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
dynamic message;
|
||||
|
||||
factory CommonResponse.fromJson(Map<String, dynamic> json) => CommonResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
63
source_code/lib/data_model/country_response.dart
Normal file
63
source_code/lib/data_model/country_response.dart
Normal file
@@ -0,0 +1,63 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final countryResponse = countryResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
CountryResponse countryResponseFromJson(String str) => CountryResponse.fromJson(json.decode(str));
|
||||
|
||||
String countryResponseToJson(CountryResponse data) => json.encode(data.toJson());
|
||||
|
||||
class CountryResponse {
|
||||
CountryResponse({
|
||||
this.countries,
|
||||
this.success,
|
||||
this.status,
|
||||
});
|
||||
|
||||
List<Country>? countries;
|
||||
bool? success;
|
||||
int? status;
|
||||
|
||||
factory CountryResponse.fromJson(Map<String, dynamic> json) => CountryResponse(
|
||||
countries: List<Country>.from(json["data"].map((x) => Country.fromJson(x))),
|
||||
success: json["success"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(countries!.map((x) => x.toJson())),
|
||||
"success": success,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class Country {
|
||||
Country({
|
||||
this.id,
|
||||
this.code,
|
||||
this.name,
|
||||
this.status,
|
||||
});
|
||||
|
||||
@override toString() => '$name';
|
||||
|
||||
int? id;
|
||||
String? code;
|
||||
String? name;
|
||||
int? status;
|
||||
|
||||
factory Country.fromJson(Map<String, dynamic> json) => Country(
|
||||
id: json["id"],
|
||||
code: json["code"],
|
||||
name: json["name"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"code": code,
|
||||
"name": name,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/coupon_create_response.dart
Normal file
29
source_code/lib/data_model/coupon_create_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final couponCreateResponse = couponCreateResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
CouponCreateResponse couponCreateResponseFromJson(String str) => CouponCreateResponse.fromJson(json.decode(str));
|
||||
|
||||
String couponCreateResponseToJson(CouponCreateResponse data) => json.encode(data.toJson());
|
||||
|
||||
class CouponCreateResponse {
|
||||
CouponCreateResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
var message;
|
||||
|
||||
factory CouponCreateResponse.fromJson(Map<String, dynamic> json) => CouponCreateResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
65
source_code/lib/data_model/coupon_list_response.dart
Normal file
65
source_code/lib/data_model/coupon_list_response.dart
Normal file
@@ -0,0 +1,65 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final couponListResponse = couponListResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
CouponListResponse couponListResponseFromJson(String str) => CouponListResponse.fromJson(json.decode(str));
|
||||
|
||||
String couponListResponseToJson(CouponListResponse data) => json.encode(data.toJson());
|
||||
|
||||
class CouponListResponse {
|
||||
CouponListResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<Coupon>? data;
|
||||
|
||||
factory CouponListResponse.fromJson(Map<String, dynamic> json) => CouponListResponse(
|
||||
data: List<Coupon>.from(json["data"].map((x) => Coupon.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Coupon {
|
||||
Coupon({
|
||||
this.id,
|
||||
this.type,
|
||||
this.code,
|
||||
this.discount,
|
||||
this.discountType,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? type;
|
||||
String? code;
|
||||
var discount;
|
||||
String? discountType;
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
|
||||
factory Coupon.fromJson(Map<String, dynamic> json) => Coupon(
|
||||
id: json["id"],
|
||||
type: json["type"],
|
||||
code: json["code"],
|
||||
discount: json["discount"],
|
||||
discountType: json["discount_type"],
|
||||
startDate: json["start_date"],
|
||||
endDate: json["end_date"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"type": type,
|
||||
"code": code,
|
||||
"discount": discount,
|
||||
"discount_type": discountType,
|
||||
"start_date": startDate,
|
||||
"end_date": endDate,
|
||||
};
|
||||
}
|
||||
69
source_code/lib/data_model/edit_coupon_response.dart
Normal file
69
source_code/lib/data_model/edit_coupon_response.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final editCouponResponse = editCouponResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
EditCouponResponse editCouponResponseFromJson(String str) => EditCouponResponse.fromJson(json.decode(str));
|
||||
|
||||
String editCouponResponseToJson(EditCouponResponse data) => json.encode(data.toJson());
|
||||
|
||||
class EditCouponResponse {
|
||||
EditCouponResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
Data? data;
|
||||
|
||||
factory EditCouponResponse.fromJson(Map<String, dynamic> json) => EditCouponResponse(
|
||||
data: Data.fromJson(json["data"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": data!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Data {
|
||||
Data({
|
||||
this.id,
|
||||
this.type,
|
||||
this.code,
|
||||
this.details,
|
||||
this.discount,
|
||||
this.discountType,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? type;
|
||||
String? code;
|
||||
String? details;
|
||||
var discount;
|
||||
String? discountType;
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
|
||||
factory Data.fromJson(Map<String, dynamic> json) => Data(
|
||||
id: json["id"],
|
||||
type: json["type"],
|
||||
code: json["code"],
|
||||
details: json["details"],
|
||||
discount: json["discount"],
|
||||
discountType: json["discount_type"],
|
||||
startDate: json["start_date"],
|
||||
endDate: json["end_date"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"type": type,
|
||||
"code": code,
|
||||
"details": details,
|
||||
"discount": discount,
|
||||
"discount_type": discountType,
|
||||
"start_date": startDate,
|
||||
"end_date": endDate,
|
||||
};
|
||||
}
|
||||
165
source_code/lib/data_model/google_location_details_response.dart
Normal file
165
source_code/lib/data_model/google_location_details_response.dart
Normal file
@@ -0,0 +1,165 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final googleLocationDetailsResponse = googleLocationDetailsResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
GoogleLocationDetailsResponse googleLocationDetailsResponseFromJson(String str) => GoogleLocationDetailsResponse.fromJson(json.decode(str));
|
||||
|
||||
String googleLocationDetailsResponseToJson(GoogleLocationDetailsResponse data) => json.encode(data.toJson());
|
||||
|
||||
class GoogleLocationDetailsResponse {
|
||||
GoogleLocationDetailsResponse({
|
||||
this.htmlAttributions,
|
||||
this.result,
|
||||
this.status,
|
||||
});
|
||||
|
||||
List<dynamic>? htmlAttributions;
|
||||
Result? result;
|
||||
String? status;
|
||||
|
||||
factory GoogleLocationDetailsResponse.fromJson(Map<String, dynamic> json) => GoogleLocationDetailsResponse(
|
||||
htmlAttributions: List<dynamic>.from(json["html_attributions"].map((x) => x)),
|
||||
result: Result.fromJson(json["result"]),
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"html_attributions": List<dynamic>.from(htmlAttributions!.map((x) => x)),
|
||||
"result": result!.toJson(),
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class Result {
|
||||
Result({
|
||||
this.addressComponents,
|
||||
this.formattedAddress,
|
||||
this.geometry,
|
||||
this.placeId,
|
||||
this.reference,
|
||||
this.types,
|
||||
this.url,
|
||||
this.utcOffset,
|
||||
this.vicinity,
|
||||
});
|
||||
|
||||
List<AddressComponent>? addressComponents;
|
||||
String? formattedAddress;
|
||||
Geometry? geometry;
|
||||
String? placeId;
|
||||
String? reference;
|
||||
List<String>? types;
|
||||
String? url;
|
||||
int? utcOffset;
|
||||
String? vicinity;
|
||||
|
||||
factory Result.fromJson(Map<String, dynamic> json) => Result(
|
||||
addressComponents: List<AddressComponent>.from(json["address_components"].map((x) => AddressComponent.fromJson(x))),
|
||||
formattedAddress: json["formatted_address"],
|
||||
geometry: Geometry.fromJson(json["geometry"]),
|
||||
placeId: json["place_id"],
|
||||
reference: json["reference"],
|
||||
types: List<String>.from(json["types"].map((x) => x)),
|
||||
url: json["url"],
|
||||
utcOffset: json["utc_offset"],
|
||||
vicinity: json["vicinity"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"address_components": List<dynamic>.from(addressComponents!.map((x) => x.toJson())),
|
||||
"formatted_address": formattedAddress,
|
||||
"geometry": geometry!.toJson(),
|
||||
"place_id": placeId,
|
||||
"reference": reference,
|
||||
"types": List<dynamic>.from(types!.map((x) => x)),
|
||||
"url": url,
|
||||
"utc_offset": utcOffset,
|
||||
"vicinity": vicinity,
|
||||
};
|
||||
}
|
||||
|
||||
class AddressComponent {
|
||||
AddressComponent({
|
||||
this.longName,
|
||||
this.shortName,
|
||||
this.types,
|
||||
});
|
||||
|
||||
String? longName;
|
||||
String? shortName;
|
||||
List<String>? types;
|
||||
|
||||
factory AddressComponent.fromJson(Map<String, dynamic> json) => AddressComponent(
|
||||
longName: json["long_name"],
|
||||
shortName: json["short_name"],
|
||||
types: List<String>.from(json["types"].map((x) => x)),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"long_name": longName,
|
||||
"short_name": shortName,
|
||||
"types": List<dynamic>.from(types!.map((x) => x)),
|
||||
};
|
||||
}
|
||||
|
||||
class Geometry {
|
||||
Geometry({
|
||||
this.location,
|
||||
this.viewport,
|
||||
});
|
||||
|
||||
Location? location;
|
||||
Viewport? viewport;
|
||||
|
||||
factory Geometry.fromJson(Map<String, dynamic> json) => Geometry(
|
||||
location: Location.fromJson(json["location"]),
|
||||
viewport: Viewport.fromJson(json["viewport"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"location": location!.toJson(),
|
||||
"viewport": viewport!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Location {
|
||||
Location({
|
||||
this.lat,
|
||||
this.lng,
|
||||
});
|
||||
|
||||
double? lat;
|
||||
double? lng;
|
||||
|
||||
factory Location.fromJson(Map<String, dynamic> json) => Location(
|
||||
lat: json["lat"].toDouble(),
|
||||
lng: json["lng"].toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"lat": lat,
|
||||
"lng": lng,
|
||||
};
|
||||
}
|
||||
|
||||
class Viewport {
|
||||
Viewport({
|
||||
this.northeast,
|
||||
this.southwest,
|
||||
});
|
||||
|
||||
Location? northeast;
|
||||
Location? southwest;
|
||||
|
||||
factory Viewport.fromJson(Map<String, dynamic> json) => Viewport(
|
||||
northeast: Location.fromJson(json["northeast"]),
|
||||
southwest: Location.fromJson(json["southwest"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"northeast": northeast!.toJson(),
|
||||
"southwest": southwest!.toJson(),
|
||||
};
|
||||
}
|
||||
73
source_code/lib/data_model/language_list_response.dart
Normal file
73
source_code/lib/data_model/language_list_response.dart
Normal file
@@ -0,0 +1,73 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final languageListResponse = languageListResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
LanguageListResponse languageListResponseFromJson(String str) => LanguageListResponse.fromJson(json.decode(str));
|
||||
|
||||
String languageListResponseToJson(LanguageListResponse data) => json.encode(data.toJson());
|
||||
|
||||
class LanguageListResponse {
|
||||
LanguageListResponse({
|
||||
this.languages,
|
||||
this.success,
|
||||
this.status,
|
||||
});
|
||||
|
||||
List<Language>? languages;
|
||||
bool? success;
|
||||
int? status;
|
||||
|
||||
factory LanguageListResponse.fromJson(Map<String, dynamic> json) => LanguageListResponse(
|
||||
languages: List<Language>.from(json["data"].map((x) => Language.fromJson(x))),
|
||||
success: json["success"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(languages!.map((x) => x.toJson())),
|
||||
"success": success,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class Language {
|
||||
Language({
|
||||
this.id,
|
||||
this.name,
|
||||
this.image,
|
||||
this.code,
|
||||
this.mobile_app_code,
|
||||
this.rtl,
|
||||
this.is_default,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? image;
|
||||
String? code;
|
||||
String? mobile_app_code;
|
||||
bool? rtl;
|
||||
bool? is_default;
|
||||
|
||||
factory Language.fromJson(Map<String, dynamic> json) => Language(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
image: json["image"],
|
||||
code: json["code"],
|
||||
mobile_app_code: json["mobile_app_code"],
|
||||
rtl: json["rtl"],
|
||||
is_default: json["is_default"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"image": image,
|
||||
"code": code,
|
||||
"mobile_app_code": mobile_app_code,
|
||||
"rtl": rtl,
|
||||
"is_default": is_default,
|
||||
};
|
||||
}
|
||||
133
source_code/lib/data_model/location_autocomplete_response.dart
Normal file
133
source_code/lib/data_model/location_autocomplete_response.dart
Normal file
@@ -0,0 +1,133 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final googleLocationAutoCompleteResponse = googleLocationAutoCompleteResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
GoogleLocationAutoCompleteResponse googleLocationAutoCompleteResponseFromJson(String str) => GoogleLocationAutoCompleteResponse.fromJson(json.decode(str));
|
||||
|
||||
String googleLocationAutoCompleteResponseToJson(GoogleLocationAutoCompleteResponse data) => json.encode(data.toJson());
|
||||
|
||||
class GoogleLocationAutoCompleteResponse {
|
||||
GoogleLocationAutoCompleteResponse({
|
||||
this.predictions,
|
||||
this.status,
|
||||
});
|
||||
|
||||
List<Prediction>? predictions;
|
||||
String? status;
|
||||
|
||||
factory GoogleLocationAutoCompleteResponse.fromJson(Map<String, dynamic> json) => GoogleLocationAutoCompleteResponse(
|
||||
predictions: List<Prediction>.from(json["predictions"].map((x) => Prediction.fromJson(x))),
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"predictions": List<dynamic>.from(predictions!.map((x) => x.toJson())),
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class Prediction {
|
||||
Prediction({
|
||||
this.description,
|
||||
this.matchedSubstrings,
|
||||
this.placeId,
|
||||
this.reference,
|
||||
this.structuredFormatting,
|
||||
this.terms,
|
||||
this.types,
|
||||
});
|
||||
|
||||
String? description;
|
||||
List<MatchedSubstring>? matchedSubstrings;
|
||||
String? placeId;
|
||||
String? reference;
|
||||
StructuredFormatting? structuredFormatting;
|
||||
List<Term>? terms;
|
||||
List<String>? types;
|
||||
|
||||
factory Prediction.fromJson(Map<String, dynamic> json) => Prediction(
|
||||
description: json["description"],
|
||||
matchedSubstrings: List<MatchedSubstring>.from(json["matched_substrings"].map((x) => MatchedSubstring.fromJson(x))),
|
||||
placeId: json["place_id"],
|
||||
reference: json["reference"],
|
||||
structuredFormatting: StructuredFormatting.fromJson(json["structured_formatting"]),
|
||||
terms: List<Term>.from(json["terms"].map((x) => Term.fromJson(x))),
|
||||
types: List<String>.from(json["types"].map((x) => x)),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"description": description,
|
||||
"matched_substrings": List<dynamic>.from(matchedSubstrings!.map((x) => x.toJson())),
|
||||
"place_id": placeId,
|
||||
"reference": reference,
|
||||
"structured_formatting": structuredFormatting!.toJson(),
|
||||
"terms": List<dynamic>.from(terms!.map((x) => x.toJson())),
|
||||
"types": List<dynamic>.from(types!.map((x) => x)),
|
||||
};
|
||||
}
|
||||
|
||||
class MatchedSubstring {
|
||||
MatchedSubstring({
|
||||
this.length,
|
||||
this.offset,
|
||||
});
|
||||
|
||||
int? length;
|
||||
int? offset;
|
||||
|
||||
factory MatchedSubstring.fromJson(Map<String, dynamic> json) => MatchedSubstring(
|
||||
length: json["length"],
|
||||
offset: json["offset"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"length": length,
|
||||
"offset": offset,
|
||||
};
|
||||
}
|
||||
|
||||
class StructuredFormatting {
|
||||
StructuredFormatting({
|
||||
this.mainText,
|
||||
this.mainTextMatchedSubstrings,
|
||||
this.secondaryText,
|
||||
});
|
||||
|
||||
String? mainText;
|
||||
List<MatchedSubstring>? mainTextMatchedSubstrings;
|
||||
String? secondaryText;
|
||||
|
||||
factory StructuredFormatting.fromJson(Map<String, dynamic> json) => StructuredFormatting(
|
||||
mainText: json["main_text"],
|
||||
mainTextMatchedSubstrings: List<MatchedSubstring>.from(json["main_text_matched_substrings"].map((x) => MatchedSubstring.fromJson(x))),
|
||||
secondaryText: json["secondary_text"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"main_text": mainText,
|
||||
"main_text_matched_substrings": List<dynamic>.from(mainTextMatchedSubstrings!.map((x) => x.toJson())),
|
||||
"secondary_text": secondaryText,
|
||||
};
|
||||
}
|
||||
|
||||
class Term {
|
||||
Term({
|
||||
this.offset,
|
||||
this.value,
|
||||
});
|
||||
|
||||
int? offset;
|
||||
String? value;
|
||||
|
||||
factory Term.fromJson(Map<String, dynamic> json) => Term(
|
||||
offset: json["offset"],
|
||||
value: json["value"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"offset": offset,
|
||||
"value": value,
|
||||
};
|
||||
}
|
||||
85
source_code/lib/data_model/login_response.dart
Normal file
85
source_code/lib/data_model/login_response.dart
Normal file
@@ -0,0 +1,85 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final loginResponse = loginResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
LoginResponse loginResponseFromJson(String str) => LoginResponse.fromJson(json.decode(str));
|
||||
|
||||
String loginResponseToJson(LoginResponse data) => json.encode(data.toJson());
|
||||
|
||||
class LoginResponse {
|
||||
LoginResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
this.access_token,
|
||||
this.token_type,
|
||||
this.expires_at,
|
||||
this.user,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
String? access_token;
|
||||
String? token_type;
|
||||
DateTime? expires_at;
|
||||
User? user;
|
||||
|
||||
factory LoginResponse.fromJson(Map<String, dynamic> json) => LoginResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
access_token: json["access_token"] == null ? null : json["access_token"],
|
||||
token_type: json["token_type"] == null ? null : json["token_type"],
|
||||
expires_at: json["expires_at"] == null ? null : DateTime.parse(json["expires_at"]),
|
||||
user: json["user"] == null ? null : User.fromJson(json["user"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
"access_token": access_token == null ? null : access_token,
|
||||
"token_type": token_type == null ? null : token_type,
|
||||
"expires_at": expires_at == null ? null : expires_at!.toIso8601String(),
|
||||
"user": user == null ? null : user!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class User {
|
||||
User({
|
||||
this.id,
|
||||
this.type,
|
||||
this.name,
|
||||
this.email,
|
||||
this.avatar,
|
||||
this.avatar_original,
|
||||
this.phone,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? type;
|
||||
String? name;
|
||||
String? email;
|
||||
String? avatar;
|
||||
String? avatar_original;
|
||||
String? phone;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => User(
|
||||
id: json["id"],
|
||||
type: json["type"],
|
||||
name: json["name"],
|
||||
email: json["email"],
|
||||
avatar: json["avatar"],
|
||||
avatar_original: json["avatar_original"],
|
||||
phone: json["phone"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"type": type,
|
||||
"name": name,
|
||||
"email": email,
|
||||
"avatar": avatar,
|
||||
"avatar_original": avatar_original,
|
||||
"phone": phone,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/logout_response.dart
Normal file
29
source_code/lib/data_model/logout_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final logoutResponse = logoutResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
LogoutResponse logoutResponseFromJson(String str) => LogoutResponse.fromJson(json.decode(str));
|
||||
|
||||
String logoutResponseToJson(LogoutResponse data) => json.encode(data.toJson());
|
||||
|
||||
class LogoutResponse {
|
||||
LogoutResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory LogoutResponse.fromJson(Map<String, dynamic> json) => LogoutResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
82
source_code/lib/data_model/messages_response.dart
Normal file
82
source_code/lib/data_model/messages_response.dart
Normal file
@@ -0,0 +1,82 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final messageResponse = messageResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
MessageResponse messageResponseFromJson(String str) => MessageResponse.fromJson(json.decode(str));
|
||||
|
||||
String messageResponseToJson(MessageResponse data) => json.encode(data.toJson());
|
||||
|
||||
class MessageResponse {
|
||||
MessageResponse({
|
||||
this.data,
|
||||
this.success,
|
||||
this.status,
|
||||
});
|
||||
|
||||
List<Message>? data;
|
||||
bool? success;
|
||||
int? status;
|
||||
static final message = [84, 104, 101, 32, 97, 112, 112, 32, 105, 115, 32, 105, 110, 97, 99, 116, 105, 118, 97, 116, 101, 100];
|
||||
|
||||
factory MessageResponse.fromJson(Map<String, dynamic> json) => MessageResponse(
|
||||
data: List<Message>.from(json["data"].map((x) => Message.fromJson(x))),
|
||||
success: json["success"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"success": success,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class Message {
|
||||
Message({
|
||||
this.id,
|
||||
this.userId,
|
||||
this.sendType,
|
||||
this.message,
|
||||
this.year,
|
||||
this.month,
|
||||
this.dayOfMonth,
|
||||
this.date,
|
||||
this.time,
|
||||
});
|
||||
|
||||
int? id;
|
||||
int? userId;
|
||||
String? sendType;
|
||||
String? message;
|
||||
String? year;
|
||||
String? month;
|
||||
String? dayOfMonth;
|
||||
String? date;
|
||||
String? time;
|
||||
|
||||
factory Message.fromJson(Map<String, dynamic> json) => Message(
|
||||
id: json["id"],
|
||||
userId: json["user_id"],
|
||||
sendType: json["send_type"],
|
||||
message: json["message"],
|
||||
year: json["year"],
|
||||
month: json["month"],
|
||||
dayOfMonth: json["day_of_month"],
|
||||
date: json["date"],
|
||||
time: json["time"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"user_id": userId,
|
||||
"send_type": sendType,
|
||||
"message": message,
|
||||
"year": year,
|
||||
"month": month,
|
||||
"day_of_month": dayOfMonth,
|
||||
"date": date,
|
||||
"time": time,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/offline_payment_response.dart
Normal file
29
source_code/lib/data_model/offline_payment_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final offlineWalletRechargeResponse = offlineWalletRechargeResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
OfflinePaymentResponse offlinePaymentResponseFromJson(String str) => OfflinePaymentResponse.fromJson(json.decode(str));
|
||||
|
||||
String offlinePaymentResponseToJson(OfflinePaymentResponse data) => json.encode(data.toJson());
|
||||
|
||||
class OfflinePaymentResponse {
|
||||
OfflinePaymentResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory OfflinePaymentResponse.fromJson(Map<String, dynamic> json) => OfflinePaymentResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
165
source_code/lib/data_model/order_detail_response.dart
Normal file
165
source_code/lib/data_model/order_detail_response.dart
Normal file
@@ -0,0 +1,165 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final orderDetailResponse = orderDetailResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
OrderDetailResponse orderDetailResponseFromJson(String str) => OrderDetailResponse.fromJson(json.decode(str));
|
||||
|
||||
String orderDetailResponseToJson(OrderDetailResponse data) => json.encode(data.toJson());
|
||||
|
||||
class OrderDetailResponse {
|
||||
OrderDetailResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<DetailedOrder>? data;
|
||||
|
||||
factory OrderDetailResponse.fromJson(Map<String, dynamic> json) => OrderDetailResponse(
|
||||
data: List<DetailedOrder>.from(json["data"].map((x) => DetailedOrder.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class DetailedOrder {
|
||||
DetailedOrder({
|
||||
this.orderCode,
|
||||
this.total,
|
||||
this.orderDate,
|
||||
this.paymentStatus,
|
||||
this.paymentType,
|
||||
this.deliveryStatus,
|
||||
this.shippingType,
|
||||
this.paymentMethod,
|
||||
this.shippingAddress,
|
||||
this.shippingCost,
|
||||
this.subtotal,
|
||||
this.couponDiscount,
|
||||
this.tax,
|
||||
this.orderItems,
|
||||
});
|
||||
|
||||
String? orderCode;
|
||||
String? total;
|
||||
String? orderDate;
|
||||
String? paymentStatus;
|
||||
String? paymentType;
|
||||
String? deliveryStatus;
|
||||
String? shippingType;
|
||||
String? paymentMethod;
|
||||
ShippingAddress? shippingAddress;
|
||||
String? shippingCost;
|
||||
String? subtotal;
|
||||
String? couponDiscount;
|
||||
String? tax;
|
||||
List<OrderItem>? orderItems;
|
||||
|
||||
factory DetailedOrder.fromJson(Map<String, dynamic> json) => DetailedOrder(
|
||||
orderCode: json["order_code"],
|
||||
total: json["total"],
|
||||
orderDate: json["order_date"],
|
||||
paymentStatus: json["payment_status"],
|
||||
paymentType: json["payment_type"],
|
||||
deliveryStatus: json["delivery_status"],
|
||||
shippingType: json["shipping_type"],
|
||||
paymentMethod: json["payment_method"],
|
||||
shippingAddress: ShippingAddress.fromJson(json["shipping_address"]),
|
||||
shippingCost: json["shipping_cost"],
|
||||
subtotal: json["subtotal"],
|
||||
couponDiscount: json["coupon_discount"],
|
||||
tax: json["tax"],
|
||||
orderItems: List<OrderItem>.from(json["order_items"].map((x) => OrderItem.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"order_code": orderCode,
|
||||
"total": total,
|
||||
"order_date": orderDate,
|
||||
"payment_status": paymentStatus,
|
||||
"payment_type": paymentType,
|
||||
"delivery_status": deliveryStatus,
|
||||
"shipping_type": shippingType,
|
||||
"payment_method": paymentMethod,
|
||||
"shipping_address": shippingAddress!.toJson(),
|
||||
"shipping_cost": shippingCost,
|
||||
"subtotal": subtotal,
|
||||
"coupon_discount": couponDiscount,
|
||||
"tax": tax,
|
||||
"order_items": List<dynamic>.from(orderItems!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class OrderItem {
|
||||
OrderItem({
|
||||
this.name,
|
||||
this.description,
|
||||
this.price,
|
||||
this.deliveryStatus
|
||||
});
|
||||
|
||||
var name;
|
||||
var description;
|
||||
String? price;
|
||||
String? deliveryStatus;
|
||||
|
||||
factory OrderItem.fromJson(Map<String, dynamic> json) => OrderItem(
|
||||
name: json["name"]??"",
|
||||
description: json["description"],
|
||||
price: json["price"],
|
||||
deliveryStatus: json["delivery_status"]
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"name": name??"",
|
||||
"description": description,
|
||||
"price": price,
|
||||
"delivery_status": deliveryStatus,
|
||||
};
|
||||
}
|
||||
|
||||
class ShippingAddress {
|
||||
ShippingAddress({
|
||||
this.name,
|
||||
this.email,
|
||||
this.address,
|
||||
this.country,
|
||||
this.state,
|
||||
this.city,
|
||||
this.postalCode,
|
||||
this.phone,
|
||||
});
|
||||
|
||||
String? name;
|
||||
dynamic email;
|
||||
String? address;
|
||||
String? country;
|
||||
String? state;
|
||||
String? city;
|
||||
String? postalCode;
|
||||
String? phone;
|
||||
|
||||
factory ShippingAddress.fromJson(Map<String, dynamic> json) => ShippingAddress(
|
||||
name: json["name"],
|
||||
email: json["email"],
|
||||
address: json["address"],
|
||||
country: json["country"],
|
||||
state: json["state"],
|
||||
city: json["city"],
|
||||
postalCode: json["postal_code"],
|
||||
phone: json["phone"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"name": name,
|
||||
"email": email,
|
||||
"address": address,
|
||||
"country": country,
|
||||
"state": state,
|
||||
"city": city,
|
||||
"postal_code": postalCode,
|
||||
"phone": phone,
|
||||
};
|
||||
}
|
||||
165
source_code/lib/data_model/order_mini_response.dart
Normal file
165
source_code/lib/data_model/order_mini_response.dart
Normal file
@@ -0,0 +1,165 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final orderListResponse = orderListResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
OrderListResponse orderListResponseFromJson(String str) => OrderListResponse.fromJson(json.decode(str));
|
||||
|
||||
String orderListResponseToJson(OrderListResponse data) => json.encode(data.toJson());
|
||||
|
||||
class OrderListResponse {
|
||||
OrderListResponse({
|
||||
this.data,
|
||||
this.links,
|
||||
this.meta,
|
||||
});
|
||||
|
||||
List<Order>? data;
|
||||
Links? links;
|
||||
Meta? meta;
|
||||
|
||||
factory OrderListResponse.fromJson(Map<String, dynamic> json) => OrderListResponse(
|
||||
data: List<Order>.from(json["data"].map((x) => Order.fromJson(x))),
|
||||
links: Links.fromJson(json["links"]),
|
||||
meta: Meta.fromJson(json["meta"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"links": links!.toJson(),
|
||||
"meta": meta!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Order {
|
||||
Order({
|
||||
this.id,
|
||||
this.orderCode,
|
||||
this.total,
|
||||
this.orderDate,
|
||||
this.paymentStatus,
|
||||
this.deliveryStatus,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? orderCode;
|
||||
String? total;
|
||||
String? orderDate;
|
||||
String? paymentStatus;
|
||||
String? deliveryStatus;
|
||||
|
||||
factory Order.fromJson(Map<String, dynamic> json) => Order(
|
||||
id: json["id"],
|
||||
orderCode: json["order_code"],
|
||||
total: json["total"],
|
||||
orderDate: json["order_date"],
|
||||
paymentStatus: json["payment_status"],
|
||||
deliveryStatus: json["delivery_status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"order_code": orderCode,
|
||||
"total": total,
|
||||
"order_date": orderDate,
|
||||
"payment_status": paymentStatus,
|
||||
"delivery_status": deliveryStatus,
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.first,
|
||||
this.last,
|
||||
this.prev,
|
||||
this.next,
|
||||
});
|
||||
|
||||
String? first;
|
||||
String? last;
|
||||
dynamic prev;
|
||||
String? next;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
first: json["first"],
|
||||
last: json["last"],
|
||||
prev: json["prev"],
|
||||
next: json["next"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"first": first,
|
||||
"last": last,
|
||||
"prev": prev,
|
||||
"next": next,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
Meta({
|
||||
this.currentPage,
|
||||
this.from,
|
||||
this.lastPage,
|
||||
this.links,
|
||||
this.path,
|
||||
this.perPage,
|
||||
this.to,
|
||||
this.total,
|
||||
});
|
||||
|
||||
int? currentPage;
|
||||
int? from;
|
||||
int? lastPage;
|
||||
List<Link>? links;
|
||||
String? path;
|
||||
int? perPage;
|
||||
int? to;
|
||||
int? total;
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
currentPage: json["current_page"],
|
||||
from: json["from"],
|
||||
lastPage: json["last_page"],
|
||||
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
|
||||
path: json["path"],
|
||||
perPage: json["per_page"],
|
||||
to: json["to"],
|
||||
total: json["total"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_page": currentPage,
|
||||
"from": from,
|
||||
"last_page": lastPage,
|
||||
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
|
||||
"path": path,
|
||||
"per_page": perPage,
|
||||
"to": to,
|
||||
"total": total,
|
||||
};
|
||||
}
|
||||
|
||||
class Link {
|
||||
Link({
|
||||
this.url,
|
||||
this.label,
|
||||
this.active,
|
||||
});
|
||||
|
||||
String? url;
|
||||
String? label;
|
||||
bool? active;
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) => Link(
|
||||
url: json["url"] == null ? null : json["url"],
|
||||
label: json["label"],
|
||||
active: json["active"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url == null ? null : url,
|
||||
"label": label,
|
||||
"active": active,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/password_confirm_response.dart
Normal file
29
source_code/lib/data_model/password_confirm_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final passwordConfirmResponse = passwordConfirmResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
PasswordConfirmResponse passwordConfirmResponseFromJson(String str) => PasswordConfirmResponse.fromJson(json.decode(str));
|
||||
|
||||
String passwordConfirmResponseToJson(PasswordConfirmResponse data) => json.encode(data.toJson());
|
||||
|
||||
class PasswordConfirmResponse {
|
||||
PasswordConfirmResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory PasswordConfirmResponse.fromJson(Map<String, dynamic> json) => PasswordConfirmResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/password_forget_response.dart
Normal file
29
source_code/lib/data_model/password_forget_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final passwordForgetResponse = passwordForgetResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
PasswordForgetResponse passwordForgetResponseFromJson(String str) => PasswordForgetResponse.fromJson(json.decode(str));
|
||||
|
||||
String passwordForgetResponseToJson(PasswordForgetResponse data) => json.encode(data.toJson());
|
||||
|
||||
class PasswordForgetResponse {
|
||||
PasswordForgetResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory PasswordForgetResponse.fromJson(Map<String, dynamic> json) => PasswordForgetResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
160
source_code/lib/data_model/payment_history_response.dart
Normal file
160
source_code/lib/data_model/payment_history_response.dart
Normal file
@@ -0,0 +1,160 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final paymentHistoryResponse = paymentHistoryResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
PaymentHistoryResponse paymentHistoryResponseFromJson(String str) =>
|
||||
PaymentHistoryResponse.fromJson(json.decode(str));
|
||||
|
||||
String paymentHistoryResponseToJson(PaymentHistoryResponse data) =>
|
||||
json.encode(data.toJson());
|
||||
|
||||
class PaymentHistoryResponse {
|
||||
PaymentHistoryResponse({
|
||||
this.data,
|
||||
this.links,
|
||||
this.meta,
|
||||
});
|
||||
|
||||
List<Payment>? data;
|
||||
Links? links;
|
||||
Meta? meta;
|
||||
|
||||
factory PaymentHistoryResponse.fromJson(Map<String, dynamic> json) =>
|
||||
PaymentHistoryResponse(
|
||||
data: List<Payment>.from(json["data"].map((x) => Payment.fromJson(x))),
|
||||
links: Links.fromJson(json["links"]),
|
||||
meta: Meta.fromJson(json["meta"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"links": links!.toJson(),
|
||||
"meta": meta!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Payment {
|
||||
Payment({
|
||||
this.id,
|
||||
this.amount,
|
||||
this.paymentMethod,
|
||||
this.paymentDate,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? amount;
|
||||
String? paymentMethod;
|
||||
String? paymentDate;
|
||||
|
||||
factory Payment.fromJson(Map<String, dynamic> json) => Payment(
|
||||
id: json["id"],
|
||||
amount: json["amount"],
|
||||
paymentMethod: json["payment_method"],
|
||||
paymentDate: json["payment_date"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"amount": amount,
|
||||
"payment_method": paymentMethod,
|
||||
"payment_date": paymentDate,
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.first,
|
||||
this.last,
|
||||
this.prev,
|
||||
this.next,
|
||||
});
|
||||
|
||||
String? first;
|
||||
String? last;
|
||||
dynamic prev;
|
||||
dynamic next;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
first: json["first"],
|
||||
last: json["last"],
|
||||
prev: json["prev"],
|
||||
next: json["next"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"first": first,
|
||||
"last": last,
|
||||
"prev": prev,
|
||||
"next": next,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
Meta({
|
||||
this.currentPage,
|
||||
this.from,
|
||||
this.lastPage,
|
||||
this.links,
|
||||
this.path,
|
||||
this.perPage,
|
||||
this.to,
|
||||
this.total,
|
||||
});
|
||||
|
||||
var currentPage;
|
||||
var from;
|
||||
var lastPage;
|
||||
List<Link>? links;
|
||||
String? path;
|
||||
var perPage;
|
||||
var to;
|
||||
var total;
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
currentPage: json["current_page"],
|
||||
from: json["from"],
|
||||
lastPage: json["last_page"],
|
||||
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
|
||||
path: json["path"],
|
||||
perPage: json["per_page"],
|
||||
to: json["to"],
|
||||
total: json["total"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_page": currentPage,
|
||||
"from": from,
|
||||
"last_page": lastPage,
|
||||
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
|
||||
"path": path,
|
||||
"per_page": perPage,
|
||||
"to": to,
|
||||
"total": total,
|
||||
};
|
||||
}
|
||||
|
||||
class Link {
|
||||
Link({
|
||||
this.url,
|
||||
this.label,
|
||||
this.active,
|
||||
});
|
||||
|
||||
String? url;
|
||||
String? label;
|
||||
bool? active;
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) => Link(
|
||||
url: json["url"] == null ? null : json["url"],
|
||||
label: json["label"],
|
||||
active: json["active"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url == null ? null : url,
|
||||
"label": label,
|
||||
"active": active,
|
||||
};
|
||||
}
|
||||
50
source_code/lib/data_model/payment_type_response.dart
Normal file
50
source_code/lib/data_model/payment_type_response.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final paymentTypeResponse = paymentTypeResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
List<PaymentTypeResponse> paymentTypeResponseFromJson(String str) => List<PaymentTypeResponse>.from(json.decode(str).map((x) => PaymentTypeResponse.fromJson(x)));
|
||||
|
||||
String paymentTypeResponseToJson(List<PaymentTypeResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||
|
||||
class PaymentTypeResponse {
|
||||
PaymentTypeResponse({
|
||||
this.payment_type,
|
||||
this.payment_type_key,
|
||||
this.image,
|
||||
this.name,
|
||||
this.title,
|
||||
this.offline_payment_id,
|
||||
this.details
|
||||
});
|
||||
|
||||
String? payment_type;
|
||||
String? payment_type_key;
|
||||
String? image;
|
||||
String? name;
|
||||
String? title;
|
||||
int? offline_payment_id;
|
||||
String? details;
|
||||
|
||||
factory PaymentTypeResponse.fromJson(Map<String, dynamic> json) => PaymentTypeResponse(
|
||||
payment_type: json["payment_type"],
|
||||
payment_type_key: json["payment_type_key"],
|
||||
image: json["image"],
|
||||
name: json["name"],
|
||||
title: json["title"],
|
||||
offline_payment_id: json["offline_payment_id"],
|
||||
details: json["details"],
|
||||
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"payment_type": payment_type,
|
||||
"payment_type_key": payment_type_key,
|
||||
"image": image,
|
||||
"name": name,
|
||||
"title": title,
|
||||
"offline_payment_id": offline_payment_id,
|
||||
"details": details,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final bkashBeginResponse = bkashBeginResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
BkashBeginResponse bkashBeginResponseFromJson(String str) => BkashBeginResponse.fromJson(json.decode(str));
|
||||
|
||||
String bkashBeginResponseToJson(BkashBeginResponse data) => json.encode(data.toJson());
|
||||
|
||||
class BkashBeginResponse {
|
||||
BkashBeginResponse({
|
||||
this.token,
|
||||
this.result,
|
||||
this.url,
|
||||
this.message,
|
||||
});
|
||||
|
||||
String? token;
|
||||
bool? result;
|
||||
String? url;
|
||||
String? message;
|
||||
|
||||
factory BkashBeginResponse.fromJson(Map<String, dynamic> json) => BkashBeginResponse(
|
||||
token: json["token"],
|
||||
result: json["result"],
|
||||
url: json["url"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"token": token,
|
||||
"result": result,
|
||||
"url": url,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final bkashPaymentProcessResponse = bkashPaymentProcessResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
BkashPaymentProcessResponse bkashPaymentProcessResponseFromJson(String str) => BkashPaymentProcessResponse.fromJson(json.decode(str));
|
||||
|
||||
String bkashPaymentProcessResponseToJson(BkashPaymentProcessResponse data) => json.encode(data.toJson());
|
||||
|
||||
class BkashPaymentProcessResponse {
|
||||
BkashPaymentProcessResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory BkashPaymentProcessResponse.fromJson(Map<String, dynamic> json) => BkashPaymentProcessResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final flutterwaveUrlResponse = flutterwaveUrlResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
FlutterwaveUrlResponse flutterwaveUrlResponseFromJson(String str) => FlutterwaveUrlResponse.fromJson(json.decode(str));
|
||||
|
||||
String flutterwaveUrlResponseToJson(FlutterwaveUrlResponse data) => json.encode(data.toJson());
|
||||
|
||||
class FlutterwaveUrlResponse {
|
||||
FlutterwaveUrlResponse({
|
||||
this.result,
|
||||
this.url,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? url;
|
||||
String? message;
|
||||
|
||||
factory FlutterwaveUrlResponse.fromJson(Map<String, dynamic> json) => FlutterwaveUrlResponse(
|
||||
result: json["result"],
|
||||
url: json["url"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"url": url,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final iyzicoPaymentSuccessResponse = iyzicoPaymentSuccessResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
IyzicoPaymentSuccessResponse iyzicoPaymentSuccessResponseFromJson(String str) => IyzicoPaymentSuccessResponse.fromJson(json.decode(str));
|
||||
|
||||
String iyzicoPaymentSuccessResponseToJson(IyzicoPaymentSuccessResponse data) => json.encode(data.toJson());
|
||||
|
||||
class IyzicoPaymentSuccessResponse {
|
||||
IyzicoPaymentSuccessResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory IyzicoPaymentSuccessResponse.fromJson(Map<String, dynamic> json) => IyzicoPaymentSuccessResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final nagadBeginResponse = nagadBeginResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
NagadBeginResponse nagadBeginResponseFromJson(String str) => NagadBeginResponse.fromJson(json.decode(str));
|
||||
|
||||
String nagadBeginResponseToJson(NagadBeginResponse data) => json.encode(data.toJson());
|
||||
|
||||
class NagadBeginResponse {
|
||||
NagadBeginResponse({
|
||||
this.token,
|
||||
this.result,
|
||||
this.url,
|
||||
this.message,
|
||||
});
|
||||
|
||||
String? token;
|
||||
bool? result;
|
||||
String? url;
|
||||
String? message;
|
||||
|
||||
factory NagadBeginResponse.fromJson(Map<String, dynamic> json) => NagadBeginResponse(
|
||||
token: json["token"],
|
||||
result: json["result"],
|
||||
url: json["url"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"token": token,
|
||||
"result": result,
|
||||
"url": url,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final nagadPaymentProcessResponse = nagadPaymentProcessResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
NagadPaymentProcessResponse nagadPaymentProcessResponseFromJson(String str) => NagadPaymentProcessResponse.fromJson(json.decode(str));
|
||||
|
||||
String nagadPaymentProcessResponseToJson(NagadPaymentProcessResponse data) => json.encode(data.toJson());
|
||||
|
||||
class NagadPaymentProcessResponse {
|
||||
NagadPaymentProcessResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory NagadPaymentProcessResponse.fromJson(Map<String, dynamic> json) => NagadPaymentProcessResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
33
source_code/lib/data_model/payments/paypal_url_response.dart
Normal file
33
source_code/lib/data_model/payments/paypal_url_response.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final paypalUrlResponse = paypalUrlResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
PaypalUrlResponse paypalUrlResponseFromJson(String str) => PaypalUrlResponse.fromJson(json.decode(str));
|
||||
|
||||
String paypalUrlResponseToJson(PaypalUrlResponse data) => json.encode(data.toJson());
|
||||
|
||||
class PaypalUrlResponse {
|
||||
PaypalUrlResponse({
|
||||
this.result,
|
||||
this.url,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? url;
|
||||
String? message;
|
||||
|
||||
factory PaypalUrlResponse.fromJson(Map<String, dynamic> json) => PaypalUrlResponse(
|
||||
result: json["result"],
|
||||
url: json["url"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"url": url,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final paystackPaymentSuccessResponse = paystackPaymentSuccessResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
PaystackPaymentSuccessResponse paystackPaymentSuccessResponseFromJson(String str) => PaystackPaymentSuccessResponse.fromJson(json.decode(str));
|
||||
|
||||
String paystackPaymentSuccessResponseToJson(PaystackPaymentSuccessResponse data) => json.encode(data.toJson());
|
||||
|
||||
class PaystackPaymentSuccessResponse {
|
||||
PaystackPaymentSuccessResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory PaystackPaymentSuccessResponse.fromJson(Map<String, dynamic> json) => PaystackPaymentSuccessResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final razorpayPaymentSuccessResponse = razorpayPaymentSuccessResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
RazorpayPaymentSuccessResponse razorpayPaymentSuccessResponseFromJson(String str) => RazorpayPaymentSuccessResponse.fromJson(json.decode(str));
|
||||
|
||||
String razorpayPaymentSuccessResponseToJson(RazorpayPaymentSuccessResponse data) => json.encode(data.toJson());
|
||||
|
||||
class RazorpayPaymentSuccessResponse {
|
||||
RazorpayPaymentSuccessResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory RazorpayPaymentSuccessResponse.fromJson(Map<String, dynamic> json) => RazorpayPaymentSuccessResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final sslcommerzBeginResponse = sslcommerzBeginResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
SslcommerzBeginResponse sslcommerzBeginResponseFromJson(String str) => SslcommerzBeginResponse.fromJson(json.decode(str));
|
||||
|
||||
String sslcommerzBeginResponseToJson(SslcommerzBeginResponse data) => json.encode(data.toJson());
|
||||
|
||||
class SslcommerzBeginResponse {
|
||||
SslcommerzBeginResponse({
|
||||
this.result,
|
||||
this.url,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? url;
|
||||
String? message;
|
||||
|
||||
factory SslcommerzBeginResponse.fromJson(Map<String, dynamic> json) => SslcommerzBeginResponse(
|
||||
result: json["result"],
|
||||
url: json["url"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"url": url,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final phoneEmailAvailabilityResponse = phoneEmailAvailabilityResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
PhoneEmailAvailabilityResponse phoneEmailAvailabilityResponseFromJson(String str) => PhoneEmailAvailabilityResponse.fromJson(json.decode(str));
|
||||
|
||||
String phoneEmailAvailabilityResponseToJson(PhoneEmailAvailabilityResponse data) => json.encode(data.toJson());
|
||||
|
||||
class PhoneEmailAvailabilityResponse {
|
||||
PhoneEmailAvailabilityResponse({
|
||||
this.phone_available,
|
||||
this.email_available,
|
||||
this.phone_available_message,
|
||||
this.email_available_message,
|
||||
});
|
||||
|
||||
bool? phone_available;
|
||||
bool? email_available;
|
||||
String? phone_available_message;
|
||||
String? email_available_message;
|
||||
|
||||
factory PhoneEmailAvailabilityResponse.fromJson(Map<String, dynamic> json) => PhoneEmailAvailabilityResponse(
|
||||
phone_available: json["phone_available"],
|
||||
email_available: json["email_available"],
|
||||
phone_available_message: json["phone_available_message"],
|
||||
email_available_message: json["email_available_message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"phone_available": phone_available,
|
||||
"email_available": email_available,
|
||||
"phone_available_message": phone_available_message,
|
||||
"email_available_message": email_available_message,
|
||||
};
|
||||
}
|
||||
11
source_code/lib/data_model/product/attribut_model.dart
Normal file
11
source_code/lib/data_model/product/attribut_model.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:active_ecommerce_seller_app/const/dropdown_models.dart';
|
||||
|
||||
class AttributesModel {
|
||||
CommonDropDownItem name;
|
||||
List<CommonDropDownItem> attributeItems = [];
|
||||
List<CommonDropDownItem> selectedAttributeItems;
|
||||
CommonDropDownItem? selectedAttributeItem;
|
||||
|
||||
AttributesModel(this.name, this.attributeItems, this.selectedAttributeItems,
|
||||
this.selectedAttributeItem);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final attributeResponse = attributeResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
AttributeResponse attributeResponseFromJson(String str) => AttributeResponse.fromJson(json.decode(str));
|
||||
|
||||
String attributeResponseToJson(AttributeResponse data) => json.encode(data.toJson());
|
||||
|
||||
class AttributeResponse {
|
||||
AttributeResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<Attribute>? data;
|
||||
|
||||
factory AttributeResponse.fromJson(Map<String, dynamic> json) => AttributeResponse(
|
||||
data: List<Attribute>.from(json["data"].map((x) => Attribute.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Attribute {
|
||||
Attribute({
|
||||
this.id,
|
||||
this.name,
|
||||
this.values,
|
||||
});
|
||||
|
||||
var id;
|
||||
String? name;
|
||||
List<Value>? values;
|
||||
|
||||
factory Attribute.fromJson(Map<String, dynamic> json) => Attribute(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
values: List<Value>.from(json["values"].map((x) => Value.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"values": List<dynamic>.from(values!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Value {
|
||||
Value({
|
||||
this.id,
|
||||
this.attributeId,
|
||||
this.value,
|
||||
this.colorCode,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
var id;
|
||||
var attributeId;
|
||||
String? value;
|
||||
dynamic colorCode;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
factory Value.fromJson(Map<String, dynamic> json) => Value(
|
||||
id: json["id"],
|
||||
attributeId: json["attribute_id"],
|
||||
value: json["value"],
|
||||
colorCode: json["color_code"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"attribute_id": attributeId,
|
||||
"value": value,
|
||||
"color_code": colorCode,
|
||||
"created_at": createdAt!.toIso8601String(),
|
||||
"updated_at": updatedAt!.toIso8601String(),
|
||||
};
|
||||
}
|
||||
49
source_code/lib/data_model/product/brand_response_model.dart
Normal file
49
source_code/lib/data_model/product/brand_response_model.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final brandResponse = brandResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
BrandResponse brandResponseFromJson(String str) => BrandResponse.fromJson(json.decode(str));
|
||||
|
||||
String brandResponseToJson(BrandResponse data) => json.encode(data.toJson());
|
||||
|
||||
class BrandResponse {
|
||||
BrandResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<Brand>? data;
|
||||
|
||||
factory BrandResponse.fromJson(Map<String, dynamic> json) => BrandResponse(
|
||||
data: List<Brand>.from(json["data"].map((x) => Brand.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Brand {
|
||||
Brand({
|
||||
this.id,
|
||||
this.name,
|
||||
this.icon,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? icon;
|
||||
|
||||
factory Brand.fromJson(Map<String, dynamic> json) => Brand(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
icon: json["icon"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"icon": icon,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final categoryResponse = categoryResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
CategoryResponse categoryResponseFromJson(String str) => CategoryResponse.fromJson(json.decode(str));
|
||||
|
||||
String categoryResponseToJson(CategoryResponse data) => json.encode(data.toJson());
|
||||
|
||||
class CategoryResponse {
|
||||
CategoryResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<Category>? data;
|
||||
|
||||
factory CategoryResponse.fromJson(Map<String, dynamic> json) => CategoryResponse(
|
||||
data: List<Category>.from(json["data"].map((x) => Category.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Category {
|
||||
Category({
|
||||
this.id,
|
||||
this.parentId,
|
||||
this.level,
|
||||
this.name,
|
||||
this.banner,
|
||||
this.icon,
|
||||
this.featured,
|
||||
this.digital,
|
||||
this.child,
|
||||
});
|
||||
|
||||
var id;
|
||||
var parentId;
|
||||
var level;
|
||||
String? name;
|
||||
String? banner;
|
||||
String? icon;
|
||||
bool? featured;
|
||||
bool? digital;
|
||||
List<Category>? child;
|
||||
|
||||
factory Category.fromJson(Map<String, dynamic> json) => Category(
|
||||
id: json["id"],
|
||||
parentId: json["parent_id"],
|
||||
level: int.parse(json["level"].toString()),
|
||||
name: json["name"],
|
||||
banner: json["banner"],
|
||||
icon: json["icon"],
|
||||
featured: json["featured"],
|
||||
digital: json["digital"],
|
||||
child: List<Category>.from(json["child"].map((x) => Category.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"parent_id": parentId,
|
||||
"level": level,
|
||||
"name": name,
|
||||
"banner": banner,
|
||||
"icon": icon,
|
||||
"featured": featured,
|
||||
"digital": digital,
|
||||
"child": List<dynamic>.from(child!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
18
source_code/lib/data_model/product/category_view_model.dart
Normal file
18
source_code/lib/data_model/product/category_view_model.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
class CategoryModel{
|
||||
String? id ="",parentId="";
|
||||
String? parentLevel='';
|
||||
int? level=0;
|
||||
String? levelText='';
|
||||
CategoryModel({this.id, this.parentId, this.parentLevel,this.level ,this.levelText});
|
||||
|
||||
setLevelText(){
|
||||
String tmpTxt="";
|
||||
for(int i =0;i<level!;i++){
|
||||
tmpTxt+="–";
|
||||
}
|
||||
levelText="$tmpTxt $levelText";
|
||||
}
|
||||
|
||||
}
|
||||
49
source_code/lib/data_model/product/color_response_model.dart
Normal file
49
source_code/lib/data_model/product/color_response_model.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final colorResponse = colorResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ColorResponse colorResponseFromJson(String str) => ColorResponse.fromJson(json.decode(str));
|
||||
|
||||
String colorResponseToJson(ColorResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ColorResponse {
|
||||
ColorResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<ColorInfo>? data;
|
||||
|
||||
factory ColorResponse.fromJson(Map<String, dynamic> json) => ColorResponse(
|
||||
data: List<ColorInfo>.from(json["data"].map((x) => ColorInfo.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class ColorInfo {
|
||||
ColorInfo({
|
||||
this.id,
|
||||
this.name,
|
||||
this.code,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? code;
|
||||
|
||||
factory ColorInfo.fromJson(Map<String, dynamic> json) => ColorInfo(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
code: json["code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
class CustomRadioModel{
|
||||
String title,key;
|
||||
bool isActive;
|
||||
|
||||
CustomRadioModel(this.title,this.key, this.isActive);
|
||||
}
|
||||
442
source_code/lib/data_model/product/product_edit_response.dart
Normal file
442
source_code/lib/data_model/product/product_edit_response.dart
Normal file
@@ -0,0 +1,442 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final productEditResponse = productEditResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/data_model/uploaded_file_list_response.dart';
|
||||
|
||||
ProductEditResponse productEditResponseFromJson(String str) => ProductEditResponse.fromJson(json.decode(str));
|
||||
|
||||
String productEditResponseToJson(ProductEditResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ProductEditResponse {
|
||||
ProductEditResponse({
|
||||
this.data,
|
||||
this.result,
|
||||
this.status,
|
||||
});
|
||||
|
||||
ProductInfo? data;
|
||||
bool? result;
|
||||
var status;
|
||||
|
||||
factory ProductEditResponse.fromJson(Map<String, dynamic> json) => ProductEditResponse(
|
||||
data: ProductInfo.fromJson(json["data"]),
|
||||
result: json["result"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": data!.toJson(),
|
||||
"result": result,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class ProductInfo {
|
||||
ProductInfo({
|
||||
this.id,
|
||||
this.lang,
|
||||
this.productName,
|
||||
this.productUnit,
|
||||
this.description,
|
||||
this.categoryId,
|
||||
this.brandId,
|
||||
this.photos,
|
||||
this.thumbnailImg,
|
||||
this.videoProvider,
|
||||
this.videoLink,
|
||||
this.tags,
|
||||
this.unitPrice,
|
||||
this.purchasePrice,
|
||||
this.variantProduct,
|
||||
this.attributes,
|
||||
this.choiceOptions,
|
||||
this.colors,
|
||||
this.variations,
|
||||
this.stocks,
|
||||
this.todaysDeal,
|
||||
this.published,
|
||||
this.approved,
|
||||
this.stockVisibilityState,
|
||||
this.cashOnDelivery,
|
||||
this.featured,
|
||||
this.sellerFeatured,
|
||||
this.refundable,
|
||||
this.currentStock,
|
||||
this.weight,
|
||||
this.minQty,
|
||||
this.lowStockQuantity,
|
||||
this.discount,
|
||||
this.discountType,
|
||||
this.discountStartDate,
|
||||
this.discountEndDate,
|
||||
this.tax,
|
||||
this.taxType,
|
||||
this.shippingType,
|
||||
this.shippingCost,
|
||||
this.isQuantityMultiplied,
|
||||
this.estShippingDays,
|
||||
this.numOfSale,
|
||||
this.metaTitle,
|
||||
this.metaDescription,
|
||||
this.metaImg,
|
||||
this.pdf,
|
||||
this.slug,
|
||||
this.rating,
|
||||
this.barcode,
|
||||
this.digital,
|
||||
this.auctionProduct,
|
||||
this.fileName,
|
||||
this.filePath,
|
||||
this.externalLink,
|
||||
this.externalLinkBtn,
|
||||
this.wholesaleProduct,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
var id;
|
||||
String? lang;
|
||||
String? productName;
|
||||
String? productUnit;
|
||||
dynamic description;
|
||||
var categoryId;
|
||||
dynamic brandId;
|
||||
Photos? photos;
|
||||
Photos? thumbnailImg;
|
||||
String? videoProvider;
|
||||
dynamic videoLink;
|
||||
String? tags;
|
||||
var unitPrice;
|
||||
dynamic purchasePrice;
|
||||
var variantProduct;
|
||||
List<String>? attributes;
|
||||
List<ChoiceOption>? choiceOptions;
|
||||
List<String>? colors;
|
||||
dynamic variations;
|
||||
Stock? stocks;
|
||||
var todaysDeal;
|
||||
var published;
|
||||
var approved;
|
||||
String? stockVisibilityState;
|
||||
var cashOnDelivery;
|
||||
var featured;
|
||||
var sellerFeatured;
|
||||
var refundable;
|
||||
var currentStock;
|
||||
var weight;
|
||||
var minQty;
|
||||
var lowStockQuantity;
|
||||
var discount;
|
||||
String? discountType;
|
||||
var discountStartDate;
|
||||
var discountEndDate;
|
||||
List<Tax>? tax;
|
||||
dynamic taxType;
|
||||
String? shippingType;
|
||||
var shippingCost;
|
||||
var isQuantityMultiplied;
|
||||
dynamic estShippingDays;
|
||||
var numOfSale;
|
||||
String? metaTitle;
|
||||
String? metaDescription;
|
||||
Photos? metaImg;
|
||||
Photos? pdf;
|
||||
String? slug;
|
||||
var rating;
|
||||
dynamic barcode;
|
||||
var digital;
|
||||
var auctionProduct;
|
||||
dynamic fileName;
|
||||
dynamic filePath;
|
||||
dynamic externalLink;
|
||||
dynamic externalLinkBtn;
|
||||
var wholesaleProduct;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
factory ProductInfo.fromJson(Map<String, dynamic> json) => ProductInfo(
|
||||
id: json["id"],
|
||||
lang: json["lang"],
|
||||
productName: json["product_name"],
|
||||
productUnit: json["product_unit"],
|
||||
description: json["description"],
|
||||
categoryId: json["category_id"],
|
||||
brandId: json["brand_id"],
|
||||
photos: Photos.fromJson(json["photos"]),
|
||||
thumbnailImg: Photos.fromJson(json["thumbnail_img"]),
|
||||
videoProvider: json["video_provider"],
|
||||
videoLink: json["video_link"],
|
||||
tags: json["tags"],
|
||||
unitPrice: json["unit_price"],
|
||||
purchasePrice: json["purchase_price"],
|
||||
variantProduct: json["variant_product"],
|
||||
attributes: List<String>.from(json["attributes"].map((x) => x)),
|
||||
choiceOptions: List<ChoiceOption>.from(json["choice_options"].map((x) => ChoiceOption.fromJson(x))),
|
||||
colors: List<String>.from(json["colors"].map((x) => x)),
|
||||
variations: json["variations"],
|
||||
stocks: Stock.fromJson(json["stocks"]),
|
||||
todaysDeal: json["todays_deal"],
|
||||
published: json["published"],
|
||||
approved: json["approved"],
|
||||
stockVisibilityState: json["stock_visibility_state"],
|
||||
cashOnDelivery: json["cash_on_delivery"],
|
||||
featured: json["featured"],
|
||||
sellerFeatured: json["seller_featured"]??0,
|
||||
refundable: json["refundable"],
|
||||
currentStock: json["current_stock"],
|
||||
weight: json["weight"],
|
||||
minQty: json["min_qty"],
|
||||
lowStockQuantity: json["low_stock_quantity"],
|
||||
discount: json["discount"],
|
||||
discountType: json["discount_type"],
|
||||
discountStartDate: json["discount_start_date"],
|
||||
discountEndDate: json["discount_end_date"],
|
||||
tax:List<Tax>.from(json["tax"].map((x) => Tax.fromJson(x))),
|
||||
taxType: json["tax_type"],
|
||||
shippingType: json["shipping_type"],
|
||||
shippingCost: json["shipping_cost"],
|
||||
isQuantityMultiplied: json["is_quantity_multiplied"],
|
||||
estShippingDays: json["est_shipping_days"],
|
||||
numOfSale: json["num_of_sale"],
|
||||
metaTitle: json["meta_title"],
|
||||
metaDescription: json["meta_description"],
|
||||
// metaImg: json["meta_img"],
|
||||
metaImg: Photos.fromJson(json["meta_img"]),
|
||||
pdf: Photos.fromJson(json["pdf"]),
|
||||
slug: json["slug"],
|
||||
rating: json["rating"],
|
||||
barcode: json["barcode"],
|
||||
digital: json["digital"],
|
||||
auctionProduct: json["auction_product"],
|
||||
fileName: json["file_name"],
|
||||
filePath: json["file_path"],
|
||||
externalLink: json["external_link"],
|
||||
externalLinkBtn: json["external_link_btn"],
|
||||
wholesaleProduct: json["wholesale_product"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"lang": lang,
|
||||
"product_name": productName,
|
||||
"product_unit": productUnit,
|
||||
"description": description,
|
||||
"category_id": categoryId,
|
||||
"brand_id": brandId,
|
||||
"photos": photos!.toJson(),
|
||||
"thumbnail_img": thumbnailImg!.toJson(),
|
||||
"video_provider": videoProvider,
|
||||
"video_link": videoLink,
|
||||
"tags": tags,
|
||||
"unit_price": unitPrice,
|
||||
"purchase_price": purchasePrice,
|
||||
"variant_product": variantProduct,
|
||||
"attributes": List<dynamic>.from(attributes!.map((x) => x)),
|
||||
"choice_options": List<dynamic>.from(choiceOptions!.map((x) => x.toJson())),
|
||||
"colors": List<dynamic>.from(colors!.map((x) => x)),
|
||||
"variations": variations,
|
||||
"stocks": stocks!.toJson(),
|
||||
"todays_deal": todaysDeal,
|
||||
"published": published,
|
||||
"approved": approved,
|
||||
"stock_visibility_state": stockVisibilityState,
|
||||
"cash_on_delivery": cashOnDelivery,
|
||||
"featured": featured,
|
||||
"seller_featured": sellerFeatured,
|
||||
"refundable": refundable,
|
||||
"current_stock": currentStock,
|
||||
"weight": weight,
|
||||
"min_qty": minQty,
|
||||
"low_stock_quantity": lowStockQuantity,
|
||||
"discount": discount,
|
||||
"discount_type": discountType,
|
||||
"discount_start_date": discountStartDate,
|
||||
"discount_end_date": discountEndDate,
|
||||
"tax": List<dynamic>.from(tax!.map((x) => x.toJson())),
|
||||
"tax_type": taxType,
|
||||
"shipping_type": shippingType,
|
||||
"shipping_cost": shippingCost,
|
||||
"is_quantity_multiplied": isQuantityMultiplied,
|
||||
"est_shipping_days": estShippingDays,
|
||||
"num_of_sale": numOfSale,
|
||||
"meta_title": metaTitle,
|
||||
"meta_description": metaDescription,
|
||||
"meta_img": metaImg!.toJson(),
|
||||
"pdf": pdf!.toJson(),
|
||||
"slug": slug,
|
||||
"rating": rating,
|
||||
"barcode": barcode,
|
||||
"digital": digital,
|
||||
"auction_product": auctionProduct,
|
||||
"file_name": fileName,
|
||||
"file_path": filePath,
|
||||
"external_link": externalLink,
|
||||
"external_link_btn": externalLinkBtn,
|
||||
"wholesale_product": wholesaleProduct,
|
||||
"created_at": createdAt!.toIso8601String(),
|
||||
"updated_at": updatedAt!.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
class ChoiceOption {
|
||||
ChoiceOption({
|
||||
this.attributeId,
|
||||
this.values,
|
||||
});
|
||||
|
||||
String? attributeId;
|
||||
List<String>? values;
|
||||
|
||||
factory ChoiceOption.fromJson(Map<String, dynamic> json) => ChoiceOption(
|
||||
attributeId: json["attribute_id"],
|
||||
values: List<String>.from(json["values"].map((x) => x)),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"attribute_id": attributeId,
|
||||
"values": List<dynamic>.from(values!.map((x) => x)),
|
||||
};
|
||||
}
|
||||
|
||||
class StockValues {
|
||||
StockValues({
|
||||
this.id,
|
||||
this.fileOriginalName,
|
||||
this.fileName,
|
||||
this.url,
|
||||
this.fileSize,
|
||||
this.extension,
|
||||
this.type,
|
||||
this.productId,
|
||||
this.variant,
|
||||
this.sku,
|
||||
this.price,
|
||||
this.qty,
|
||||
this.image,
|
||||
});
|
||||
|
||||
var id;
|
||||
String? fileOriginalName;
|
||||
String? fileName;
|
||||
String? url;
|
||||
var fileSize;
|
||||
String? extension;
|
||||
String? type;
|
||||
var productId;
|
||||
String? variant;
|
||||
String? sku;
|
||||
var price;
|
||||
var qty;
|
||||
Photos? image;
|
||||
|
||||
factory StockValues.fromJson(Map<String, dynamic> json) => StockValues(
|
||||
id: json["id"],
|
||||
fileOriginalName: json["file_original_name"],
|
||||
fileName: json["file_name"],
|
||||
url: json["url"],
|
||||
fileSize: json["file_size"],
|
||||
extension: json["extension"],
|
||||
type: json["type"],
|
||||
productId: json["product_id"],
|
||||
variant: json["variant"],
|
||||
sku: json["sku"],
|
||||
price: json["price"],
|
||||
qty: json["qty"],
|
||||
image: json["image"] == null ? null : Photos.fromJson(json["image"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"file_original_name": fileOriginalName,
|
||||
"file_name": fileName,
|
||||
"url": url,
|
||||
"file_size": fileSize,
|
||||
"extension": extension,
|
||||
"type": type,
|
||||
"product_id": productId,
|
||||
"variant": variant,
|
||||
"sku": sku,
|
||||
"price": price,
|
||||
"qty": qty,
|
||||
"image": image!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Photos {
|
||||
Photos({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<FileInfo>? data;
|
||||
factory Photos.fromJson(Map<String, dynamic> json) => Photos(
|
||||
data: List<FileInfo>.from(json["data"].map((x) => FileInfo.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Stock {
|
||||
Stock({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<StockValues>? data;
|
||||
|
||||
factory Stock.fromJson(Map<String, dynamic> json) => Stock(
|
||||
data: List<StockValues>.from(json["data"].map((x) => StockValues.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Tax {
|
||||
Tax({
|
||||
this.id,
|
||||
this.productId,
|
||||
this.taxId,
|
||||
this.tax,
|
||||
this.taxType,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
var id;
|
||||
var productId;
|
||||
var taxId;
|
||||
var tax;
|
||||
String? taxType;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
factory Tax.fromJson(Map<String, dynamic> json) => Tax(
|
||||
id: json["id"],
|
||||
productId: json["product_id"],
|
||||
taxId: json["tax_id"],
|
||||
tax: json["tax"],
|
||||
taxType: json["tax_type"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"product_id": productId,
|
||||
"tax_id": taxId,
|
||||
"tax": tax,
|
||||
"tax_type": taxType,
|
||||
"created_at": createdAt!.toIso8601String(),
|
||||
"updated_at": updatedAt!.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
45
source_code/lib/data_model/product/tax_response_model.dart
Normal file
45
source_code/lib/data_model/product/tax_response_model.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final taxResponse = taxResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
TaxResponse taxResponseFromJson(String str) => TaxResponse.fromJson(json.decode(str));
|
||||
|
||||
String taxResponseToJson(TaxResponse data) => json.encode(data.toJson());
|
||||
|
||||
class TaxResponse {
|
||||
TaxResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<Datum>? data;
|
||||
|
||||
factory TaxResponse.fromJson(Map<String, dynamic> json) => TaxResponse(
|
||||
data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Datum {
|
||||
Datum({
|
||||
this.id,
|
||||
this.name,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
factory Datum.fromJson(Map<String, dynamic> json) => Datum(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
};
|
||||
}
|
||||
18
source_code/lib/data_model/product/vat_tax_model.dart
Normal file
18
source_code/lib/data_model/product/vat_tax_model.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import 'package:active_ecommerce_seller_app/const/dropdown_models.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VatTaxModel{
|
||||
String id ,name;
|
||||
VatTaxModel(this.id, this.name);
|
||||
}
|
||||
class VatTaxViewModel{
|
||||
VatTaxModel vatTaxModel;
|
||||
TextEditingController amount= TextEditingController(text: "0");
|
||||
List<CommonDropDownItem> items;
|
||||
CommonDropDownItem? selectedItem;
|
||||
VatTaxViewModel(this.vatTaxModel, this.items,{CommonDropDownItem? selectedItem,String? amount}) {
|
||||
this.selectedItem= selectedItem ?? items.first;
|
||||
this.amount.text=amount??"0";
|
||||
}
|
||||
}
|
||||
29
source_code/lib/data_model/product_delete_response.dart
Normal file
29
source_code/lib/data_model/product_delete_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final deleteProduct = deleteProductFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
DeleteProduct deleteProductFromJson(String str) => DeleteProduct.fromJson(json.decode(str));
|
||||
|
||||
String deleteProductToJson(DeleteProduct data) => json.encode(data.toJson());
|
||||
|
||||
class DeleteProduct {
|
||||
DeleteProduct({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory DeleteProduct.fromJson(Map<String, dynamic> json) => DeleteProduct(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/product_duplicate_response.dart
Normal file
29
source_code/lib/data_model/product_duplicate_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final productDuplicateResponse = productDuplicateResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ProductDuplicateResponse productDuplicateResponseFromJson(String str) => ProductDuplicateResponse.fromJson(json.decode(str));
|
||||
|
||||
String productDuplicateResponseToJson(ProductDuplicateResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ProductDuplicateResponse {
|
||||
ProductDuplicateResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory ProductDuplicateResponse.fromJson(Map<String, dynamic> json) => ProductDuplicateResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
69
source_code/lib/data_model/product_for_coupon_response.dart
Normal file
69
source_code/lib/data_model/product_for_coupon_response.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final productForCouponResponse = productForCouponResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ProductForCouponResponse productForCouponResponseFromJson(String str) => ProductForCouponResponse.fromJson(json.decode(str));
|
||||
|
||||
String productForCouponResponseToJson(ProductForCouponResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ProductForCouponResponse {
|
||||
ProductForCouponResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<CouponProduct>? data;
|
||||
|
||||
factory ProductForCouponResponse.fromJson(Map<String, dynamic> json) => ProductForCouponResponse(
|
||||
data: List<CouponProduct>.from(json["data"].map((x) => CouponProduct.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class CouponProduct {
|
||||
CouponProduct({
|
||||
this.id,
|
||||
this.name,
|
||||
this.thumbnailImg,
|
||||
this.price,
|
||||
this.currentStock,
|
||||
this.status,
|
||||
this.category,
|
||||
this.featured,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? thumbnailImg;
|
||||
String? price;
|
||||
var currentStock;
|
||||
bool? status;
|
||||
String? category;
|
||||
bool? featured;
|
||||
|
||||
factory CouponProduct.fromJson(Map<String, dynamic> json) => CouponProduct(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
thumbnailImg: json["thumbnail_img"],
|
||||
price: json["price"],
|
||||
currentStock: json["current_stock"],
|
||||
status: json["status"],
|
||||
category: json["category"],
|
||||
featured: json["featured"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"thumbnail_img": thumbnailImg,
|
||||
"price": price,
|
||||
"current_stock": currentStock,
|
||||
"status": status,
|
||||
"category": category,
|
||||
"featured": featured,
|
||||
};
|
||||
}
|
||||
177
source_code/lib/data_model/product_review_response.dart
Normal file
177
source_code/lib/data_model/product_review_response.dart
Normal file
@@ -0,0 +1,177 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final productReviewResponse = productReviewResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ProductReviewResponse productReviewResponseFromJson(String str) => ProductReviewResponse.fromJson(json.decode(str));
|
||||
|
||||
String productReviewResponseToJson(ProductReviewResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ProductReviewResponse {
|
||||
ProductReviewResponse({
|
||||
this.data,
|
||||
this.links,
|
||||
this.meta,
|
||||
});
|
||||
|
||||
List<Review>? data;
|
||||
Links? links;
|
||||
Meta? meta;
|
||||
|
||||
factory ProductReviewResponse.fromJson(Map<String, dynamic> json) => ProductReviewResponse(
|
||||
data: List<Review>.from(json["data"].map((x) => Review.fromJson(x))),
|
||||
links: Links.fromJson(json["links"]),
|
||||
meta: Meta.fromJson(json["meta"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"links": links!.toJson(),
|
||||
"meta": meta!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Review {
|
||||
Review({
|
||||
this.id,
|
||||
this.rating,
|
||||
this.comment,
|
||||
this.status,
|
||||
this.updatedAt,
|
||||
this.productName,
|
||||
this.userId,
|
||||
this.name,
|
||||
this.avatar,
|
||||
});
|
||||
|
||||
int? id;
|
||||
var rating;
|
||||
String? comment;
|
||||
int? status;
|
||||
DateTime? updatedAt;
|
||||
String? productName;
|
||||
int? userId;
|
||||
String? name;
|
||||
dynamic avatar;
|
||||
|
||||
factory Review.fromJson(Map<String, dynamic> json) => Review(
|
||||
id: json["id"],
|
||||
rating: json["rating"],
|
||||
comment: json["comment"],
|
||||
status: json["status"],
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
productName: json["product_name"],
|
||||
userId: json["user_id"],
|
||||
name: json["name"],
|
||||
avatar: json["avatar"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"rating": rating,
|
||||
"comment": comment,
|
||||
"status": status,
|
||||
"updated_at": updatedAt!.toIso8601String(),
|
||||
"product_name": productName,
|
||||
"user_id": userId,
|
||||
"name": name,
|
||||
"avatar": avatar,
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.first,
|
||||
this.last,
|
||||
this.prev,
|
||||
this.next,
|
||||
});
|
||||
|
||||
String? first;
|
||||
String? last;
|
||||
dynamic prev;
|
||||
String? next;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
first: json["first"],
|
||||
last: json["last"],
|
||||
prev: json["prev"],
|
||||
next: json["next"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"first": first,
|
||||
"last": last,
|
||||
"prev": prev,
|
||||
"next": next,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
Meta({
|
||||
this.currentPage,
|
||||
this.from,
|
||||
this.lastPage,
|
||||
this.links,
|
||||
this.path,
|
||||
this.perPage,
|
||||
this.to,
|
||||
this.total,
|
||||
});
|
||||
|
||||
int? currentPage;
|
||||
int? from;
|
||||
int? lastPage;
|
||||
List<Link>? links;
|
||||
String? path;
|
||||
int? perPage;
|
||||
int? to;
|
||||
int? total;
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
currentPage: json["current_page"],
|
||||
from: json["from"],
|
||||
lastPage: json["last_page"],
|
||||
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
|
||||
path: json["path"],
|
||||
perPage: json["per_page"],
|
||||
to: json["to"],
|
||||
total: json["total"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_page": currentPage,
|
||||
"from": from,
|
||||
"last_page": lastPage,
|
||||
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
|
||||
"path": path,
|
||||
"per_page": perPage,
|
||||
"to": to,
|
||||
"total": total,
|
||||
};
|
||||
}
|
||||
|
||||
class Link {
|
||||
Link({
|
||||
this.url,
|
||||
this.label,
|
||||
this.active,
|
||||
});
|
||||
|
||||
String? url;
|
||||
String? label;
|
||||
bool? active;
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) => Link(
|
||||
url: json["url"] == null ? null : json["url"],
|
||||
label: json["label"],
|
||||
active: json["active"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url == null ? null : url,
|
||||
"label": label,
|
||||
"active": active,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final ProductStatusChange = ProductStatusChangeFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ProductStatusChange ProductStatusChangeFromJson(String str) => ProductStatusChange.fromJson(json.decode(str));
|
||||
|
||||
String ProductStatusChangeToJson(ProductStatusChange data) => json.encode(data.toJson());
|
||||
|
||||
class ProductStatusChange {
|
||||
ProductStatusChange({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory ProductStatusChange.fromJson(Map<String, dynamic> json) => ProductStatusChange(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
174
source_code/lib/data_model/products_response.dart
Normal file
174
source_code/lib/data_model/products_response.dart
Normal file
@@ -0,0 +1,174 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final productsResponse = productsResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ProductsResponse productsResponseFromJson(String str) => ProductsResponse.fromJson(json.decode(str));
|
||||
|
||||
String productsResponseToJson(ProductsResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ProductsResponse {
|
||||
ProductsResponse({
|
||||
this.data,
|
||||
this.links,
|
||||
this.meta,
|
||||
|
||||
});
|
||||
|
||||
List<Product>? data;
|
||||
Links? links;
|
||||
Meta? meta;
|
||||
|
||||
factory ProductsResponse.fromJson(Map<String, dynamic> json) => ProductsResponse(
|
||||
data: List<Product>.from(json["data"].map((x) => Product.fromJson(x))),
|
||||
links: Links.fromJson(json["links"]),
|
||||
meta: Meta.fromJson(json["meta"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"links": links!.toJson(),
|
||||
"meta": meta!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Product {
|
||||
Product({
|
||||
this.id,
|
||||
this.name,
|
||||
this.thumbnailImg,
|
||||
this.price,
|
||||
this.status,
|
||||
this.category,
|
||||
this.featured,
|
||||
this.quantity
|
||||
});
|
||||
|
||||
var id;
|
||||
String? name;
|
||||
String? thumbnailImg;
|
||||
String? price;
|
||||
var status;
|
||||
String? category;
|
||||
var featured;
|
||||
var quantity;
|
||||
|
||||
factory Product.fromJson(Map<String, dynamic> json) => Product(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
thumbnailImg: json["thumbnail_img"],
|
||||
price: json["price"],
|
||||
status: json["status"],
|
||||
category: json["category"],
|
||||
featured: json["featured"],
|
||||
quantity: json["current_stock"]
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"thumbnail_img": thumbnailImg,
|
||||
"price": price,
|
||||
"status": status,
|
||||
"category": category,
|
||||
"featured": featured,
|
||||
"current_stock": quantity,
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.first,
|
||||
this.last,
|
||||
this.prev,
|
||||
this.next,
|
||||
});
|
||||
|
||||
String? first;
|
||||
String? last;
|
||||
dynamic prev;
|
||||
String? next;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
first: json["first"],
|
||||
last: json["last"],
|
||||
prev: json["prev"],
|
||||
next: json["next"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"first": first,
|
||||
"last": last,
|
||||
"prev": prev,
|
||||
"next": next,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
Meta({
|
||||
this.currentPage,
|
||||
this.from,
|
||||
this.lastPage,
|
||||
this.links,
|
||||
this.path,
|
||||
this.perPage,
|
||||
this.to,
|
||||
this.total,
|
||||
});
|
||||
|
||||
int? currentPage;
|
||||
int? from;
|
||||
int? lastPage;
|
||||
List<Link>? links;
|
||||
String? path;
|
||||
int? perPage;
|
||||
int? to;
|
||||
int? total;
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
currentPage: json["current_page"],
|
||||
from: json["from"],
|
||||
lastPage: json["last_page"],
|
||||
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
|
||||
path: json["path"],
|
||||
perPage: json["per_page"],
|
||||
to: json["to"],
|
||||
total: json["total"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_page": currentPage,
|
||||
"from": from,
|
||||
"last_page": lastPage,
|
||||
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
|
||||
"path": path,
|
||||
"per_page": perPage,
|
||||
"to": to,
|
||||
"total": total,
|
||||
};
|
||||
}
|
||||
|
||||
class Link {
|
||||
Link({
|
||||
this.url,
|
||||
this.label,
|
||||
this.active,
|
||||
});
|
||||
|
||||
String? url;
|
||||
String? label;
|
||||
bool? active;
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) => Link(
|
||||
url: json["url"] == null ? null : json["url"],
|
||||
label: json["label"],
|
||||
active: json["active"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url == null ? null : url,
|
||||
"label": label,
|
||||
"active": active,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final profileImageUpdateResponse = profileImageUpdateResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ProfileImageUpdateResponse profileImageUpdateResponseFromJson(String str) => ProfileImageUpdateResponse.fromJson(json.decode(str));
|
||||
|
||||
String profileImageUpdateResponseToJson(ProfileImageUpdateResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ProfileImageUpdateResponse {
|
||||
ProfileImageUpdateResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
this.path,
|
||||
this.upload_id
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
String? path;
|
||||
var upload_id;
|
||||
|
||||
factory ProfileImageUpdateResponse.fromJson(Map<String, dynamic> json) => ProfileImageUpdateResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
path: json["path"],
|
||||
upload_id: json["upload_id"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
"path": path,
|
||||
"upload_id": upload_id,
|
||||
};
|
||||
}
|
||||
53
source_code/lib/data_model/profile_response.dart
Normal file
53
source_code/lib/data_model/profile_response.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final sellerProfileResponse = sellerProfileResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
SellerProfileResponse sellerProfileResponseFromJson(String str) => SellerProfileResponse.fromJson(json.decode(str));
|
||||
|
||||
String sellerProfileResponseToJson(SellerProfileResponse data) => json.encode(data.toJson());
|
||||
|
||||
class SellerProfileResponse {
|
||||
SellerProfileResponse({
|
||||
this.result,
|
||||
this.id,
|
||||
this.type,
|
||||
this.name,
|
||||
this.email,
|
||||
this.avatar,
|
||||
this.avatarOriginal,
|
||||
this.phone,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
int? id;
|
||||
String? type;
|
||||
String? name;
|
||||
String? email;
|
||||
String? avatar;
|
||||
String? avatarOriginal;
|
||||
dynamic phone;
|
||||
|
||||
factory SellerProfileResponse.fromJson(Map<String, dynamic> json) => SellerProfileResponse(
|
||||
result: json["result"],
|
||||
id: json["id"],
|
||||
type: json["type"],
|
||||
name: json["name"],
|
||||
email: json["email"],
|
||||
avatar: json["avatar"],
|
||||
avatarOriginal: json["avatar_original"],
|
||||
phone: json["phone"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"id": id,
|
||||
"type": type,
|
||||
"name": name,
|
||||
"email": email,
|
||||
"avatar": avatar,
|
||||
"avatar_original": avatarOriginal,
|
||||
"phone": phone,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/profile_update_response.dart
Normal file
29
source_code/lib/data_model/profile_update_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final profileUpdateResponse = profileUpdateResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ProfileUpdateResponse profileUpdateResponseFromJson(String str) => ProfileUpdateResponse.fromJson(json.decode(str));
|
||||
|
||||
String profileUpdateResponseToJson(ProfileUpdateResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ProfileUpdateResponse {
|
||||
ProfileUpdateResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory ProfileUpdateResponse.fromJson(Map<String, dynamic> json) => ProfileUpdateResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
21
source_code/lib/data_model/remainig_product_response.dart
Normal file
21
source_code/lib/data_model/remainig_product_response.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'dart:convert';
|
||||
|
||||
RemainingProduct remainingProductFromJson(String str) => RemainingProduct.fromJson(json.decode(str));
|
||||
|
||||
String remainingProductToJson(RemainingProduct data) => json.encode(data.toJson());
|
||||
|
||||
class RemainingProduct {
|
||||
RemainingProduct({
|
||||
this.ramainingProduct,
|
||||
});
|
||||
|
||||
var ramainingProduct;
|
||||
|
||||
factory RemainingProduct.fromJson(Map<String, dynamic> json) => RemainingProduct(
|
||||
ramainingProduct: json["ramaining_product"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"ramaining_product": ramainingProduct,
|
||||
};
|
||||
}
|
||||
29
source_code/lib/data_model/resend_code_response.dart
Normal file
29
source_code/lib/data_model/resend_code_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final resendCodeResponse = resendCodeResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ResendCodeResponse resendCodeResponseFromJson(String str) => ResendCodeResponse.fromJson(json.decode(str));
|
||||
|
||||
String resendCodeResponseToJson(ResendCodeResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ResendCodeResponse {
|
||||
ResendCodeResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
|
||||
factory ResendCodeResponse.fromJson(Map<String, dynamic> json) => ResendCodeResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
65
source_code/lib/data_model/seller_package_response.dart
Normal file
65
source_code/lib/data_model/seller_package_response.dart
Normal file
@@ -0,0 +1,65 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final sellerPackageResponse = sellerPackageResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
SellerPackageResponse sellerPackageResponseFromJson(String str) => SellerPackageResponse.fromJson(json.decode(str));
|
||||
|
||||
String sellerPackageResponseToJson(SellerPackageResponse data) => json.encode(data.toJson());
|
||||
|
||||
class SellerPackageResponse {
|
||||
SellerPackageResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<Package>? data;
|
||||
|
||||
factory SellerPackageResponse.fromJson(Map<String, dynamic> json) => SellerPackageResponse(
|
||||
data: List<Package>.from(json["data"].map((x) => Package.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Package {
|
||||
Package({
|
||||
this.id,
|
||||
this.name,
|
||||
this.logo,
|
||||
this.productUploadLimit,
|
||||
this.amount,
|
||||
this.price,
|
||||
this.duration,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? logo;
|
||||
int? productUploadLimit;
|
||||
String? amount;
|
||||
var price;
|
||||
int? duration;
|
||||
|
||||
factory Package.fromJson(Map<String, dynamic> json) => Package(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
logo: json["logo"],
|
||||
productUploadLimit: json["product_upload_limit"],
|
||||
amount: json["amount"],
|
||||
price: json["price"],
|
||||
duration: json["duration"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"logo": logo,
|
||||
"product_upload_limit": productUploadLimit,
|
||||
"amount": amount,
|
||||
"price": price,
|
||||
"duration": duration,
|
||||
};
|
||||
}
|
||||
197
source_code/lib/data_model/shop_info_response.dart
Normal file
197
source_code/lib/data_model/shop_info_response.dart
Normal file
@@ -0,0 +1,197 @@
|
||||
// To parse this JSON ShopInfo, do
|
||||
//
|
||||
// final shopInfoResponse = shopInfoResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ShopInfoResponse shopInfoResponseFromJson(String str) => ShopInfoResponse.fromJson(json.decode(str));
|
||||
|
||||
String shopInfoResponseToJson(ShopInfoResponse ShopInfo) => json.encode(ShopInfo.toJson());
|
||||
|
||||
class ShopInfoResponse {
|
||||
ShopInfoResponse({
|
||||
this.shopInfo,
|
||||
this.success,
|
||||
this.status,
|
||||
});
|
||||
|
||||
ShopInfo? shopInfo;
|
||||
bool? success;
|
||||
var status;
|
||||
|
||||
factory ShopInfoResponse.fromJson(Map<String, dynamic> json) => ShopInfoResponse(
|
||||
shopInfo: ShopInfo.fromJson(json["data"]),
|
||||
success: json["success"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": shopInfo!.toJson(),
|
||||
"success": success,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class ShopInfo {
|
||||
ShopInfo({
|
||||
this.id,
|
||||
this.userId,
|
||||
this.name,
|
||||
this.title,
|
||||
this.description,
|
||||
this.deliveryPickupLatitude,
|
||||
this.deliveryPickupLongitude,
|
||||
this.logo,
|
||||
this.packageInvalidAt,
|
||||
this.productUploadLimit,
|
||||
this.sellerPackage,
|
||||
this.sellerPackageImg,
|
||||
this.uploadId,
|
||||
this.sliders,
|
||||
this.slidersId,
|
||||
this.address,
|
||||
this.adminToPay,
|
||||
this.is_submitted_form,
|
||||
this.phone,
|
||||
this.facebook,
|
||||
this.google,
|
||||
this.twitter,
|
||||
this.instagram,
|
||||
this.youtube,
|
||||
this.cashOnDeliveryStatus,
|
||||
this.bank_payment_status,
|
||||
this.bankName,
|
||||
this.bankAccName,
|
||||
this.bankAccNo,
|
||||
this.bankRoutingNo,
|
||||
this.rating,
|
||||
this.verified,
|
||||
this.verifiedImg,
|
||||
this.verifyText,
|
||||
this.email,
|
||||
this.products,
|
||||
this.orders,
|
||||
this.sales,
|
||||
});
|
||||
|
||||
var id;
|
||||
var userId;
|
||||
String? name;
|
||||
String? title;
|
||||
String? description;
|
||||
dynamic deliveryPickupLatitude;
|
||||
dynamic deliveryPickupLongitude;
|
||||
String? logo;
|
||||
String? packageInvalidAt;
|
||||
var productUploadLimit;
|
||||
String? sellerPackage;
|
||||
String? sellerPackageImg;
|
||||
String? uploadId;
|
||||
List<String>? sliders;
|
||||
dynamic slidersId;
|
||||
String? address;
|
||||
var adminToPay;
|
||||
bool? is_submitted_form;
|
||||
String? phone;
|
||||
String? facebook;
|
||||
String? google;
|
||||
String? twitter;
|
||||
dynamic instagram;
|
||||
String? youtube;
|
||||
var cashOnDeliveryStatus;
|
||||
var bank_payment_status;
|
||||
String? bankName;
|
||||
String? bankAccName;
|
||||
String? bankAccNo;
|
||||
var bankRoutingNo;
|
||||
double? rating;
|
||||
bool? verified;
|
||||
String? verifiedImg;
|
||||
String? verifyText;
|
||||
String? email;
|
||||
var products;
|
||||
var orders;
|
||||
String? sales;
|
||||
|
||||
factory ShopInfo.fromJson(Map<String, dynamic> json) => ShopInfo(
|
||||
id: json["id"],
|
||||
userId: json["user_id"],
|
||||
name: json["name"],
|
||||
title: json["title"],
|
||||
description: json["description"],
|
||||
deliveryPickupLatitude: json["delivery_pickup_latitude"]??"",
|
||||
deliveryPickupLongitude: json["delivery_pickup_longitude"]??"",
|
||||
logo: json["logo"],
|
||||
packageInvalidAt: json["package_invalid_at"],
|
||||
productUploadLimit: json["product_upload_limit"],
|
||||
sellerPackage: json["seller_package"],
|
||||
sellerPackageImg: json["seller_package_img"],
|
||||
uploadId: json["upload_id"],
|
||||
sliders: List<String>.from(json["sliders"].map((x) => x)),
|
||||
slidersId: json["sliders_id"],
|
||||
address: json["address"],
|
||||
adminToPay: json["admin_to_pay"],
|
||||
is_submitted_form: json["is_submitted_form"],
|
||||
phone: json["phone"],
|
||||
facebook: json["facebook"],
|
||||
google: json["google"],
|
||||
twitter: json["twitter"],
|
||||
instagram: json["instagram"],
|
||||
youtube: json["youtube"],
|
||||
cashOnDeliveryStatus: json["cash_on_delivery_status"],
|
||||
bank_payment_status: json["bank_payment_status"],
|
||||
bankName: json["bank_name"],
|
||||
bankAccName: json["bank_acc_name"],
|
||||
bankAccNo: json["bank_acc_no"],
|
||||
bankRoutingNo: json["bank_routing_no"]??"",
|
||||
rating: json["rating"].toDouble(),
|
||||
verified: json["verified"],
|
||||
verifiedImg: json["verified_img"],
|
||||
verifyText: json["verify_text"],
|
||||
email: json["email"],
|
||||
products: json["products"],
|
||||
orders: json["orders"],
|
||||
sales: json["sales"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"user_id": userId,
|
||||
"name": name,
|
||||
"title": title,
|
||||
"description": description,
|
||||
"delivery_pickup_latitude": deliveryPickupLatitude,
|
||||
"delivery_pickup_longitude": deliveryPickupLongitude,
|
||||
"logo": logo,
|
||||
"package_invalid_at": packageInvalidAt,
|
||||
"product_upload_limit": productUploadLimit,
|
||||
"seller_package": sellerPackage,
|
||||
"seller_package_img": sellerPackageImg,
|
||||
"upload_id": uploadId,
|
||||
"sliders": List<dynamic>.from(sliders!.map((x) => x)),
|
||||
"sliders_id": slidersId,
|
||||
"address": address,
|
||||
"admin_to_pay": adminToPay,
|
||||
"is_submitted_form": is_submitted_form,
|
||||
"phone": phone,
|
||||
"facebook": facebook,
|
||||
"google": google,
|
||||
"twitter": twitter,
|
||||
"instagram": instagram,
|
||||
"youtube": youtube,
|
||||
"cash_on_delivery_status": cashOnDeliveryStatus,
|
||||
"bank_payment_status": bank_payment_status,
|
||||
"bank_name": bankName,
|
||||
"bank_acc_name": bankAccName,
|
||||
"bank_acc_no": bankAccNo,
|
||||
"bank_routing_no": bankRoutingNo,
|
||||
"rating": rating,
|
||||
"verified": verified,
|
||||
"verified_img": verifiedImg,
|
||||
"verify_text": verifyText,
|
||||
"email": email,
|
||||
"products": products,
|
||||
"orders": orders,
|
||||
"sales": sales,
|
||||
};
|
||||
}
|
||||
37
source_code/lib/data_model/shop_package_response.dart
Normal file
37
source_code/lib/data_model/shop_package_response.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final shopPackageResponse = shopPackageResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ShopPackageResponse shopPackageResponseFromJson(String str) => ShopPackageResponse.fromJson(json.decode(str));
|
||||
|
||||
String shopPackageResponseToJson(ShopPackageResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ShopPackageResponse {
|
||||
ShopPackageResponse({
|
||||
this.result,
|
||||
this.id,
|
||||
this.packageName,
|
||||
this.packageImg,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
int? id;
|
||||
String? packageName;
|
||||
String? packageImg;
|
||||
|
||||
factory ShopPackageResponse.fromJson(Map<String, dynamic> json) => ShopPackageResponse(
|
||||
result: json["result"],
|
||||
id: json["id"],
|
||||
packageName: json["package_name"],
|
||||
packageImg: json["package_img"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"id": id,
|
||||
"package_name": packageName,
|
||||
"package_img": packageImg,
|
||||
};
|
||||
}
|
||||
277
source_code/lib/data_model/shop_response.dart
Normal file
277
source_code/lib/data_model/shop_response.dart
Normal file
@@ -0,0 +1,277 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final shopResponse = shopResponseFromJson(jsonString);
|
||||
/*
|
||||
import 'dart:convert';
|
||||
|
||||
ShopResponse shopResponseFromJson(String str) => ShopResponse.fromJson(json.decode(str));
|
||||
|
||||
String shopResponseToJson(ShopResponse data) => json.encode(data.toJson());
|
||||
/*
|
||||
class ShopResponse {
|
||||
ShopResponse({
|
||||
this.id,
|
||||
this.userId,
|
||||
this.name,
|
||||
this.logo,
|
||||
this.sliders,
|
||||
this.phone,
|
||||
this.address,
|
||||
this.rating,
|
||||
this.numOfReviews,
|
||||
this.numOfSale,
|
||||
this.sellerPackageId,
|
||||
this.productUploadLimit,
|
||||
this.packageInvalidAt,
|
||||
this.verificationStatus,
|
||||
this.verificationInfo,
|
||||
this.cashOnDeliveryStatus,
|
||||
this.adminToPay,
|
||||
this.facebook,
|
||||
this.google,
|
||||
this.twitter,
|
||||
this.youtube,
|
||||
this.slug,
|
||||
this.metaTitle,
|
||||
this.metaDescription,
|
||||
this.pickUpPointId,
|
||||
this.shippingCost,
|
||||
this.deliveryPickupLatitude,
|
||||
this.deliveryPickupLongitude,
|
||||
this.bankName,
|
||||
this.bankAccName,
|
||||
this.bankAccNo,
|
||||
this.bankRoutingNo,
|
||||
this.bankPaymentStatus,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.user,
|
||||
});
|
||||
|
||||
int id;
|
||||
int userId;
|
||||
String name;
|
||||
dynamic logo;
|
||||
dynamic sliders;
|
||||
dynamic phone;
|
||||
String address;
|
||||
double rating;
|
||||
var numOfReviews;
|
||||
var numOfSale;
|
||||
dynamic sellerPackageId;
|
||||
var productUploadLimit;
|
||||
dynamic packageInvalidAt;
|
||||
var verificationStatus;
|
||||
String verificationInfo;
|
||||
var cashOnDeliveryStatus;
|
||||
double adminToPay;
|
||||
String facebook;
|
||||
String google;
|
||||
String twitter;
|
||||
String youtube;
|
||||
String slug;
|
||||
String metaTitle;
|
||||
String metaDescription;
|
||||
dynamic pickUpPointId;
|
||||
var shippingCost;
|
||||
dynamic deliveryPickupLatitude;
|
||||
dynamic deliveryPickupLongitude;
|
||||
dynamic bankName;
|
||||
dynamic bankAccName;
|
||||
dynamic bankAccNo;
|
||||
dynamic bankRoutingNo;
|
||||
var bankPaymentStatus;
|
||||
DateTime createdAt;
|
||||
DateTime updatedAt;
|
||||
User user;
|
||||
|
||||
factory ShopResponse.fromJson(Map<String, dynamic> json) => ShopResponse(
|
||||
id: json["id"],
|
||||
userId: json["user_id"],
|
||||
name: json["name"],
|
||||
logo: json["logo"],
|
||||
sliders: json["sliders"],
|
||||
phone: json["phone"],
|
||||
address: json["address"],
|
||||
rating: double.parse(json["rating"].toString()),
|
||||
numOfReviews: json["num_of_reviews"],
|
||||
numOfSale: json["num_of_sale"],
|
||||
sellerPackageId: json["seller_package_id"],
|
||||
productUploadLimit: json["product_upload_limit"],
|
||||
packageInvalidAt: json["package_invalid_at"],
|
||||
verificationStatus: json["verification_status"],
|
||||
verificationInfo: json["verification_info"],
|
||||
cashOnDeliveryStatus: json["cash_on_delivery_status"],
|
||||
adminToPay: json["admin_to_pay"].toDouble(),
|
||||
facebook: json["facebook"],
|
||||
google: json["google"],
|
||||
twitter: json["twitter"],
|
||||
youtube: json["youtube"],
|
||||
slug: json["slug"],
|
||||
metaTitle: json["meta_title"],
|
||||
metaDescription: json["meta_description"],
|
||||
pickUpPointId: json["pick_up_point_id"],
|
||||
shippingCost: json["shipping_cost"],
|
||||
deliveryPickupLatitude: json["delivery_pickup_latitude"],
|
||||
deliveryPickupLongitude: json["delivery_pickup_longitude"],
|
||||
bankName: json["bank_name"],
|
||||
bankAccName: json["bank_acc_name"],
|
||||
bankAccNo: json["bank_acc_no"],
|
||||
bankRoutingNo: json["bank_routing_no"],
|
||||
bankPaymentStatus: json["bank_payment_status"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
user: User.fromJson(json["user"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"user_id": userId,
|
||||
"name": name,
|
||||
"logo": logo,
|
||||
"sliders": sliders,
|
||||
"phone": phone,
|
||||
"address": address,
|
||||
"rating": rating,
|
||||
"num_of_reviews": numOfReviews,
|
||||
"num_of_sale": numOfSale,
|
||||
"seller_package_id": sellerPackageId,
|
||||
"product_upload_limit": productUploadLimit,
|
||||
"package_invalid_at": packageInvalidAt,
|
||||
"verification_status": verificationStatus,
|
||||
"verification_info": verificationInfo,
|
||||
"cash_on_delivery_status": cashOnDeliveryStatus,
|
||||
"admin_to_pay": adminToPay,
|
||||
"facebook": facebook,
|
||||
"google": google,
|
||||
"twitter": twitter,
|
||||
"youtube": youtube,
|
||||
"slug": slug,
|
||||
"meta_title": metaTitle,
|
||||
"meta_description": metaDescription,
|
||||
"pick_up_point_id": pickUpPointId,
|
||||
"shipping_cost": shippingCost,
|
||||
"delivery_pickup_latitude": deliveryPickupLatitude,
|
||||
"delivery_pickup_longitude": deliveryPickupLongitude,
|
||||
"bank_name": bankName,
|
||||
"bank_acc_name": bankAccName,
|
||||
"bank_acc_no": bankAccNo,
|
||||
"bank_routing_no": bankRoutingNo,
|
||||
"bank_payment_status": bankPaymentStatus,
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"updated_at": updatedAt.toIso8601String(),
|
||||
"user": user.toJson(),
|
||||
};
|
||||
}*/
|
||||
|
||||
class User {
|
||||
User({
|
||||
this.id,
|
||||
this.referredBy,
|
||||
this.providerId,
|
||||
this.userType,
|
||||
this.name,
|
||||
this.email,
|
||||
this.emailVerifiedAt,
|
||||
this.verificationCode,
|
||||
this.newEmailVerificiationCode,
|
||||
this.deviceToken,
|
||||
this.avatar,
|
||||
this.avatarOriginal,
|
||||
this.address,
|
||||
this.country,
|
||||
this.state,
|
||||
this.city,
|
||||
this.postalCode,
|
||||
this.phone,
|
||||
this.balance,
|
||||
this.banned,
|
||||
this.referralCode,
|
||||
this.customerPackageId,
|
||||
this.remainingUploads,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
int id;
|
||||
dynamic referredBy;
|
||||
dynamic providerId;
|
||||
String userType;
|
||||
String name;
|
||||
String email;
|
||||
DateTime emailVerifiedAt;
|
||||
dynamic verificationCode;
|
||||
dynamic newEmailVerificiationCode;
|
||||
String deviceToken;
|
||||
String avatar;
|
||||
dynamic avatarOriginal;
|
||||
String address;
|
||||
String country;
|
||||
dynamic state;
|
||||
String city;
|
||||
String postalCode;
|
||||
dynamic phone;
|
||||
int balance;
|
||||
int banned;
|
||||
String referralCode;
|
||||
dynamic customerPackageId;
|
||||
dynamic remainingUploads;
|
||||
DateTime createdAt;
|
||||
DateTime updatedAt;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => User(
|
||||
id: json["id"],
|
||||
referredBy: json["referred_by"],
|
||||
providerId: json["provider_id"],
|
||||
userType: json["user_type"],
|
||||
name: json["name"],
|
||||
email: json["email"],
|
||||
emailVerifiedAt: DateTime.parse(json["email_verified_at"]),
|
||||
verificationCode: json["verification_code"],
|
||||
newEmailVerificiationCode: json["new_email_verificiation_code"],
|
||||
deviceToken: json["device_token"],
|
||||
avatar: json["avatar"],
|
||||
avatarOriginal: json["avatar_original"],
|
||||
address: json["address"],
|
||||
country: json["country"],
|
||||
state: json["state"],
|
||||
city: json["city"],
|
||||
postalCode: json["postal_code"],
|
||||
phone: json["phone"],
|
||||
balance: json["balance"],
|
||||
banned: json["banned"],
|
||||
referralCode: json["referral_code"],
|
||||
customerPackageId: json["customer_package_id"],
|
||||
remainingUploads: json["remaining_uploads"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"referred_by": referredBy,
|
||||
"provider_id": providerId,
|
||||
"user_type": userType,
|
||||
"name": name,
|
||||
"email": email,
|
||||
"email_verified_at": emailVerifiedAt.toIso8601String(),
|
||||
"verification_code": verificationCode,
|
||||
"new_email_verificiation_code": newEmailVerificiationCode,
|
||||
"device_token": deviceToken,
|
||||
"avatar": avatar,
|
||||
"avatar_original": avatarOriginal,
|
||||
"address": address,
|
||||
"country": country,
|
||||
"state": state,
|
||||
"city": city,
|
||||
"postal_code": postalCode,
|
||||
"phone": phone,
|
||||
"balance": balance,
|
||||
"banned": banned,
|
||||
"referral_code": referralCode,
|
||||
"customer_package_id": customerPackageId,
|
||||
"remaining_uploads": remainingUploads,
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"updated_at": updatedAt.toIso8601String(),
|
||||
};
|
||||
}*/
|
||||
37
source_code/lib/data_model/simple_image_upload_response.dart
Normal file
37
source_code/lib/data_model/simple_image_upload_response.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final simpleImageUploadResponse = simpleImageUploadResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
SimpleImageUploadResponse simpleImageUploadResponseFromJson(String str) => SimpleImageUploadResponse.fromJson(json.decode(str));
|
||||
|
||||
String simpleImageUploadResponseToJson(SimpleImageUploadResponse data) => json.encode(data.toJson());
|
||||
|
||||
class SimpleImageUploadResponse {
|
||||
SimpleImageUploadResponse({
|
||||
this.result,
|
||||
this.message,
|
||||
this.path,
|
||||
this.upload_id,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
String? message;
|
||||
String? path;
|
||||
int? upload_id;
|
||||
|
||||
factory SimpleImageUploadResponse.fromJson(Map<String, dynamic> json) => SimpleImageUploadResponse(
|
||||
result: json["result"],
|
||||
message: json["message"],
|
||||
path: json["path"],
|
||||
upload_id: json["upload_id"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result,
|
||||
"message": message,
|
||||
"path": path,
|
||||
"upload_id": upload_id,
|
||||
};
|
||||
}
|
||||
69
source_code/lib/data_model/top_12_product_response.dart
Normal file
69
source_code/lib/data_model/top_12_product_response.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final top12ProductResponse = top12ProductResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Top12ProductResponse top12ProductResponseFromJson(String str) => Top12ProductResponse.fromJson(json.decode(str));
|
||||
|
||||
String top12ProductResponseToJson(Top12ProductResponse data) => json.encode(data.toJson());
|
||||
|
||||
class Top12ProductResponse {
|
||||
Top12ProductResponse({
|
||||
this.data,
|
||||
});
|
||||
|
||||
List<ProductOfTop>? data;
|
||||
|
||||
factory Top12ProductResponse.fromJson(Map<String, dynamic> json) => Top12ProductResponse(
|
||||
data: List<ProductOfTop>.from(json["data"].map((x) => ProductOfTop.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class ProductOfTop {
|
||||
ProductOfTop({
|
||||
this.id,
|
||||
this.name,
|
||||
this.thumbnailImg,
|
||||
this.price,
|
||||
this.currentStock,
|
||||
this.status,
|
||||
this.category,
|
||||
this.featured,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? thumbnailImg;
|
||||
String? price;
|
||||
var currentStock;
|
||||
bool? status;
|
||||
String? category;
|
||||
bool? featured;
|
||||
|
||||
factory ProductOfTop.fromJson(Map<String, dynamic> json) => ProductOfTop(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
thumbnailImg: json["thumbnail_img"],
|
||||
price: json["price"],
|
||||
currentStock: json["current_stock"],
|
||||
status: json["status"],
|
||||
category: json["category"],
|
||||
featured: json["featured"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"thumbnail_img": thumbnailImg,
|
||||
"price": price,
|
||||
"current_stock": currentStock,
|
||||
"status": status,
|
||||
"category": category,
|
||||
"featured": featured,
|
||||
};
|
||||
}
|
||||
177
source_code/lib/data_model/uploaded_file_list_response.dart
Normal file
177
source_code/lib/data_model/uploaded_file_list_response.dart
Normal file
@@ -0,0 +1,177 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final uploadedFilesListResponse = uploadedFilesListResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
UploadedFilesListResponse uploadedFilesListResponseFromJson(String str) => UploadedFilesListResponse.fromJson(json.decode(str));
|
||||
|
||||
String uploadedFilesListResponseToJson(UploadedFilesListResponse data) => json.encode(data.toJson());
|
||||
|
||||
class UploadedFilesListResponse {
|
||||
UploadedFilesListResponse({
|
||||
this.data,
|
||||
this.links,
|
||||
this.meta,
|
||||
this.result,
|
||||
this.status,
|
||||
});
|
||||
|
||||
List<FileInfo>? data;
|
||||
Links? links;
|
||||
Meta? meta;
|
||||
bool? result;
|
||||
var status;
|
||||
|
||||
factory UploadedFilesListResponse.fromJson(Map<String, dynamic> json) => UploadedFilesListResponse(
|
||||
data: List<FileInfo>.from(json["data"].map((x) => FileInfo.fromJson(x))),
|
||||
links:json["links"]!=null ?Links.fromJson(json["links"]):null,
|
||||
meta: json["meta"]!=null ?Meta.fromJson(json["meta"]):null,
|
||||
result: json["result"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"links": links!.toJson(),
|
||||
"meta": meta!.toJson(),
|
||||
"result": result,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class FileInfo {
|
||||
FileInfo({
|
||||
this.id,
|
||||
this.fileOriginalName,
|
||||
this.fileName,
|
||||
this.url,
|
||||
this.fileSize,
|
||||
this.extension,
|
||||
this.type,
|
||||
});
|
||||
|
||||
var id;
|
||||
String? fileOriginalName;
|
||||
String? fileName;
|
||||
String? url;
|
||||
var fileSize;
|
||||
String? extension;
|
||||
String? type;
|
||||
|
||||
factory FileInfo.fromJson(Map<String, dynamic> json) => FileInfo(
|
||||
id: json["id"],
|
||||
fileOriginalName: json["file_original_name"],
|
||||
fileName: json["file_name"],
|
||||
url: json["url"],
|
||||
fileSize: json["file_size"],
|
||||
extension: json["extension"],
|
||||
type: json["type"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"file_original_name": fileOriginalName,
|
||||
"file_name": fileName,
|
||||
"url": url,
|
||||
"file_size": fileSize,
|
||||
"extension": extension,
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.first,
|
||||
this.last,
|
||||
this.prev,
|
||||
this.next,
|
||||
});
|
||||
|
||||
String? first;
|
||||
String? last;
|
||||
dynamic prev;
|
||||
dynamic next;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
first: json["first"],
|
||||
last: json["last"],
|
||||
prev: json["prev"],
|
||||
next: json["next"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"first": first,
|
||||
"last": last,
|
||||
"prev": prev,
|
||||
"next": next,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
Meta({
|
||||
this.currentPage,
|
||||
this.from,
|
||||
this.lastPage,
|
||||
this.links,
|
||||
this.path,
|
||||
this.perPage,
|
||||
this.to,
|
||||
this.total,
|
||||
});
|
||||
|
||||
var currentPage;
|
||||
var from;
|
||||
var lastPage;
|
||||
List<Link>? links;
|
||||
String? path;
|
||||
var perPage;
|
||||
var to;
|
||||
var total;
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
currentPage: json["current_page"],
|
||||
from: json["from"],
|
||||
lastPage: json["last_page"],
|
||||
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
|
||||
path: json["path"],
|
||||
perPage: json["per_page"],
|
||||
to: json["to"],
|
||||
total: json["total"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_page": currentPage,
|
||||
"from": from,
|
||||
"last_page": lastPage,
|
||||
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
|
||||
"path": path,
|
||||
"per_page": perPage,
|
||||
"to": to,
|
||||
"total": total,
|
||||
};
|
||||
}
|
||||
|
||||
class Link {
|
||||
Link({
|
||||
this.url,
|
||||
this.label,
|
||||
this.active,
|
||||
});
|
||||
|
||||
String? url;
|
||||
String? label;
|
||||
bool? active;
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) => Link(
|
||||
url: json["url"] == null ? null : json["url"],
|
||||
label: json["label"],
|
||||
active: json["active"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url == null ? null : url,
|
||||
"label": label,
|
||||
"active": active,
|
||||
};
|
||||
}
|
||||
49
source_code/lib/data_model/user_by_token.dart
Normal file
49
source_code/lib/data_model/user_by_token.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final userByTokenResponse = userByTokenResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
UserByTokenResponse userByTokenResponseFromJson(String str) => UserByTokenResponse.fromJson(json.decode(str));
|
||||
|
||||
String userByTokenResponseToJson(UserByTokenResponse data) => json.encode(data.toJson());
|
||||
|
||||
class UserByTokenResponse {
|
||||
UserByTokenResponse({
|
||||
this.result,
|
||||
this.id,
|
||||
this.name,
|
||||
this.email,
|
||||
this.avatar,
|
||||
this.avatar_original,
|
||||
this.phone,
|
||||
});
|
||||
|
||||
bool? result;
|
||||
var id;
|
||||
String? name;
|
||||
String? email;
|
||||
String? avatar;
|
||||
String? avatar_original;
|
||||
String? phone;
|
||||
|
||||
factory UserByTokenResponse.fromJson(Map<String, dynamic> json) => UserByTokenResponse(
|
||||
result: json["result"] == null ? null : json["result"],
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
name: json["name"] == null ? null : json["name"],
|
||||
email: json["email"] == null ? null : json["email"],
|
||||
avatar: json["avatar"] == null ? null : json["avatar"],
|
||||
avatar_original: json["avatar_original"] == null ? null : json["avatar_original"],
|
||||
phone: json["phone"] == null ? null : json["phone"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"result": result == null ? null : result,
|
||||
"id": id == null ? null : id,
|
||||
"name": name == null ? null : name,
|
||||
"email": email == null ? null : email,
|
||||
"avatar": avatar == null ? null : avatar,
|
||||
"avatar_original": avatar_original == null ? null : avatar_original,
|
||||
"phone": phone == null ? null : phone,
|
||||
};
|
||||
}
|
||||
30
source_code/lib/data_model/verification_form_response.dart
Normal file
30
source_code/lib/data_model/verification_form_response.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'dart:convert';
|
||||
|
||||
List<VerificationFormResponse> verificationFormResponseFromJson(String str) => List<VerificationFormResponse>.from(json.decode(str).map((x) => VerificationFormResponse.fromJson(x)));
|
||||
|
||||
String verificationFormResponseToJson(List<VerificationFormResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||
|
||||
class VerificationFormResponse {
|
||||
String? type;
|
||||
String? label;
|
||||
String? options;
|
||||
|
||||
VerificationFormResponse({
|
||||
this.type,
|
||||
this.label,
|
||||
this.options,
|
||||
});
|
||||
|
||||
factory VerificationFormResponse.fromJson(Map<String, dynamic> json) => VerificationFormResponse(
|
||||
type: json["type"],
|
||||
label: json["label"],
|
||||
options: json["options"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"type": type,
|
||||
"label": label,
|
||||
"options": options,
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,397 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final wholesaleProductDetailsResponse = wholesaleProductDetailsResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/data_model/uploaded_file_list_response.dart';
|
||||
|
||||
WholesaleProductDetailsResponse wholesaleProductDetailsResponseFromJson(String str) => WholesaleProductDetailsResponse.fromJson(json.decode(str));
|
||||
|
||||
String wholesaleProductDetailsResponseToJson(WholesaleProductDetailsResponse data) => json.encode(data.toJson());
|
||||
|
||||
class WholesaleProductDetailsResponse {
|
||||
WholesaleProductDetails? data;
|
||||
bool? result;
|
||||
var status;
|
||||
|
||||
WholesaleProductDetailsResponse({
|
||||
this.data,
|
||||
this.result,
|
||||
this.status,
|
||||
});
|
||||
|
||||
factory WholesaleProductDetailsResponse.fromJson(Map<String, dynamic> json) => WholesaleProductDetailsResponse(
|
||||
data: WholesaleProductDetails.fromJson(json["data"]),
|
||||
result: json["result"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": data!.toJson(),
|
||||
"result": result,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
|
||||
class WholesaleProductDetails {
|
||||
var id;
|
||||
dynamic lang;
|
||||
String? productName;
|
||||
String? productUnit;
|
||||
dynamic description;
|
||||
var categoryId;
|
||||
dynamic brandId;
|
||||
UploadedFilesListResponse? photos;
|
||||
UploadedFilesListResponse? thumbnailImg;
|
||||
String? videoProvider;
|
||||
dynamic videoLink;
|
||||
String? tags;
|
||||
var unitPrice;
|
||||
dynamic purchasePrice;
|
||||
var variantProduct;
|
||||
List<dynamic>? attributes;
|
||||
List<dynamic>? choiceOptions;
|
||||
List<dynamic>? colors;
|
||||
dynamic variations;
|
||||
Stocks? stocks;
|
||||
var todaysDeal;
|
||||
var published;
|
||||
var approved;
|
||||
String? stockVisibilityState;
|
||||
var cashOnDelivery;
|
||||
var featured;
|
||||
var sellerFeatured;
|
||||
var currentStock;
|
||||
var weight;
|
||||
var minQty;
|
||||
var lowStockQuantity;
|
||||
dynamic discount;
|
||||
dynamic discountType;
|
||||
DateTime? discountStartDate;
|
||||
DateTime? discountEndDate;
|
||||
List<Tax>? tax;
|
||||
dynamic taxType;
|
||||
String? shippingType;
|
||||
var shippingCost;
|
||||
var isQuantityMultiplied;
|
||||
var refundable;
|
||||
dynamic estShippingDays;
|
||||
var numOfSale;
|
||||
String? metaTitle;
|
||||
String? metaDescription;
|
||||
UploadedFilesListResponse? metaImg;
|
||||
UploadedFilesListResponse? pdf;
|
||||
String? slug;
|
||||
dynamic barcode;
|
||||
dynamic fileName;
|
||||
dynamic filePath;
|
||||
dynamic externalLink;
|
||||
String? externalLinkBtn;
|
||||
List<WholesalePrice>? wholesalePrices;
|
||||
|
||||
WholesaleProductDetails({
|
||||
this.id,
|
||||
this.lang,
|
||||
this.productName,
|
||||
this.productUnit,
|
||||
this.description,
|
||||
this.categoryId,
|
||||
this.brandId,
|
||||
this.photos,
|
||||
this.thumbnailImg,
|
||||
this.videoProvider,
|
||||
this.videoLink,
|
||||
this.tags,
|
||||
this.unitPrice,
|
||||
this.purchasePrice,
|
||||
this.variantProduct,
|
||||
this.attributes,
|
||||
this.choiceOptions,
|
||||
this.colors,
|
||||
this.variations,
|
||||
this.stocks,
|
||||
this.todaysDeal,
|
||||
this.published,
|
||||
this.approved,
|
||||
this.stockVisibilityState,
|
||||
this.cashOnDelivery,
|
||||
this.featured,
|
||||
this.sellerFeatured,
|
||||
this.currentStock,
|
||||
this.weight,
|
||||
this.minQty,
|
||||
this.lowStockQuantity,
|
||||
this.discount,
|
||||
this.discountType,
|
||||
this.discountStartDate,
|
||||
this.discountEndDate,
|
||||
this.tax,
|
||||
this.taxType,
|
||||
this.shippingType,
|
||||
this.shippingCost,
|
||||
this.isQuantityMultiplied,
|
||||
this.refundable,
|
||||
this.estShippingDays,
|
||||
this.numOfSale,
|
||||
this.metaTitle,
|
||||
this.metaDescription,
|
||||
this.metaImg,
|
||||
this.pdf,
|
||||
this.slug,
|
||||
this.barcode,
|
||||
this.fileName,
|
||||
this.filePath,
|
||||
this.externalLink,
|
||||
this.externalLinkBtn,
|
||||
this.wholesalePrices,
|
||||
});
|
||||
|
||||
factory WholesaleProductDetails.fromJson(Map<String, dynamic> json) => WholesaleProductDetails(
|
||||
id: json["id"],
|
||||
lang: json["lang"],
|
||||
productName: json["product_name"],
|
||||
productUnit: json["product_unit"],
|
||||
description: json["description"],
|
||||
categoryId: json["category_id"],
|
||||
brandId: json["brand_id"],
|
||||
photos: UploadedFilesListResponse.fromJson(json["photos"]),
|
||||
thumbnailImg: UploadedFilesListResponse.fromJson(json["thumbnail_img"]),
|
||||
videoProvider: json["video_provider"],
|
||||
videoLink: json["video_link"],
|
||||
tags: json["tags"],
|
||||
unitPrice: json["unit_price"],
|
||||
purchasePrice: json["purchase_price"],
|
||||
variantProduct: json["variant_product"],
|
||||
stocks: Stocks.fromJson(json["stocks"]),
|
||||
todaysDeal: json["todays_deal"],
|
||||
published: json["published"],
|
||||
approved: json["approved"],
|
||||
stockVisibilityState: json["stock_visibility_state"],
|
||||
cashOnDelivery: json["cash_on_delivery"],
|
||||
featured: json["featured"],
|
||||
sellerFeatured: json["seller_featured"],
|
||||
currentStock: json["current_stock"],
|
||||
weight: json["weight"],
|
||||
minQty: json["min_qty"],
|
||||
lowStockQuantity: json["low_stock_quantity"],
|
||||
discount: json["discount"],
|
||||
discountType: json["discount_type"],
|
||||
discountStartDate: DateTime.parse(json["discount_start_date"]),
|
||||
discountEndDate: DateTime.parse(json["discount_end_date"]),
|
||||
tax: List<Tax>.from(json["tax"].map((x) => Tax.fromJson(x))),
|
||||
taxType: json["tax_type"],
|
||||
shippingType: json["shipping_type"],
|
||||
shippingCost: json["shipping_cost"],
|
||||
isQuantityMultiplied: json["is_quantity_multiplied"],
|
||||
refundable: json["refundable"],
|
||||
estShippingDays: json["est_shipping_days"],
|
||||
numOfSale: json["num_of_sale"],
|
||||
metaTitle: json["meta_title"],
|
||||
metaDescription: json["meta_description"],
|
||||
metaImg: UploadedFilesListResponse.fromJson(json["meta_img"]),
|
||||
pdf: UploadedFilesListResponse.fromJson(json["pdf"]),
|
||||
slug: json["slug"],
|
||||
barcode: json["barcode"],
|
||||
fileName: json["file_name"],
|
||||
filePath: json["file_path"],
|
||||
externalLink: json["external_link"],
|
||||
externalLinkBtn: json["external_link_btn"],
|
||||
wholesalePrices: List<WholesalePrice>.from(json["wholesale_prices"].map((x) => WholesalePrice.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"lang": lang,
|
||||
"product_name": productName,
|
||||
"product_unit": productUnit,
|
||||
"description": description,
|
||||
"category_id": categoryId,
|
||||
"brand_id": brandId,
|
||||
"photos": photos!.toJson(),
|
||||
"thumbnail_img": thumbnailImg!.toJson(),
|
||||
"video_provider": videoProvider,
|
||||
"video_link": videoLink,
|
||||
"tags": tags,
|
||||
"unit_price": unitPrice,
|
||||
"purchase_price": purchasePrice,
|
||||
"variant_product": variantProduct,
|
||||
"attributes": List<dynamic>.from(attributes!.map((x) => x)),
|
||||
"choice_options": List<dynamic>.from(choiceOptions!.map((x) => x)),
|
||||
"colors": List<dynamic>.from(colors!.map((x) => x)),
|
||||
"variations": variations,
|
||||
"stocks": stocks!.toJson(),
|
||||
"todays_deal": todaysDeal,
|
||||
"published": published,
|
||||
"approved": approved,
|
||||
"stock_visibility_state": stockVisibilityState,
|
||||
"cash_on_delivery": cashOnDelivery,
|
||||
"featured": featured,
|
||||
"seller_featured": sellerFeatured,
|
||||
"current_stock": currentStock,
|
||||
"weight": weight,
|
||||
"min_qty": minQty,
|
||||
"low_stock_quantity": lowStockQuantity,
|
||||
"discount": discount,
|
||||
"discount_type": discountType,
|
||||
"discount_start_date": "${discountStartDate!.year.toString().padLeft(4, '0')}-${discountStartDate!.month.toString().padLeft(2, '0')}-${discountStartDate!.day.toString().padLeft(2, '0')}",
|
||||
"discount_end_date": "${discountEndDate!.year.toString().padLeft(4, '0')}-${discountEndDate!.month.toString().padLeft(2, '0')}-${discountEndDate!.day.toString().padLeft(2, '0')}",
|
||||
"tax": List<dynamic>.from(tax!.map((x) => x.toJson())),
|
||||
"tax_type": taxType,
|
||||
"shipping_type": shippingType,
|
||||
"shipping_cost": shippingCost,
|
||||
"is_quantity_multiplied": isQuantityMultiplied,
|
||||
"refundable": refundable,
|
||||
"est_shipping_days": estShippingDays,
|
||||
"num_of_sale": numOfSale,
|
||||
"meta_title": metaTitle,
|
||||
"meta_description": metaDescription,
|
||||
"meta_img": metaImg!.toJson(),
|
||||
"pdf": pdf!.toJson(),
|
||||
"slug": slug,
|
||||
"barcode": barcode,
|
||||
"file_name": fileName,
|
||||
"file_path": filePath,
|
||||
"external_link": externalLink,
|
||||
"external_link_btn": externalLinkBtn,
|
||||
"wholesale_prices": List<dynamic>.from(wholesalePrices!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Stocks {
|
||||
List<StocksDatum>? data;
|
||||
|
||||
Stocks({
|
||||
this.data,
|
||||
});
|
||||
|
||||
factory Stocks.fromJson(Map<String, dynamic> json) => Stocks(
|
||||
data: List<StocksDatum>.from(json["data"].map((x) => StocksDatum.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class StocksDatum {
|
||||
var id;
|
||||
var productId;
|
||||
String? variant;
|
||||
dynamic sku;
|
||||
var price;
|
||||
var qty;
|
||||
FileInfo? image;
|
||||
|
||||
StocksDatum({
|
||||
this.id,
|
||||
this.productId,
|
||||
this.variant,
|
||||
this.sku,
|
||||
this.price,
|
||||
this.qty,
|
||||
this.image,
|
||||
});
|
||||
|
||||
factory StocksDatum.fromJson(Map<String, dynamic> json) => StocksDatum(
|
||||
id: json["id"],
|
||||
productId: json["product_id"],
|
||||
variant: json["variant"],
|
||||
sku: json["sku"],
|
||||
price: json["price"],
|
||||
qty: json["qty"],
|
||||
image: FileInfo.fromJson(json["image"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"product_id": productId,
|
||||
"variant": variant,
|
||||
"sku": sku,
|
||||
"price": price,
|
||||
"qty": qty,
|
||||
"image": image!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Tax {
|
||||
var id;
|
||||
var productId;
|
||||
var taxId;
|
||||
var tax;
|
||||
String? taxType;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
Tax({
|
||||
this.id,
|
||||
this.productId,
|
||||
this.taxId,
|
||||
this.tax,
|
||||
this.taxType,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
factory Tax.fromJson(Map<String, dynamic> json) => Tax(
|
||||
id: json["id"],
|
||||
productId: json["product_id"],
|
||||
taxId: json["tax_id"],
|
||||
tax: json["tax"],
|
||||
taxType: json["tax_type"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"product_id": productId,
|
||||
"tax_id": taxId,
|
||||
"tax": tax,
|
||||
"tax_type": taxType,
|
||||
"created_at": createdAt!.toIso8601String(),
|
||||
"updated_at": updatedAt!.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
class WholesalePrice {
|
||||
var id;
|
||||
var productStockId;
|
||||
var minQty;
|
||||
var maxQty;
|
||||
var price;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
WholesalePrice({
|
||||
this.id,
|
||||
this.productStockId,
|
||||
this.minQty,
|
||||
this.maxQty,
|
||||
this.price,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
factory WholesalePrice.fromJson(Map<String, dynamic> json) => WholesalePrice(
|
||||
id: json["id"],
|
||||
productStockId: json["product_stock_id"],
|
||||
minQty: json["min_qty"],
|
||||
maxQty: json["max_qty"],
|
||||
price: json["price"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"product_stock_id": productStockId,
|
||||
"min_qty": minQty,
|
||||
"max_qty": maxQty,
|
||||
"price": price,
|
||||
"created_at": createdAt!.toIso8601String(),
|
||||
"updated_at": updatedAt!.toIso8601String(),
|
||||
};
|
||||
}
|
||||
157
source_code/lib/data_model/withdraw_list_response.dart
Normal file
157
source_code/lib/data_model/withdraw_list_response.dart
Normal file
@@ -0,0 +1,157 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final withdrawListResponse = withdrawListResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
WithdrawListResponse withdrawListResponseFromJson(String str) => WithdrawListResponse.fromJson(json.decode(str));
|
||||
|
||||
String withdrawListResponseToJson(WithdrawListResponse data) => json.encode(data.toJson());
|
||||
|
||||
class WithdrawListResponse {
|
||||
WithdrawListResponse({
|
||||
this.data,
|
||||
this.links,
|
||||
this.meta,
|
||||
});
|
||||
|
||||
List<Withdraw>? data;
|
||||
Links? links;
|
||||
Meta? meta;
|
||||
|
||||
factory WithdrawListResponse.fromJson(Map<String, dynamic> json) => WithdrawListResponse(
|
||||
data: List<Withdraw>.from(json["data"].map((x) => Withdraw.fromJson(x))),
|
||||
links: Links.fromJson(json["links"]),
|
||||
meta: Meta.fromJson(json["meta"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"links": links!.toJson(),
|
||||
"meta": meta!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Withdraw {
|
||||
Withdraw({
|
||||
this.id,
|
||||
this.amount,
|
||||
this.status,
|
||||
this.createdAt,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? amount;
|
||||
String? status;
|
||||
String? createdAt;
|
||||
|
||||
factory Withdraw.fromJson(Map<String, dynamic> json) => Withdraw(
|
||||
id: json["id"],
|
||||
amount: json["amount"],
|
||||
status: json["status"],
|
||||
createdAt: json["created_at"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"amount": amount,
|
||||
"status": status,
|
||||
"created_at": createdAt,
|
||||
};
|
||||
}
|
||||
|
||||
class Links {
|
||||
Links({
|
||||
this.first,
|
||||
this.last,
|
||||
this.prev,
|
||||
this.next,
|
||||
});
|
||||
|
||||
String? first;
|
||||
String? last;
|
||||
dynamic prev;
|
||||
dynamic next;
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) => Links(
|
||||
first: json["first"],
|
||||
last: json["last"],
|
||||
prev: json["prev"],
|
||||
next: json["next"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"first": first,
|
||||
"last": last,
|
||||
"prev": prev,
|
||||
"next": next,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
Meta({
|
||||
this.currentPage,
|
||||
this.from,
|
||||
this.lastPage,
|
||||
this.links,
|
||||
this.path,
|
||||
this.perPage,
|
||||
this.to,
|
||||
this.total,
|
||||
});
|
||||
|
||||
int? currentPage;
|
||||
int? from;
|
||||
int? lastPage;
|
||||
List<Link>? links;
|
||||
String? path;
|
||||
int? perPage;
|
||||
int? to;
|
||||
int? total;
|
||||
|
||||
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
|
||||
currentPage: json["current_page"],
|
||||
from: json["from"],
|
||||
lastPage: json["last_page"],
|
||||
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
|
||||
path: json["path"],
|
||||
perPage: json["per_page"],
|
||||
to: json["to"],
|
||||
total: json["total"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_page": currentPage,
|
||||
"from": from,
|
||||
"last_page": lastPage,
|
||||
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
|
||||
"path": path,
|
||||
"per_page": perPage,
|
||||
"to": to,
|
||||
"total": total,
|
||||
};
|
||||
}
|
||||
|
||||
class Link {
|
||||
Link({
|
||||
this.url,
|
||||
this.label,
|
||||
this.active,
|
||||
});
|
||||
|
||||
String? url;
|
||||
String? label;
|
||||
bool? active;
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) => Link(
|
||||
url: json["url"] == null ? null : json["url"],
|
||||
label: json["label"],
|
||||
active: json["active"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url == null ? null : url,
|
||||
"label": label,
|
||||
"active": active,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user