This commit is contained in:
2025-05-05 00:24:42 +05:30
parent 49c84195d1
commit ce9bb33bdd
18 changed files with 764 additions and 725 deletions

View File

@@ -1,3 +1,76 @@
// // To parse this JSON data, do
// //
// // final couponResponse = couponResponseFromJson(jsonString);
// import 'dart:convert';
// CouponResponse couponResponseFromJson(String str) => CouponResponse.fromJson(json.decode(str));
// String couponResponseToJson(CouponResponse data) => json.encode(data.toJson());
// class CouponResponse {
// bool? isValid;
// String? originalPrice;
// int? discountAmount;
// int? finalPrice;
// String? message;
// CouponDetails? couponDetails;
// CouponResponse({
// this.isValid,
// this.originalPrice,
// this.discountAmount,
// this.finalPrice,
// this.message,
// this.couponDetails,
// });
// factory CouponResponse.fromJson(Map<String, dynamic> json) => CouponResponse(
// isValid: json["isValid"],
// originalPrice: json["originalPrice"],
// discountAmount: json["discountAmount"],
// finalPrice: json["finalPrice"],
// message: json["message"],
// couponDetails: CouponDetails.fromJson(json["couponDetails"]),
// );
// Map<String, dynamic> toJson() => {
// "isValid": isValid,
// "originalPrice": originalPrice,
// "discountAmount": discountAmount,
// "finalPrice": finalPrice,
// "message": message,
// "couponDetails": couponDetails!.toJson(),
// };
// }
// class CouponDetails {
// String? code;
// String? type;
// String? discountValue;
// CouponDetails({
// this.code,
// this.type,
// this.discountValue,
// });
// factory CouponDetails.fromJson(Map<String, dynamic> json) => CouponDetails(
// code: json["code"],
// type: json["type"],
// discountValue: json["discountValue"],
// );
// Map<String, dynamic> toJson() => {
// "code": code,
// "type": type,
// "discountValue": discountValue,
// };
// }
// To parse this JSON data, do
//
// final couponResponse = couponResponseFromJson(jsonString);
@@ -10,7 +83,8 @@ String couponResponseToJson(CouponResponse data) => json.encode(data.toJson());
class CouponResponse {
bool? isValid;
String? originalPrice;
int? originalPrice;
int? eligibleSubtotal;
int? discountAmount;
int? finalPrice;
String? message;
@@ -19,6 +93,7 @@ class CouponResponse {
CouponResponse({
this.isValid,
this.originalPrice,
this.eligibleSubtotal,
this.discountAmount,
this.finalPrice,
this.message,
@@ -28,6 +103,7 @@ class CouponResponse {
factory CouponResponse.fromJson(Map<String, dynamic> json) => CouponResponse(
isValid: json["isValid"],
originalPrice: json["originalPrice"],
eligibleSubtotal: json["eligibleSubtotal"],
discountAmount: json["discountAmount"],
finalPrice: json["finalPrice"],
message: json["message"],
@@ -37,6 +113,7 @@ class CouponResponse {
Map<String, dynamic> toJson() => {
"isValid": isValid,
"originalPrice": originalPrice,
"eligibleSubtotal": eligibleSubtotal,
"discountAmount": discountAmount,
"finalPrice": finalPrice,
"message": message,
@@ -46,8 +123,8 @@ class CouponResponse {
class CouponDetails {
String? code;
String? type;
String? discountValue;
String ?type;
String ?discountValue;
CouponDetails({
this.code,
@@ -67,3 +144,4 @@ class CouponDetails {
"discountValue": discountValue,
};
}