BASE: Switch From EasyLocalization To GetX Localization.
This commit is contained in:
@@ -14,12 +14,12 @@ import 'package:customer/themes/responsive.dart';
|
||||
import 'package:customer/themes/round_button_fill.dart';
|
||||
import 'package:customer/themes/text_field_widget.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../models/user_model.dart';
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
@@ -48,7 +48,7 @@ class CartScreen extends StatelessWidget {
|
||||
),
|
||||
body:
|
||||
cartItem.isEmpty
|
||||
? Constant.showEmptyView(message: "Item Not available".tr())
|
||||
? Constant.showEmptyView(message: "Item Not available".tr)
|
||||
: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -76,7 +76,7 @@ class CartScreen extends StatelessWidget {
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Service not available in this area"
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -501,7 +501,7 @@ class CartScreen extends StatelessWidget {
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Out of stock"
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -527,7 +527,7 @@ class CartScreen extends StatelessWidget {
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Out of stock"
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -554,7 +554,7 @@ class CartScreen extends StatelessWidget {
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Out of stock"
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -597,7 +597,7 @@ class CartScreen extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Variants".tr(),
|
||||
"Variants".tr,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: TextStyle(
|
||||
@@ -687,7 +687,7 @@ class CartScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Addons".tr(),
|
||||
"Addons".tr,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: TextStyle(
|
||||
@@ -822,8 +822,8 @@ class CartScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"${'Delivery Type'.tr()} (${controller.selectedFoodType.value})"
|
||||
.tr(),
|
||||
"${'Delivery Type'.tr} (${controller.selectedFoodType.value})"
|
||||
.tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -858,7 +858,7 @@ class CartScreen extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Instant Delivery".tr(),
|
||||
"Instant Delivery".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -874,7 +874,7 @@ class CartScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
"Standard".tr(),
|
||||
"Standard".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -894,7 +894,7 @@ class CartScreen extends StatelessWidget {
|
||||
Radio(
|
||||
value:
|
||||
controller.deliveryType.value,
|
||||
groupValue: "instant".tr(),
|
||||
groupValue: "instant".tr,
|
||||
activeColor:
|
||||
AppThemeData.primary300,
|
||||
onChanged: (value) {
|
||||
@@ -928,7 +928,7 @@ class CartScreen extends StatelessWidget {
|
||||
},
|
||||
minDateTime: DateTime.now(),
|
||||
displaySubmitButton: true,
|
||||
pickerTitle: Text('Schedule Time'.tr()),
|
||||
pickerTitle: Text('Schedule Time'.tr),
|
||||
buttonSingleColor:
|
||||
AppThemeData.primary300,
|
||||
).show(context);
|
||||
@@ -943,7 +943,7 @@ class CartScreen extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Schedule Time".tr(),
|
||||
"Schedule Time".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -959,7 +959,7 @@ class CartScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
"${'Your preferred time'.tr()} ${controller.deliveryType.value == "schedule" ? Constant.timestampToDateTime(Timestamp.fromDate(controller.scheduleDateTime.value)) : ""}",
|
||||
"${'Your preferred time'.tr} ${controller.deliveryType.value == "schedule" ? Constant.timestampToDateTime(Timestamp.fromDate(controller.scheduleDateTime.value)) : ""}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -977,7 +977,7 @@ class CartScreen extends StatelessWidget {
|
||||
),
|
||||
Radio(
|
||||
value: controller.deliveryType.value,
|
||||
groupValue: "schedule".tr(),
|
||||
groupValue: "schedule".tr,
|
||||
activeColor: AppThemeData.primary300,
|
||||
onChanged: (value) {
|
||||
controller.deliveryType.value =
|
||||
@@ -998,7 +998,7 @@ class CartScreen extends StatelessWidget {
|
||||
.value,
|
||||
displaySubmitButton: true,
|
||||
pickerTitle: Text(
|
||||
'Schedule Time'.tr(),
|
||||
'Schedule Time'.tr,
|
||||
),
|
||||
buttonSingleColor:
|
||||
AppThemeData.primary300,
|
||||
@@ -1020,7 +1020,7 @@ class CartScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Offers & Benefits".tr(),
|
||||
"Offers & Benefits".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -1066,7 +1066,7 @@ class CartScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Apply Coupons".tr(),
|
||||
"Apply Coupons".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -1095,7 +1095,7 @@ class CartScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Bill Details".tr(),
|
||||
"Bill Details".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -1139,7 +1139,7 @@ class CartScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Item totals".tr(),
|
||||
"Item totals".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -1180,7 +1180,7 @@ class CartScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Delivery Fee".tr(),
|
||||
"Delivery Fee".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -1203,7 +1203,7 @@ class CartScreen extends StatelessWidget {
|
||||
Constant.isSelfDeliveryFeature ==
|
||||
true)
|
||||
? Text(
|
||||
'Free Delivery'.tr(),
|
||||
'Free Delivery'.tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -1251,7 +1251,7 @@ class CartScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Coupon Discount".tr(),
|
||||
"Coupon Discount".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -1294,7 +1294,7 @@ class CartScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Special Discount".tr(),
|
||||
"Special Discount".tr,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: TextStyle(
|
||||
@@ -1352,7 +1352,7 @@ class CartScreen extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Delivery Tips".tr(),
|
||||
"Delivery Tips".tr,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: TextStyle(
|
||||
@@ -1382,7 +1382,7 @@ class CartScreen extends StatelessWidget {
|
||||
.calculatePrice();
|
||||
},
|
||||
child: Text(
|
||||
"Remove".tr(),
|
||||
"Remove".tr,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: TextStyle(
|
||||
@@ -1509,7 +1509,7 @@ class CartScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"To Pay".tr(),
|
||||
"To Pay".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -1561,7 +1561,7 @@ class CartScreen extends StatelessWidget {
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"Thanks with a tip!".tr(),
|
||||
"Thanks with a tip!".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -1606,7 +1606,7 @@ class CartScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Around the clock, our delivery partners make it happen. Show gratitude with a tip.."
|
||||
.tr(),
|
||||
.tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
@@ -1858,7 +1858,7 @@ class CartScreen extends StatelessWidget {
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Other'.tr(),
|
||||
'Other'.tr,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
@@ -1894,9 +1894,9 @@ class CartScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
TextFieldWidget(
|
||||
title: 'Remarks'.tr(),
|
||||
title: 'Remarks'.tr,
|
||||
controller: controller.reMarkController.value,
|
||||
hintText: 'Write remarks for the store'.tr(),
|
||||
hintText: 'Write remarks for the store'.tr,
|
||||
maxLine: 4,
|
||||
),
|
||||
],
|
||||
@@ -1926,7 +1926,7 @@ class CartScreen extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
"Cashback Offer".tr(),
|
||||
"Cashback Offer".tr,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
@@ -1938,7 +1938,7 @@ class CartScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${"Cashback Name :".tr()} ${controller.bestCashback.value.title ?? ''}",
|
||||
"${"Cashback Name :".tr} ${controller.bestCashback.value.title ?? ''}",
|
||||
style: TextStyle(
|
||||
color: AppThemeData.success300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -1946,7 +1946,7 @@ class CartScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${"You will get".tr()} ${Constant.amountShow(amount: controller.bestCashback.value.cashbackValue?.toStringAsFixed(2))} ${"cashback after completing the order.".tr()}",
|
||||
"${"You will get".tr} ${Constant.amountShow(amount: controller.bestCashback.value.cashbackValue?.toStringAsFixed(2))} ${"cashback after completing the order.".tr}",
|
||||
style: TextStyle(
|
||||
color: AppThemeData.success300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -2115,7 +2115,7 @@ class CartScreen extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Pay Via".tr(),
|
||||
"Pay Via".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -2176,7 +2176,7 @@ class CartScreen extends StatelessWidget {
|
||||
: isDark
|
||||
? AppThemeData.grey800
|
||||
: AppThemeData.grey100,
|
||||
title: "Pay Now".tr(),
|
||||
title: "Pay Now".tr,
|
||||
height: 5,
|
||||
color:
|
||||
controller.selectedPaymentMethod.value !=
|
||||
@@ -2192,7 +2192,7 @@ class CartScreen extends StatelessWidget {
|
||||
controller.totalAmount.value)) {
|
||||
ShowToastDialog.showToast(
|
||||
"The total price must be greater than or equal to the coupon discount value for the code to apply. Please review your cart total."
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -2206,7 +2206,7 @@ class CartScreen extends StatelessWidget {
|
||||
controller.totalAmount.value)) {
|
||||
ShowToastDialog.showToast(
|
||||
"The total price must be greater than or equal to the special discount value for the code to apply. Please review your cart total."
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -2329,7 +2329,7 @@ class CartScreen extends StatelessWidget {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin."
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
} else {
|
||||
CreateRazorPayOrderModel
|
||||
@@ -2347,7 +2347,7 @@ class CartScreen extends StatelessWidget {
|
||||
} else {
|
||||
controller.isOrderPlaced.value = false;
|
||||
ShowToastDialog.showToast(
|
||||
"Please select payment method".tr(),
|
||||
"Please select payment method".tr,
|
||||
);
|
||||
}
|
||||
controller.isOrderPlaced.value = false;
|
||||
@@ -2411,7 +2411,7 @@ class CartScreen extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TextFieldWidget(
|
||||
title: 'Tips Amount'.tr(),
|
||||
title: 'Tips Amount'.tr,
|
||||
controller: controller.tipsController.value,
|
||||
textInputType: const TextInputType.numberWithOptions(
|
||||
signed: true,
|
||||
@@ -2427,7 +2427,7 @@ class CartScreen extends StatelessWidget {
|
||||
vertical: 14,
|
||||
),
|
||||
child: Text(
|
||||
Constant.currencyModel!.symbol.tr(),
|
||||
Constant.currencyModel!.symbol.tr,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
@@ -2436,7 +2436,7 @@ class CartScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: 'Enter Tips Amount'.tr(),
|
||||
hintText: 'Enter Tips Amount'.tr,
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
@@ -2444,7 +2444,7 @@ class CartScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: "Cancel".tr(),
|
||||
title: "Cancel".tr,
|
||||
color:
|
||||
isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
textColor:
|
||||
@@ -2458,13 +2458,13 @@ class CartScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: "Add".tr(),
|
||||
title: "Add".tr,
|
||||
color: AppThemeData.primary300,
|
||||
textColor: AppThemeData.grey50,
|
||||
onPress: () async {
|
||||
if (controller.tipsController.value.text.isEmpty) {
|
||||
ShowToastDialog.showToast(
|
||||
"Please enter tips Amount".tr(),
|
||||
"Please enter tips Amount".tr,
|
||||
);
|
||||
} else {
|
||||
controller.deliveryTips.value = double.parse(
|
||||
|
||||
@@ -6,9 +6,9 @@ import 'package:customer/themes/responsive.dart';
|
||||
import 'package:customer/themes/text_field_widget.dart';
|
||||
import 'package:customer/widget/my_separator.dart';
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
|
||||
@@ -31,7 +31,7 @@ class CouponListScreen extends StatelessWidget {
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
"Coupon Code".tr(),
|
||||
"Coupon Code".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
@@ -44,7 +44,7 @@ class CouponListScreen extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: TextFieldWidget(
|
||||
hintText: 'Enter coupon code'.tr(),
|
||||
hintText: 'Enter coupon code'.tr,
|
||||
controller: controller.couponCodeController.value,
|
||||
suffix: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -59,7 +59,7 @@ class CouponListScreen extends StatelessWidget {
|
||||
.text
|
||||
.isEmpty) {
|
||||
ShowToastDialog.showToast(
|
||||
"Please enter coupon code".tr(),
|
||||
"Please enter coupon code".tr,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -83,15 +83,15 @@ class CouponListScreen extends StatelessWidget {
|
||||
Get.back();
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Coupon code not applied".tr(),
|
||||
"Coupon code not applied".tr,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast("Invalid Coupon".tr());
|
||||
ShowToastDialog.showToast("Invalid Coupon".tr);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
"Apply".tr(),
|
||||
"Apply".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -147,7 +147,7 @@ class CouponListScreen extends StatelessWidget {
|
||||
child: RotatedBox(
|
||||
quarterTurns: -1,
|
||||
child: Text(
|
||||
"${couponModel.discountType == "Fix Price" ? Constant.amountShow(amount: couponModel.discount) : "${couponModel.discount}%"} ${'Off'.tr()}",
|
||||
"${couponModel.discountType == "Fix Price" ? Constant.amountShow(amount: couponModel.discount) : "${couponModel.discount}%"} ${'Off'.tr}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -221,12 +221,12 @@ class CouponListScreen extends StatelessWidget {
|
||||
Get.back();
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Coupon code not applied".tr(),
|
||||
"Coupon code not applied".tr,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
"Tap To Apply".tr(),
|
||||
"Tap To Apply".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
|
||||
@@ -6,11 +6,12 @@ import 'package:customer/models/cart_product_model.dart';
|
||||
import 'package:customer/screen_ui/ecommarce/dash_board_e_commerce_screen.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/round_button_fill.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../dash_board_screens/dash_board_screen.dart';
|
||||
|
||||
@@ -44,7 +45,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Order Placed".tr(),
|
||||
"Order Placed".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
color:
|
||||
@@ -58,7 +59,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
"Hang tight — your items are being delivered quickly and safely!"
|
||||
.tr(),
|
||||
.tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
color:
|
||||
@@ -100,7 +101,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Order ID".tr(),
|
||||
"Order ID".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -147,7 +148,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"Placing your order".tr(),
|
||||
"Placing your order".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
color:
|
||||
@@ -161,7 +162,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
"Take a moment to review your order before proceeding to checkout."
|
||||
.tr(),
|
||||
.tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
color:
|
||||
@@ -203,7 +204,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Delivery Address".tr(),
|
||||
"Delivery Address".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -265,7 +266,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Order Summary".tr(),
|
||||
"Order Summary".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
@@ -299,7 +300,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"${cartProductModel.quantity} x".tr(),
|
||||
"${cartProductModel.quantity} x".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
color:
|
||||
@@ -312,7 +313,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${cartProductModel.name}".tr(),
|
||||
"${cartProductModel.name}".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
color:
|
||||
@@ -344,7 +345,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
controller.isPlacing.value
|
||||
? RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: "Track Order".tr(),
|
||||
title: "Track Order".tr,
|
||||
height: 5.5,
|
||||
color: AppThemeData.primary300,
|
||||
textColor: AppThemeData.grey50,
|
||||
@@ -368,7 +369,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
)
|
||||
: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: "Track Order".tr(),
|
||||
title: "Track Order".tr,
|
||||
height: 5.5,
|
||||
color:
|
||||
isDark
|
||||
|
||||
@@ -2,10 +2,10 @@ import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/controllers/cart_controller.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/round_button_fill.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../wallet_screen/wallet_screen.dart';
|
||||
|
||||
@@ -20,13 +20,15 @@ class SelectPaymentScreen extends StatelessWidget {
|
||||
init: CartController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
"Payment Option".tr(),
|
||||
"Payment Option".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
@@ -42,21 +44,23 @@ class SelectPaymentScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Preferred Payment".tr(),
|
||||
"Preferred Payment".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
if (controller.walletSettingModel.value.isEnabled == true || controller.cashOnDeliverySettingModel.value.isEnabled == true)
|
||||
const SizedBox(height: 10),
|
||||
if (controller.walletSettingModel.value.isEnabled == true ||
|
||||
controller.cashOnDeliverySettingModel.value.isEnabled ==
|
||||
true)
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
@@ -66,7 +70,7 @@ class SelectPaymentScreen extends StatelessWidget {
|
||||
blurRadius: 20,
|
||||
offset: Offset(0, 0),
|
||||
spreadRadius: 0,
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
@@ -74,40 +78,62 @@ class SelectPaymentScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: controller.walletSettingModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.wallet, isDark, "assets/images/ic_wallet.png"),
|
||||
visible:
|
||||
controller
|
||||
.walletSettingModel
|
||||
.value
|
||||
.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.wallet,
|
||||
isDark,
|
||||
"assets/images/ic_wallet.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.cashOnDeliverySettingModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.cod, isDark, "assets/images/ic_cash.png"),
|
||||
visible:
|
||||
controller
|
||||
.cashOnDeliverySettingModel
|
||||
.value
|
||||
.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.cod,
|
||||
isDark,
|
||||
"assets/images/ic_cash.png",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (controller.walletSettingModel.value.isEnabled == true || controller.cashOnDeliverySettingModel.value.isEnabled == true)
|
||||
if (controller.walletSettingModel.value.isEnabled == true ||
|
||||
controller.cashOnDeliverySettingModel.value.isEnabled ==
|
||||
true)
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Other Payment Options".tr(),
|
||||
"Other Payment Options".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
@@ -117,7 +143,7 @@ class SelectPaymentScreen extends StatelessWidget {
|
||||
blurRadius: 20,
|
||||
offset: Offset(0, 0),
|
||||
spreadRadius: 0,
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
@@ -125,62 +151,133 @@ class SelectPaymentScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: controller.stripeModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.stripe, isDark, "assets/images/stripe.png"),
|
||||
visible:
|
||||
controller.stripeModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.stripe,
|
||||
isDark,
|
||||
"assets/images/stripe.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.payPalModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.paypal, isDark, "assets/images/paypal.png"),
|
||||
visible:
|
||||
controller.payPalModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.paypal,
|
||||
isDark,
|
||||
"assets/images/paypal.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.payStackModel.value.isEnable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.payStack, isDark, "assets/images/paystack.png"),
|
||||
visible:
|
||||
controller.payStackModel.value.isEnable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.payStack,
|
||||
isDark,
|
||||
"assets/images/paystack.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.mercadoPagoModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.mercadoPago, isDark, "assets/images/mercado-pago.png"),
|
||||
visible:
|
||||
controller.mercadoPagoModel.value.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.mercadoPago,
|
||||
isDark,
|
||||
"assets/images/mercado-pago.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.flutterWaveModel.value.isEnable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.flutterWave, isDark, "assets/images/flutterwave_logo.png"),
|
||||
visible:
|
||||
controller.flutterWaveModel.value.isEnable ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.flutterWave,
|
||||
isDark,
|
||||
"assets/images/flutterwave_logo.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.payFastModel.value.isEnable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.payFast, isDark, "assets/images/payfast.png"),
|
||||
visible:
|
||||
controller.payFastModel.value.isEnable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.payFast,
|
||||
isDark,
|
||||
"assets/images/payfast.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.razorPayModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.razorpay, isDark, "assets/images/razorpay.png"),
|
||||
visible:
|
||||
controller.razorPayModel.value.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.razorpay,
|
||||
isDark,
|
||||
"assets/images/razorpay.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.midTransModel.value.enable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.midTrans, isDark, "assets/images/midtrans.png"),
|
||||
visible:
|
||||
controller.midTransModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.midTrans,
|
||||
isDark,
|
||||
"assets/images/midtrans.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.orangeMoneyModel.value.enable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.orangeMoney, isDark, "assets/images/orange_money.png"),
|
||||
visible:
|
||||
controller.orangeMoneyModel.value.enable ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.orangeMoney,
|
||||
isDark,
|
||||
"assets/images/orange_money.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.xenditModel.value.enable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.xendit, isDark, "assets/images/xendit.png"),
|
||||
visible:
|
||||
controller.xenditModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.xendit,
|
||||
isDark,
|
||||
"assets/images/xendit.png",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, borderRadius: const BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: "${'Pay Now'.tr()} | ${Constant.amountShow(amount: controller.totalAmount.value.toString())}".tr(),
|
||||
borderRadius: 10.r,
|
||||
title:
|
||||
"${'Pay Now'.tr} | ${Constant.amountShow(amount: controller.totalAmount.value.toString())}"
|
||||
.tr,
|
||||
height: 5,
|
||||
color: AppThemeData.primary300,
|
||||
textColor: AppThemeData.grey50,
|
||||
@@ -196,7 +293,12 @@ class SelectPaymentScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Obx cardDecoration(CartController controller, PaymentGateway value, isDark, String image) {
|
||||
Obx cardDecoration(
|
||||
CartController controller,
|
||||
PaymentGateway value,
|
||||
isDark,
|
||||
String image,
|
||||
) {
|
||||
return Obx(
|
||||
() => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
@@ -213,68 +315,89 @@ class SelectPaymentScreen extends StatelessWidget {
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(width: 1, color: Color(0xFFE5E7EB)),
|
||||
side: const BorderSide(
|
||||
width: 1,
|
||||
color: Color(0xFFE5E7EB),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(value.name == "payFast" ? 0 : 8.0),
|
||||
child: Image.asset(
|
||||
image,
|
||||
padding: EdgeInsets.all(
|
||||
value.name == "payFast" ? 0 : 8.0,
|
||||
),
|
||||
child: Image.asset(image),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
value.name == "wallet"
|
||||
? Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
value.name.capitalizeString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
value.name.capitalizeString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: controller.userModel.value.walletAmount == null ? '0.0' : controller.userModel.value.walletAmount.toString()),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Expanded(
|
||||
child: Text(
|
||||
value.name.capitalizeString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller.userModel.value.walletAmount ==
|
||||
null
|
||||
? '0.0'
|
||||
: controller
|
||||
.userModel
|
||||
.value
|
||||
.walletAmount
|
||||
.toString(),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Expanded(
|
||||
child: Text(
|
||||
value.name.capitalizeString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
const Expanded(
|
||||
child: SizedBox(),
|
||||
),
|
||||
),
|
||||
const Expanded(child: SizedBox()),
|
||||
Radio(
|
||||
value: value.name,
|
||||
groupValue: controller.selectedPaymentMethod.value,
|
||||
activeColor: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
activeColor:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
onChanged: (value) {
|
||||
controller.selectedPaymentMethod.value = value.toString();
|
||||
},
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user