updateProfile
This commit is contained in:
182
lib/src/data/address.dart
Normal file
182
lib/src/data/address.dart
Normal file
@@ -0,0 +1,182 @@
|
||||
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
AddressResponse addressResponseFromJson(dynamic str) =>
|
||||
AddressResponse.fromJson(json.decode(str));
|
||||
|
||||
dynamic addressResponseToJson(AddressResponse data) =>
|
||||
json.encode(data.toJson());
|
||||
|
||||
class AddressResponse {
|
||||
List<Datum>? data;
|
||||
Meta? meta;
|
||||
|
||||
AddressResponse({
|
||||
this.data,
|
||||
this.meta,
|
||||
});
|
||||
|
||||
factory AddressResponse.fromJson(Map<dynamic, dynamic> json) =>
|
||||
AddressResponse(
|
||||
data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
|
||||
meta: Meta.fromJson(json["meta"]),
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"meta": meta!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Datum {
|
||||
dynamic id;
|
||||
dynamic pincode;
|
||||
dynamic phoneNumber;
|
||||
dynamic alternatePhoneNumber;
|
||||
dynamic addressLine;
|
||||
dynamic landmark;
|
||||
dynamic addressType;
|
||||
dynamic city;
|
||||
dynamic district;
|
||||
dynamic name;
|
||||
dynamic state;
|
||||
dynamic country;
|
||||
bool? isDeliverable;
|
||||
bool? isDefault;
|
||||
dynamic additionalInstructions;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
dynamic userId;
|
||||
User? user;
|
||||
|
||||
Datum({
|
||||
this.id,
|
||||
this.pincode,
|
||||
this.phoneNumber,
|
||||
this.alternatePhoneNumber,
|
||||
this.addressLine,
|
||||
this.landmark,
|
||||
this.addressType,
|
||||
this.city,
|
||||
this.district,
|
||||
this.name,
|
||||
this.state,
|
||||
this.country,
|
||||
this.isDeliverable,
|
||||
this.isDefault,
|
||||
this.additionalInstructions,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.userId,
|
||||
this.user,
|
||||
});
|
||||
|
||||
factory Datum.fromJson(Map<dynamic, dynamic> json) => Datum(
|
||||
id: json["id"],
|
||||
pincode: json["pincode"],
|
||||
phoneNumber: json["phoneNumber"],
|
||||
alternatePhoneNumber: json["alternatePhoneNumber"],
|
||||
addressLine: json["addressLine"],
|
||||
landmark: json["landmark"],
|
||||
addressType: json["addressType"],
|
||||
city: json["city"],
|
||||
district: json["district"],
|
||||
name: json["name"],
|
||||
state: json["state"],
|
||||
country: json["country"],
|
||||
isDeliverable: json["isDeliverable"],
|
||||
isDefault: json["isDefault"],
|
||||
additionalInstructions: json["additionalInstructions"],
|
||||
createdAt: DateTime.parse(json["createdAt"]),
|
||||
updatedAt: DateTime.parse(json["updatedAt"]),
|
||||
userId: json["userId"],
|
||||
user: User.fromJson(json["user"]),
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"pincode": pincode,
|
||||
"phoneNumber": phoneNumber,
|
||||
"alternatePhoneNumber": alternatePhoneNumber,
|
||||
"addressLine": addressLine,
|
||||
"landmark": landmark,
|
||||
"addressType": addressType,
|
||||
"city": city,
|
||||
"district": district,
|
||||
"name": name,
|
||||
"state": state,
|
||||
"country": country,
|
||||
"isDeliverable": isDeliverable,
|
||||
"isDefault": isDefault,
|
||||
"additionalInstructions": additionalInstructions,
|
||||
"createdAt": createdAt,
|
||||
"updatedAt": updatedAt,
|
||||
"userId": userId,
|
||||
"user": user!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class User {
|
||||
dynamic firstName;
|
||||
dynamic lastName;
|
||||
dynamic email;
|
||||
dynamic phone;
|
||||
|
||||
User({
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.email,
|
||||
this.phone,
|
||||
});
|
||||
|
||||
factory User.fromJson(Map<dynamic, dynamic> json) => User(
|
||||
firstName: json["firstName"],
|
||||
lastName: json["lastName"],
|
||||
email: json["email"],
|
||||
phone: json["phone"],
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"firstName": firstName,
|
||||
"lastName": lastName,
|
||||
"email": email,
|
||||
"phone": phone,
|
||||
};
|
||||
}
|
||||
|
||||
class Meta {
|
||||
int? total;
|
||||
int? page;
|
||||
int? limit;
|
||||
int? lastPage;
|
||||
bool? hasNextPage;
|
||||
bool? hasPreviousPage;
|
||||
|
||||
Meta({
|
||||
this.total,
|
||||
this.page,
|
||||
this.limit,
|
||||
this.lastPage,
|
||||
this.hasNextPage,
|
||||
this.hasPreviousPage,
|
||||
});
|
||||
|
||||
factory Meta.fromJson(Map<dynamic, dynamic> json) => Meta(
|
||||
total: json["total"],
|
||||
page: json["page"],
|
||||
limit: json["limit"],
|
||||
lastPage: json["lastPage"],
|
||||
hasNextPage: json["hasNextPage"],
|
||||
hasPreviousPage: json["hasPreviousPage"],
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"total": total,
|
||||
"page": page,
|
||||
"limit": limit,
|
||||
"lastPage": lastPage,
|
||||
"hasNextPage": hasNextPage,
|
||||
"hasPreviousPage": hasPreviousPage,
|
||||
};
|
||||
}
|
||||
53
lib/src/data/upload_image.dart
Normal file
53
lib/src/data/upload_image.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final uploadImage = uploadImageFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
UploadImage uploadImageFromJson(String str) => UploadImage.fromJson(json.decode(str));
|
||||
|
||||
String uploadImageToJson(UploadImage data) => json.encode(data.toJson());
|
||||
|
||||
class UploadImage {
|
||||
int? status;
|
||||
String? message;
|
||||
Image? data;
|
||||
|
||||
UploadImage({
|
||||
this.status,
|
||||
this.message,
|
||||
this.data,
|
||||
});
|
||||
|
||||
factory UploadImage.fromJson(Map<String, dynamic> json) => UploadImage(
|
||||
status: json["status"],
|
||||
message: json["message"],
|
||||
data: Image.fromJson(json["data"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"status": status,
|
||||
"message": message,
|
||||
"data": data!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Image {
|
||||
String? url;
|
||||
String? publicId;
|
||||
|
||||
Image({
|
||||
this.url,
|
||||
this.publicId,
|
||||
});
|
||||
|
||||
factory Image.fromJson(Map<String, dynamic> json) => Image(
|
||||
url: json["url"],
|
||||
publicId: json["publicId"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"url": url,
|
||||
"publicId": publicId,
|
||||
};
|
||||
}
|
||||
110
lib/src/data/user_profile.dart
Normal file
110
lib/src/data/user_profile.dart
Normal file
@@ -0,0 +1,110 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final userProfile = userProfileFromJson(jsondynamic);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
UserProfile userProfileFromJson(dynamic str) =>
|
||||
UserProfile.fromJson(json.decode(str));
|
||||
|
||||
dynamic userProfileToJson(UserProfile data) => json.encode(data.toJson());
|
||||
|
||||
class UserProfile {
|
||||
dynamic id;
|
||||
dynamic email;
|
||||
dynamic firstName;
|
||||
dynamic lastName;
|
||||
dynamic name;
|
||||
dynamic img;
|
||||
dynamic authType;
|
||||
dynamic role;
|
||||
dynamic phone;
|
||||
dynamic password;
|
||||
bool? isActive;
|
||||
bool? isPhoneVerified;
|
||||
dynamic vendorType;
|
||||
dynamic businessId;
|
||||
bool? isVendorAccountCreated;
|
||||
bool? isVendorAccountActive;
|
||||
bool? vendorTermsAccepted;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
dynamic rtHash;
|
||||
dynamic resetToken;
|
||||
dynamic resetTokenExpiresAt;
|
||||
|
||||
UserProfile({
|
||||
this.id,
|
||||
this.email,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.name,
|
||||
this.img,
|
||||
this.authType,
|
||||
this.role,
|
||||
this.phone,
|
||||
this.password,
|
||||
this.isActive,
|
||||
this.isPhoneVerified,
|
||||
this.vendorType,
|
||||
this.businessId,
|
||||
this.isVendorAccountCreated,
|
||||
this.isVendorAccountActive,
|
||||
this.vendorTermsAccepted,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.rtHash,
|
||||
this.resetToken,
|
||||
this.resetTokenExpiresAt,
|
||||
});
|
||||
|
||||
factory UserProfile.fromJson(Map<dynamic, dynamic> json) => UserProfile(
|
||||
id: json["id"],
|
||||
email: json["email"],
|
||||
firstName: json["firstName"],
|
||||
lastName: json["lastName"],
|
||||
name: json["name"],
|
||||
img: json["img"],
|
||||
authType: json["authType"],
|
||||
role: json["role"],
|
||||
phone: json["phone"],
|
||||
password: json["password"],
|
||||
isActive: json["isActive"],
|
||||
isPhoneVerified: json["isPhoneVerified"],
|
||||
vendorType: json["vendorType"],
|
||||
businessId: json["businessId"],
|
||||
isVendorAccountCreated: json["isVendorAccountCreated"],
|
||||
isVendorAccountActive: json["isVendorAccountActive"],
|
||||
vendorTermsAccepted: json["vendorTermsAccepted"],
|
||||
createdAt: DateTime?.parse(json["createdAt"]),
|
||||
updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
rtHash: json["rtHash"],
|
||||
resetToken: json["resetToken"],
|
||||
resetTokenExpiresAt: json["resetTokenExpiresAt"],
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"email": email,
|
||||
"firstName": firstName,
|
||||
"lastName": lastName,
|
||||
"name": name,
|
||||
"img": img,
|
||||
"authType": authType,
|
||||
"role": role,
|
||||
"phone": phone,
|
||||
"password": password,
|
||||
"isActive": isActive,
|
||||
"isPhoneVerified": isPhoneVerified,
|
||||
"vendorType": vendorType,
|
||||
"businessId": businessId,
|
||||
"isVendorAccountCreated": isVendorAccountCreated,
|
||||
"isVendorAccountActive": isVendorAccountActive,
|
||||
"vendorTermsAccepted": vendorTermsAccepted,
|
||||
"createdAt": createdAt,
|
||||
"updatedAt": updatedAt,
|
||||
"rtHash": rtHash,
|
||||
"resetToken": resetToken,
|
||||
"resetTokenExpiresAt": resetTokenExpiresAt,
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,256 @@
|
||||
// // To parse this JSON data, do
|
||||
// //
|
||||
// // final wishListModel = wishListModelFromJson(jsondynamic);
|
||||
|
||||
// import 'dart:convert';
|
||||
|
||||
// WishListModel wishListModelFromJson(dynamic str) => WishListModel.fromJson(json.decode(str));
|
||||
|
||||
// dynamic wishListModelToJson(WishListModel data) => json.encode(data.toJson());
|
||||
|
||||
// class WishListModel {
|
||||
// dynamic id;
|
||||
// dynamic userId;
|
||||
// DateTime?? createdAt;
|
||||
// DateTime?? updatedAt;
|
||||
// List<WishListItem>? items;
|
||||
// dynamic? totalItems;
|
||||
|
||||
// WishListModel({
|
||||
// this.id,
|
||||
// this.userId,
|
||||
// this.createdAt,
|
||||
// this.updatedAt,
|
||||
// this.items,
|
||||
// this.totalItems,
|
||||
// });
|
||||
|
||||
// factory WishListModel.fromJson(Map<dynamic, dynamic> json) => WishListModel(
|
||||
// id: json["id"],
|
||||
// userId: json["userId"],
|
||||
// createdAt: DateTime?.parse(json["createdAt"]),
|
||||
// updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
// items: List<WishListItem>.from(json["items"].map((x) => WishListItem.fromJson(x))),
|
||||
// totalItems: json["totalItems"],
|
||||
// );
|
||||
|
||||
// Map<dynamic, dynamic> toJson() => {
|
||||
// "id": id,
|
||||
// "userId": userId,
|
||||
// "createdAt": createdAt,
|
||||
// "updatedAt": updatedAt,
|
||||
// "items": List<dynamic>.from(items!.map((x) => x.toJson())),
|
||||
// "totalItems": totalItems,
|
||||
// };
|
||||
// }
|
||||
|
||||
// class WishListItem {
|
||||
// dynamic id;
|
||||
// dynamic wishlistId;
|
||||
// dynamic productId;
|
||||
// dynamic storeId;
|
||||
// DateTime?? createdAt;
|
||||
// DateTime?? updatedAt;
|
||||
// ProductDatum? product;
|
||||
// Store? store;
|
||||
|
||||
// WishListItem({
|
||||
// this.id,
|
||||
// this.wishlistId,
|
||||
// this.productId,
|
||||
// this.storeId,
|
||||
// this.createdAt,
|
||||
// this.updatedAt,
|
||||
// this.product,
|
||||
// this.store,
|
||||
// });
|
||||
|
||||
// factory WishListItem.fromJson(Map<dynamic, dynamic> json) => WishListItem(
|
||||
// id: json["id"],
|
||||
// wishlistId: json["wishlistId"],
|
||||
// productId: json["productId"],
|
||||
// storeId: json["storeId"],
|
||||
// createdAt: DateTime?.parse(json["createdAt"]),
|
||||
// updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
// product: ProductDatum.fromJson(json["product"]),
|
||||
// store: Store.fromJson(json["store"]),
|
||||
// );
|
||||
|
||||
// Map<dynamic, dynamic> toJson() => {
|
||||
// "id": id,
|
||||
// "wishlistId": wishlistId,
|
||||
// "productId": productId,
|
||||
// "storeId": storeId,
|
||||
// "createdAt": createdAt,
|
||||
// "updatedAt": updatedAt,
|
||||
// "product": product!.toJson(),
|
||||
// "store": store!.toJson(),
|
||||
// };
|
||||
// }
|
||||
|
||||
// class ProductDatum {
|
||||
// dynamic id;
|
||||
// dynamic name;
|
||||
// dynamic description;
|
||||
// dynamic additionalInfo;
|
||||
// dynamic brand;
|
||||
// dynamic basePrice;
|
||||
// dynamic discountPrice;
|
||||
// dynamic stock;
|
||||
// dynamic quantity;
|
||||
// dynamic unit;
|
||||
// dynamic slug;
|
||||
// dynamic rating;
|
||||
// bool? isInStock;
|
||||
// bool? isActive;
|
||||
// bool? isInWishlist;
|
||||
// DateTime?? createdAt;
|
||||
// DateTime?? updatedAt;
|
||||
// dynamic storeId;
|
||||
// dynamic categoryId;
|
||||
// dynamic productTypeId;
|
||||
// dynamic timeSlotId;
|
||||
|
||||
// ProductDatum({
|
||||
// this.id,
|
||||
// this.name,
|
||||
// this.description,
|
||||
// this.additionalInfo,
|
||||
// this.brand,
|
||||
// this.basePrice,
|
||||
// this.discountPrice,
|
||||
// this.stock,
|
||||
// this.quantity,
|
||||
// this.unit,
|
||||
// this.slug,
|
||||
// this.rating,
|
||||
// this.isInStock,
|
||||
// this.isActive,
|
||||
// this.isInWishlist,
|
||||
// this.createdAt,
|
||||
// this.updatedAt,
|
||||
// this.storeId,
|
||||
// this.categoryId,
|
||||
// this.productTypeId,
|
||||
// this.timeSlotId,
|
||||
// });
|
||||
|
||||
// factory ProductDatum.fromJson(Map<dynamic, dynamic> json) => ProductDatum(
|
||||
// id: json["id"],
|
||||
// name: json["name"],
|
||||
// description: json["description"],
|
||||
// additionalInfo: json["additionalInfo"],
|
||||
// brand: json["brand"],
|
||||
// basePrice: json["basePrice"],
|
||||
// discountPrice: json["discountPrice"],
|
||||
// stock: json["stock"],
|
||||
// quantity: json["quantity"],
|
||||
// unit: json["unit"],
|
||||
// slug: json["slug"],
|
||||
// rating: json["rating"],
|
||||
// isInStock: json["isInStock"],
|
||||
// isActive: json["isActive"],
|
||||
// isInWishlist: json["isInWishlist"],
|
||||
// createdAt: DateTime?.parse(json["createdAt"]),
|
||||
// updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
// storeId: json["storeId"],
|
||||
// categoryId: json["categoryId"],
|
||||
// productTypeId: json["productTypeId"],
|
||||
// timeSlotId: json["timeSlotId"],
|
||||
// );
|
||||
|
||||
// Map<dynamic, dynamic> toJson() => {
|
||||
// "id": id,
|
||||
// "name": name,
|
||||
// "description": description,
|
||||
// "additionalInfo": additionalInfo,
|
||||
// "brand": brand,
|
||||
// "basePrice": basePrice,
|
||||
// "discountPrice": discountPrice,
|
||||
// "stock": stock,
|
||||
// "quantity": quantity,
|
||||
// "unit": unit,
|
||||
// "slug": slug,
|
||||
// "rating": rating,
|
||||
// "isInStock": isInStock,
|
||||
// "isActive": isActive,
|
||||
// "isInWishlist": isInWishlist,
|
||||
// "createdAt": createdAt,
|
||||
// "updatedAt": updatedAt,
|
||||
// "storeId": storeId,
|
||||
// "categoryId": categoryId,
|
||||
// "productTypeId": productTypeId,
|
||||
// "timeSlotId": timeSlotId,
|
||||
// };
|
||||
|
||||
// void add(ProductDatum productDatum) {}
|
||||
// }
|
||||
|
||||
// class Store {
|
||||
// dynamic id;
|
||||
// dynamic storeName;
|
||||
// dynamic storeDescription;
|
||||
// dynamic officialPhoneNumber;
|
||||
// dynamic storeAddress;
|
||||
// dynamic gstNumber;
|
||||
// dynamic gumastaNumber;
|
||||
// dynamic storePicture;
|
||||
// DateTime?? createdAt;
|
||||
// DateTime?? updatedAt;
|
||||
// dynamic vendorId;
|
||||
// bool? isActive;
|
||||
// dynamic couponId;
|
||||
|
||||
// Store({
|
||||
// this.id,
|
||||
// this.storeName,
|
||||
// this.storeDescription,
|
||||
// this.officialPhoneNumber,
|
||||
// this.storeAddress,
|
||||
// this.gstNumber,
|
||||
// this.gumastaNumber,
|
||||
// this.storePicture,
|
||||
// this.createdAt,
|
||||
// this.updatedAt,
|
||||
// this.vendorId,
|
||||
// this.isActive,
|
||||
// this.couponId,
|
||||
// });
|
||||
|
||||
// factory Store.fromJson(Map<dynamic, dynamic> json) => Store(
|
||||
// id: json["id"],
|
||||
// storeName: json["storeName"],
|
||||
// storeDescription: json["storeDescription"],
|
||||
// officialPhoneNumber: json["officialPhoneNumber"],
|
||||
// storeAddress: json["storeAddress"],
|
||||
// gstNumber: json["gstNumber"],
|
||||
// gumastaNumber: json["gumastaNumber"],
|
||||
// storePicture: json["storePicture"],
|
||||
// createdAt: DateTime?.parse(json["createdAt"]),
|
||||
// updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
// vendorId: json["vendorId"],
|
||||
// isActive: json["isActive"],
|
||||
// couponId: json["couponId"],
|
||||
// );
|
||||
|
||||
// Map<dynamic, dynamic> toJson() => {
|
||||
// "id": id,
|
||||
// "storeName": storeName,
|
||||
// "storeDescription": storeDescription,
|
||||
// "officialPhoneNumber": officialPhoneNumber,
|
||||
// "storeAddress": storeAddress,
|
||||
// "gstNumber": gstNumber,
|
||||
// "gumastaNumber": gumastaNumber,
|
||||
// "storePicture": storePicture,
|
||||
// "createdAt": createdAt,
|
||||
// "updatedAt": updatedAt,
|
||||
// "vendorId": vendorId,
|
||||
// "isActive": isActive,
|
||||
// "couponId": couponId,
|
||||
// };
|
||||
// }
|
||||
|
||||
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final wishListModel = wishListModelFromJson(jsondynamic);
|
||||
@@ -14,7 +267,7 @@ class WishListModel {
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
List<WishListItem>? items;
|
||||
dynamic? totalItems;
|
||||
dynamic totalItems;
|
||||
|
||||
WishListModel({
|
||||
this.id,
|
||||
@@ -28,8 +281,8 @@ class WishListModel {
|
||||
factory WishListModel.fromJson(Map<dynamic, dynamic> json) => WishListModel(
|
||||
id: json["id"],
|
||||
userId: json["userId"],
|
||||
createdAt: DateTime.parse(json["createdAt"]),
|
||||
updatedAt: DateTime.parse(json["updatedAt"]),
|
||||
createdAt: DateTime?.parse(json["createdAt"]),
|
||||
updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
items: List<WishListItem>.from(json["items"].map((x) => WishListItem.fromJson(x))),
|
||||
totalItems: json["totalItems"],
|
||||
);
|
||||
@@ -70,8 +323,8 @@ class WishListItem {
|
||||
wishlistId: json["wishlistId"],
|
||||
productId: json["productId"],
|
||||
storeId: json["storeId"],
|
||||
createdAt: DateTime.parse(json["createdAt"]),
|
||||
updatedAt: DateTime.parse(json["updatedAt"]),
|
||||
createdAt: DateTime?.parse(json["createdAt"]),
|
||||
updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
product: ProductDatum.fromJson(json["product"]),
|
||||
store: Store.fromJson(json["store"]),
|
||||
);
|
||||
@@ -96,20 +349,24 @@ class ProductDatum {
|
||||
dynamic brand;
|
||||
dynamic basePrice;
|
||||
dynamic discountPrice;
|
||||
dynamic stock;
|
||||
dynamic quantity;
|
||||
dynamic? stock;
|
||||
dynamic? quantity;
|
||||
dynamic unit;
|
||||
dynamic slug;
|
||||
dynamic rating;
|
||||
dynamic averageRating;
|
||||
bool? isInStock;
|
||||
bool? isActive;
|
||||
bool? isInWishlist;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
dynamic storeId;
|
||||
dynamic categoryId;
|
||||
dynamic productTypeId;
|
||||
dynamic timeSlotId;
|
||||
List<ProductImage>? productImages;
|
||||
Category? category;
|
||||
List<ProductTag>? productTags;
|
||||
List<dynamic>? zones;
|
||||
List<ProductReview>? productReview;
|
||||
|
||||
ProductDatum({
|
||||
this.id,
|
||||
@@ -123,16 +380,20 @@ class ProductDatum {
|
||||
this.quantity,
|
||||
this.unit,
|
||||
this.slug,
|
||||
this.rating,
|
||||
this.averageRating,
|
||||
this.isInStock,
|
||||
this.isActive,
|
||||
this.isInWishlist,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.storeId,
|
||||
this.categoryId,
|
||||
this.productTypeId,
|
||||
this.timeSlotId,
|
||||
this.productImages,
|
||||
this.category,
|
||||
this.productTags,
|
||||
this.zones,
|
||||
this.productReview,
|
||||
});
|
||||
|
||||
factory ProductDatum.fromJson(Map<dynamic, dynamic> json) => ProductDatum(
|
||||
@@ -147,16 +408,20 @@ class ProductDatum {
|
||||
quantity: json["quantity"],
|
||||
unit: json["unit"],
|
||||
slug: json["slug"],
|
||||
rating: json["rating"],
|
||||
averageRating: json["averageRating"],
|
||||
isInStock: json["isInStock"],
|
||||
isActive: json["isActive"],
|
||||
isInWishlist: json["isInWishlist"],
|
||||
createdAt: DateTime.parse(json["createdAt"]),
|
||||
updatedAt: DateTime.parse(json["updatedAt"]),
|
||||
createdAt: DateTime?.parse(json["createdAt"]),
|
||||
updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
storeId: json["storeId"],
|
||||
categoryId: json["categoryId"],
|
||||
productTypeId: json["productTypeId"],
|
||||
timeSlotId: json["timeSlotId"],
|
||||
productImages: List<ProductImage>.from(json["productImages"].map((x) => ProductImage.fromJson(x))),
|
||||
category: Category.fromJson(json["category"]),
|
||||
productTags: List<ProductTag>.from(json["productTags"].map((x) => ProductTag.fromJson(x))),
|
||||
zones: List<dynamic>.from(json["zones"].map((x) => x)),
|
||||
productReview: List<ProductReview>.from(json["ProductReview"].map((x) => ProductReview.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
@@ -171,16 +436,204 @@ class ProductDatum {
|
||||
"quantity": quantity,
|
||||
"unit": unit,
|
||||
"slug": slug,
|
||||
"rating": rating,
|
||||
"averageRating": averageRating,
|
||||
"isInStock": isInStock,
|
||||
"isActive": isActive,
|
||||
"isInWishlist": isInWishlist,
|
||||
"createdAt": createdAt,
|
||||
"updatedAt": updatedAt,
|
||||
"storeId": storeId,
|
||||
"categoryId": categoryId,
|
||||
"productTypeId": productTypeId,
|
||||
"timeSlotId": timeSlotId,
|
||||
"productImages": List<dynamic>.from(productImages!.map((x) => x.toJson())),
|
||||
"category": category!.toJson(),
|
||||
"productTags": List<dynamic>.from(productTags!.map((x) => x.toJson())),
|
||||
"zones": List<dynamic>.from(zones!.map((x) => x)),
|
||||
"ProductReview": List<dynamic>.from(productReview!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Category {
|
||||
dynamic id;
|
||||
dynamic name;
|
||||
dynamic description;
|
||||
dynamic image;
|
||||
dynamic slug;
|
||||
dynamic? level;
|
||||
bool? isActive;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
dynamic parentCategoryId;
|
||||
dynamic path;
|
||||
|
||||
Category({
|
||||
this.id,
|
||||
this.name,
|
||||
this.description,
|
||||
this.image,
|
||||
this.slug,
|
||||
this.level,
|
||||
this.isActive,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.parentCategoryId,
|
||||
this.path,
|
||||
});
|
||||
|
||||
factory Category.fromJson(Map<dynamic, dynamic> json) => Category(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
description: json["description"],
|
||||
image: json["image"],
|
||||
slug: json["slug"],
|
||||
level: json["level"],
|
||||
isActive: json["isActive"],
|
||||
createdAt: DateTime?.parse(json["createdAt"]),
|
||||
updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
parentCategoryId: json["parentCategoryId"],
|
||||
path: json["path"],
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"description": description,
|
||||
"image": image,
|
||||
"slug": slug,
|
||||
"level": level,
|
||||
"isActive": isActive,
|
||||
"createdAt": createdAt,
|
||||
"updatedAt": updatedAt,
|
||||
"parentCategoryId": parentCategoryId,
|
||||
"path": path,
|
||||
};
|
||||
}
|
||||
|
||||
class ProductImage {
|
||||
dynamic id;
|
||||
dynamic url;
|
||||
bool? isDefault;
|
||||
dynamic productId;
|
||||
|
||||
ProductImage({
|
||||
this.id,
|
||||
this.url,
|
||||
this.isDefault,
|
||||
this.productId,
|
||||
});
|
||||
|
||||
factory ProductImage.fromJson(Map<dynamic, dynamic> json) => ProductImage(
|
||||
id: json["id"],
|
||||
url: json["url"],
|
||||
isDefault: json["isDefault"],
|
||||
productId: json["productId"],
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"url": url,
|
||||
"isDefault": isDefault,
|
||||
"productId": productId,
|
||||
};
|
||||
}
|
||||
|
||||
class ProductReview {
|
||||
dynamic id;
|
||||
dynamic userId;
|
||||
dynamic productId;
|
||||
dynamic rating;
|
||||
dynamic title;
|
||||
dynamic description;
|
||||
dynamic? likes;
|
||||
dynamic? dislikes;
|
||||
dynamic? helpfulCount;
|
||||
bool? verifiedPurchase;
|
||||
dynamic status;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
ProductReview({
|
||||
this.id,
|
||||
this.userId,
|
||||
this.productId,
|
||||
this.rating,
|
||||
this.title,
|
||||
this.description,
|
||||
this.likes,
|
||||
this.dislikes,
|
||||
this.helpfulCount,
|
||||
this.verifiedPurchase,
|
||||
this.status,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
factory ProductReview.fromJson(Map<dynamic, dynamic> json) => ProductReview(
|
||||
id: json["id"],
|
||||
userId: json["userId"],
|
||||
productId: json["productId"],
|
||||
rating: json["rating"],
|
||||
title: json["title"],
|
||||
description: json["description"],
|
||||
likes: json["likes"],
|
||||
dislikes: json["dislikes"],
|
||||
helpfulCount: json["helpfulCount"],
|
||||
verifiedPurchase: json["verifiedPurchase"],
|
||||
status: json["status"],
|
||||
createdAt: DateTime?.parse(json["createdAt"]),
|
||||
updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"userId": userId,
|
||||
"productId": productId,
|
||||
"rating": rating,
|
||||
"title": title,
|
||||
"description": description,
|
||||
"likes": likes,
|
||||
"dislikes": dislikes,
|
||||
"helpfulCount": helpfulCount,
|
||||
"verifiedPurchase": verifiedPurchase,
|
||||
"status": status,
|
||||
"createdAt": createdAt,
|
||||
"updatedAt": updatedAt,
|
||||
};
|
||||
}
|
||||
|
||||
class ProductTag {
|
||||
dynamic id;
|
||||
dynamic name;
|
||||
dynamic description;
|
||||
bool? isActive;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
ProductTag({
|
||||
this.id,
|
||||
this.name,
|
||||
this.description,
|
||||
this.isActive,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
factory ProductTag.fromJson(Map<dynamic, dynamic> json) => ProductTag(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
description: json["description"],
|
||||
isActive: json["isActive"],
|
||||
createdAt: DateTime?.parse(json["createdAt"]),
|
||||
updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"description": description,
|
||||
"isActive": isActive,
|
||||
"createdAt": createdAt,
|
||||
"updatedAt": updatedAt,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -224,8 +677,8 @@ class Store {
|
||||
gstNumber: json["gstNumber"],
|
||||
gumastaNumber: json["gumastaNumber"],
|
||||
storePicture: json["storePicture"],
|
||||
createdAt: DateTime.parse(json["createdAt"]),
|
||||
updatedAt: DateTime.parse(json["updatedAt"]),
|
||||
createdAt: DateTime?.parse(json["createdAt"]),
|
||||
updatedAt: DateTime?.parse(json["updatedAt"]),
|
||||
vendorId: json["vendorId"],
|
||||
isActive: json["isActive"],
|
||||
couponId: json["couponId"],
|
||||
|
||||
Reference in New Issue
Block a user