final after change app

This commit is contained in:
2025-05-10 13:09:19 +05:30
parent bf7a7a96bd
commit e10f6747c9
21 changed files with 891 additions and 880 deletions

View File

@@ -68,8 +68,9 @@
// };
// }
// To parse this JSON data, do
//
// final couponResponse = couponResponseFromJson(jsonString);
// To parse this JSON data, do
//
@@ -77,40 +78,41 @@
import 'dart:convert';
CouponResponse couponResponseFromJson(String str) => CouponResponse.fromJson(json.decode(str));
CouponResponse couponResponseFromJson(String str) =>
CouponResponse.fromJson(json.decode(str));
String couponResponseToJson(CouponResponse data) => json.encode(data.toJson());
class CouponResponse {
bool? isValid;
int? originalPrice;
int? eligibleSubtotal;
int? discountAmount;
int? finalPrice;
String? message;
CouponDetails? couponDetails;
bool? isValid;
double? originalPrice;
double? eligibleSubtotal;
dynamic? discountAmount;
double? finalPrice;
String? message;
CouponDetails? couponDetails;
CouponResponse({
this.isValid,
this.originalPrice,
this.eligibleSubtotal,
this.discountAmount,
this.finalPrice,
this.message,
this.couponDetails,
});
CouponResponse({
this.isValid,
this.originalPrice,
this.eligibleSubtotal,
this.discountAmount,
this.finalPrice,
this.message,
this.couponDetails,
});
factory CouponResponse.fromJson(Map<String, dynamic> json) => CouponResponse(
factory CouponResponse.fromJson(Map<String, dynamic> json) => CouponResponse(
isValid: json["isValid"],
originalPrice: json["originalPrice"],
eligibleSubtotal: json["eligibleSubtotal"],
originalPrice: json["originalPrice"].toDouble(),
eligibleSubtotal: json["eligibleSubtotal"].toDouble(),
discountAmount: json["discountAmount"],
finalPrice: json["finalPrice"],
finalPrice: json["finalPrice"].toDouble(),
message: json["message"],
couponDetails: CouponDetails.fromJson(json["couponDetails"]),
);
);
Map<String, dynamic> toJson() => {
Map<String, dynamic> toJson() => {
"isValid": isValid,
"originalPrice": originalPrice,
"eligibleSubtotal": eligibleSubtotal,
@@ -118,30 +120,29 @@ class CouponResponse {
"finalPrice": finalPrice,
"message": message,
"couponDetails": couponDetails!.toJson(),
};
};
}
class CouponDetails {
String? code;
String ?type;
String ?discountValue;
String? code;
String? type;
String? discountValue;
CouponDetails({
this.code,
this.type,
this.discountValue,
});
CouponDetails({
this.code,
this.type,
this.discountValue,
});
factory CouponDetails.fromJson(Map<String, dynamic> json) => CouponDetails(
factory CouponDetails.fromJson(Map<String, dynamic> json) => CouponDetails(
code: json["code"],
type: json["type"],
discountValue: json["discountValue"],
);
);
Map<String, dynamic> toJson() => {
Map<String, dynamic> toJson() => {
"code": code,
"type": type,
"discountValue": discountValue,
};
};
}