couponApply
This commit is contained in:
@@ -13,6 +13,8 @@ import 'package:grocery_app/src/data/banners.dart';
|
||||
import 'package:grocery_app/src/data/best_dealProduct.dart';
|
||||
import 'package:grocery_app/src/data/check_pin_response.dart';
|
||||
import 'package:grocery_app/src/data/cod_order_response.dart';
|
||||
import 'package:grocery_app/src/data/coupon_model.dart';
|
||||
import 'package:grocery_app/src/data/coupon_response.dart';
|
||||
import 'package:grocery_app/src/data/login_response.dart';
|
||||
import 'package:grocery_app/src/data/order_paymnet.dart';
|
||||
import 'package:grocery_app/src/data/product_category.dart';
|
||||
@@ -53,7 +55,7 @@ class ProductRepo {
|
||||
var response = await _productService.getProductDetails(data, id);
|
||||
|
||||
ProductDetailsData loginResponse =
|
||||
productDetailsdataFromJson(response.toString());
|
||||
productDetailsDataFromJson(response.toString());
|
||||
|
||||
final String model = response.toString();
|
||||
|
||||
@@ -102,7 +104,7 @@ class ProductRepo {
|
||||
try {
|
||||
var response = await _productService.paymentOrder(data);
|
||||
print("kjdfglkjfdgjklfgkldj${data} ${response} ");
|
||||
|
||||
|
||||
OrderPaymnet productCategory = orderPaymnetFromJson(response.toString());
|
||||
|
||||
print("lkjdflkjfhgdkhfgkd ");
|
||||
@@ -115,13 +117,11 @@ class ProductRepo {
|
||||
}
|
||||
}
|
||||
|
||||
FutureResult<CodOrderResponse> paymentCODOrder(data) async {
|
||||
FutureResult<CodOrderResponse> paymentCODOrder(data) async {
|
||||
try {
|
||||
|
||||
var response = await _productService.paymentCODOrder(data);
|
||||
CodOrderResponse productCategory = codOrderResponseFromJson(response.toString());
|
||||
|
||||
|
||||
CodOrderResponse productCategory =
|
||||
codOrderResponseFromJson(response.toString());
|
||||
|
||||
return right(productCategory);
|
||||
} on DioException catch (e) {
|
||||
@@ -130,11 +130,6 @@ class ProductRepo {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FutureResult<List<Product>> similarProduct(
|
||||
data, BuildContext context, id) async {
|
||||
try {
|
||||
@@ -165,6 +160,34 @@ class ProductRepo {
|
||||
}
|
||||
}
|
||||
|
||||
FutureResult<CouponDataModel> offerCoupon(data) async {
|
||||
try {
|
||||
var response = await _productService.offerCoupon(data);
|
||||
|
||||
CouponDataModel couponmodel = couponDataFromJson(response.toString());
|
||||
return right(couponmodel);
|
||||
} on DioException catch (e) {
|
||||
var error = CustomDioExceptions.handleError(e);
|
||||
return left(error);
|
||||
}
|
||||
}
|
||||
|
||||
FutureResult<CouponResponse> applyCoupon(data) async {
|
||||
try {
|
||||
var response = await _productService.applyCoupon(data);
|
||||
|
||||
CouponResponse couponresponse = couponResponseFromJson(response.toString());
|
||||
return right(couponresponse);
|
||||
} on DioException catch (e) {
|
||||
var error = CustomDioExceptions.handleError(e);
|
||||
return left(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FutureResult<AddressResponse> getAddress(data) async {
|
||||
try {
|
||||
var response = await _productService.getAddress(data);
|
||||
|
||||
Reference in New Issue
Block a user