BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/cart_product_model.dart';
|
||||
import 'package:customer/models/order_model.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../service/cart_provider.dart';
|
||||
|
||||
class OrderDetailsController extends GetxController {
|
||||
@@ -39,28 +38,48 @@ class OrderDetailsController extends GetxController {
|
||||
|
||||
for (var element in orderModel.value.products!) {
|
||||
if (double.parse(element.discountPrice.toString()) <= 0) {
|
||||
subTotal.value = subTotal.value +
|
||||
double.parse(element.price.toString()) * double.parse(element.quantity.toString()) +
|
||||
(double.parse(element.extrasPrice.toString()) * double.parse(element.quantity.toString()));
|
||||
subTotal.value =
|
||||
subTotal.value +
|
||||
double.parse(element.price.toString()) *
|
||||
double.parse(element.quantity.toString()) +
|
||||
(double.parse(element.extrasPrice.toString()) *
|
||||
double.parse(element.quantity.toString()));
|
||||
} else {
|
||||
subTotal.value = subTotal.value +
|
||||
double.parse(element.discountPrice.toString()) * double.parse(element.quantity.toString()) +
|
||||
(double.parse(element.extrasPrice.toString()) * double.parse(element.quantity.toString()));
|
||||
subTotal.value =
|
||||
subTotal.value +
|
||||
double.parse(element.discountPrice.toString()) *
|
||||
double.parse(element.quantity.toString()) +
|
||||
(double.parse(element.extrasPrice.toString()) *
|
||||
double.parse(element.quantity.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
if (orderModel.value.specialDiscount != null && orderModel.value.specialDiscount!['special_discount'] != null) {
|
||||
specialDiscountAmount.value = double.parse(orderModel.value.specialDiscount!['special_discount'].toString());
|
||||
if (orderModel.value.specialDiscount != null &&
|
||||
orderModel.value.specialDiscount!['special_discount'] != null) {
|
||||
specialDiscountAmount.value = double.parse(
|
||||
orderModel.value.specialDiscount!['special_discount'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
if (orderModel.value.taxSetting != null) {
|
||||
for (var element in orderModel.value.taxSetting!) {
|
||||
taxAmount.value = taxAmount.value +
|
||||
Constant.calculateTax(amount: (subTotal.value - double.parse(orderModel.value.discount.toString()) - specialDiscountAmount.value).toString(), taxModel: element);
|
||||
taxAmount.value =
|
||||
taxAmount.value +
|
||||
Constant.calculateTax(
|
||||
amount:
|
||||
(subTotal.value -
|
||||
double.parse(orderModel.value.discount.toString()) -
|
||||
specialDiscountAmount.value)
|
||||
.toString(),
|
||||
taxModel: element,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
totalAmount.value = (subTotal.value - double.parse(orderModel.value.discount.toString()) - specialDiscountAmount.value) +
|
||||
totalAmount.value =
|
||||
(subTotal.value -
|
||||
double.parse(orderModel.value.discount.toString()) -
|
||||
specialDiscountAmount.value) +
|
||||
taxAmount.value +
|
||||
double.parse(orderModel.value.deliveryCharge.toString()) +
|
||||
double.parse(orderModel.value.tipAmount.toString());
|
||||
@@ -71,7 +90,11 @@ class OrderDetailsController extends GetxController {
|
||||
final CartProvider cartProvider = CartProvider();
|
||||
|
||||
void addToCart({required CartProductModel cartProductModel}) {
|
||||
cartProvider.addToCart(Get.context!, cartProductModel, cartProductModel.quantity!);
|
||||
cartProvider.addToCart(
|
||||
Get.context!,
|
||||
cartProductModel,
|
||||
cartProductModel.quantity!,
|
||||
);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user