BASE: Initialize Localization.
This commit is contained in:
0
assets/translations/ru_RU.json
Normal file
0
assets/translations/ru_RU.json
Normal file
0
assets/translations/uz_UZ.json
Normal file
0
assets/translations/uz_UZ.json
Normal file
@@ -80,5 +80,11 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>CFBundleLocalizations</key>
|
||||||
|
<array>
|
||||||
|
<string>en</string>
|
||||||
|
<string>ru</string>
|
||||||
|
<string>uz</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -102,25 +102,25 @@ class ConstTexts {
|
|||||||
static String plsLoginToAcc = "plsLoginToAcc";
|
static String plsLoginToAcc = "plsLoginToAcc";
|
||||||
static String youAreNotLoggedIn = "youAreNotLoggedIn";
|
static String youAreNotLoggedIn = "youAreNotLoggedIn";
|
||||||
static String noOrderfound = "noOrderfound";
|
static String noOrderfound = "noOrderfound";
|
||||||
static String yourSosrequestAlreadySubmitted = "yourSosrequestAlreadySubmitted";
|
// static String yourSosrequestAlreadySubmitted = "yourSosrequestAlreadySubmitted";
|
||||||
static String payNow = "payNow";
|
// static String payNow = "payNow";
|
||||||
static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
|
// static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
|
||||||
static String somethingWentWrong = "somethingWentWrong";
|
// static String somethingWentWrong = "somethingWentWrong";
|
||||||
static String cash = "cash";
|
// static String cash = "cash";
|
||||||
static String coupon = "coupon";
|
// static String coupon = "coupon";
|
||||||
static String couponNotFound = "couponNotFound";
|
// static String couponNotFound = "couponNotFound";
|
||||||
static String tapToApply = "tapToApply";
|
// static String tapToApply = "tapToApply";
|
||||||
static String home = "home";
|
// static String home = "home";
|
||||||
static String myBookings = "myBookings";
|
// static String myBookings = "myBookings";
|
||||||
static String profile = "profile";
|
// static String profile = "profile";
|
||||||
static String wallet = "wallet";
|
// static String wallet = "wallet";
|
||||||
static String cabServiceType = "cabServiceType";
|
// static String cabServiceType = "cabServiceType";
|
||||||
static String everyRideVerified = "everyRideVerified";
|
// static String everyRideVerified = "everyRideVerified";
|
||||||
static String allDriversIDCheck = "allDriversIDCheck";
|
// static String allDriversIDCheck = "allDriversIDCheck";
|
||||||
static String intercity = "intercity";
|
// static String intercity = "intercity";
|
||||||
static String aroundTheCity = "aroundTheCity";
|
// static String aroundTheCity = "aroundTheCity";
|
||||||
static String rideDetails = "rideDetails";
|
// static String rideDetails = "rideDetails";
|
||||||
static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
|
// static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
|
||||||
static String somethingWentWrong = "somethingWentWrong";
|
// static String somethingWentWrong = "somethingWentWrong";
|
||||||
static String cash = "cash";
|
// static String cash = "cash";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import '../../models/onprovider_order_model.dart';
|
import '../../models/onprovider_order_model.dart';
|
||||||
@@ -72,7 +73,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
Future<void> placeOrder() async {
|
Future<void> placeOrder() async {
|
||||||
if (!isExtra) {
|
if (!isExtra) {
|
||||||
// Normal Order
|
// Normal Order
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
onDemandOrderModel.value?.payment_method = selectedPaymentMethod.value;
|
onDemandOrderModel.value?.payment_method = selectedPaymentMethod.value;
|
||||||
onDemandOrderModel.value?.paymentStatus = onDemandOrderModel.value?.provider.priceUnit == "Fixed" && selectedPaymentMethod.value == "cod" ? false : true;
|
onDemandOrderModel.value?.paymentStatus = onDemandOrderModel.value?.provider.priceUnit == "Fixed" && selectedPaymentMethod.value == "cod" ? false : true;
|
||||||
@@ -90,7 +91,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
await SendNotification.sendFcmMessage(Constant.bookingPlaced, providerUser.fcmToken ?? '', payLoad);
|
await SendNotification.sendFcmMessage(Constant.bookingPlaced, providerUser.fcmToken ?? '', payLoad);
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowToastDialog.showToast("OnDemand Service successfully booked".tr);
|
ShowToastDialog.showToast("OnDemand Service successfully booked".tr());
|
||||||
}
|
}
|
||||||
if (selectedPaymentMethod.value == PaymentGateway.wallet.name) {
|
if (selectedPaymentMethod.value == PaymentGateway.wallet.name) {
|
||||||
WalletTransactionModel transactionModel = WalletTransactionModel(
|
WalletTransactionModel transactionModel = WalletTransactionModel(
|
||||||
@@ -102,8 +103,8 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
userId: FireStoreUtils.getCurrentUid(),
|
userId: FireStoreUtils.getCurrentUid(),
|
||||||
isTopup: false,
|
isTopup: false,
|
||||||
orderId: onDemandOrderModel.value!.id,
|
orderId: onDemandOrderModel.value!.id,
|
||||||
note: "Booking Amount debited".tr,
|
note: "Booking Amount debited".tr(),
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
);
|
);
|
||||||
|
|
||||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
||||||
@@ -133,7 +134,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
isTopup: false,
|
isTopup: false,
|
||||||
orderId: onDemandOrderModel.value!.id,
|
orderId: onDemandOrderModel.value!.id,
|
||||||
note: "Booking Extra charge debited",
|
note: "Booking Extra charge debited",
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
);
|
);
|
||||||
|
|
||||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
||||||
@@ -156,7 +157,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
isTopup: true,
|
isTopup: true,
|
||||||
orderId: onDemandOrderModel.value?.id,
|
orderId: onDemandOrderModel.value?.id,
|
||||||
note: 'Extra Charge Amount Credited',
|
note: 'Extra Charge Amount Credited',
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
);
|
);
|
||||||
|
|
||||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
||||||
@@ -252,7 +253,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
log("stripe Responce====>$paymentIntentData");
|
log("stripe Responce====>$paymentIntentData");
|
||||||
if (paymentIntentData!.containsKey("error")) {
|
if (paymentIntentData!.containsKey("error")) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
await Stripe.instance.initPaymentSheet(
|
await Stripe.instance.initPaymentSheet(
|
||||||
paymentSheetParameters: SetupPaymentSheetParameters(
|
paymentSheetParameters: SetupPaymentSheetParameters(
|
||||||
@@ -276,7 +277,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -342,10 +343,10 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -377,15 +378,15 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
note: "Contact us for any questions on your order.",
|
note: "Contact us for any questions on your order.",
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
placeOrder();
|
placeOrder();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -412,14 +413,14 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -445,10 +446,10 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -476,11 +477,11 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -585,7 +586,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
return GetPaymentTxtTokenModel.fromJson(data);
|
return GetPaymentTxtTokenModel.fromJson(data);
|
||||||
}
|
}
|
||||||
@@ -618,18 +619,18 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
||||||
@@ -644,10 +645,10 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
if (url != '') {
|
if (url != '') {
|
||||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -672,7 +673,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
final responseData = jsonDecode(response.body);
|
final responseData = jsonDecode(response.body);
|
||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -702,12 +703,12 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
if (paymentURL.toString().isNotEmpty) {
|
if (paymentURL.toString().isNotEmpty) {
|
||||||
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -726,13 +727,13 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
|
|
||||||
accessToken = responseData['access_token'] ?? '';
|
accessToken = responseData['access_token'] ?? '';
|
||||||
if (accessToken.isEmpty) {
|
if (accessToken.isEmpty) {
|
||||||
ShowToastDialog.showToast("Failed to get access token".tr);
|
ShowToastDialog.showToast("Failed to get access token".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -773,7 +774,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -800,13 +801,13 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
// () => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken),
|
// () => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken),
|
||||||
// )!.then((value) {
|
// )!.then((value) {
|
||||||
// if (value == true) {
|
// if (value == true) {
|
||||||
// ShowToastDialog.showToast("Payment Successful!!".tr);
|
// ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
// placeOrder();
|
// placeOrder();
|
||||||
// ();
|
// ();
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// } else {
|
// } else {
|
||||||
// ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
// ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@@ -829,7 +830,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
// // ignore: use_build_context_synchronously
|
// // ignore: use_build_context_synchronously
|
||||||
// return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
// return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
// } else {
|
// } else {
|
||||||
// ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
// ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
// return '';
|
// return '';
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -870,7 +871,7 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
// return '';
|
// return '';
|
||||||
// }
|
// }
|
||||||
// } else {
|
// } else {
|
||||||
// ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
// ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
// return '';
|
// return '';
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -889,11 +890,11 @@ class OnDemandPaymentController extends GetxController {
|
|||||||
if (model.id != null) {
|
if (model.id != null) {
|
||||||
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
();
|
();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import 'package:customer/payment/xenditScreen.dart';
|
|||||||
import 'package:customer/service/fire_store_utils.dart';
|
import 'package:customer/service/fire_store_utils.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
import 'package:customer/utils/preferences.dart';
|
import 'package:customer/utils/preferences.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
@@ -313,20 +314,20 @@ class IntercityHomeController extends GetxController {
|
|||||||
Marker(
|
Marker(
|
||||||
markerId: const MarkerId("pickup"),
|
markerId: const MarkerId("pickup"),
|
||||||
position: LatLng(pickupLat, pickupLng),
|
position: LatLng(pickupLat, pickupLng),
|
||||||
infoWindow: InfoWindow(title: "Pickup Location".tr),
|
infoWindow: InfoWindow(title: "Pickup Location".tr()),
|
||||||
icon: departureIcon ?? BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueGreen),
|
icon: departureIcon ?? BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueGreen),
|
||||||
),
|
),
|
||||||
Marker(markerId: const MarkerId("driver"), position: LatLng(driverLat, driverLng), infoWindow: InfoWindow(title: "Driver at Pickup".tr), icon: taxiIcon ?? BitmapDescriptor.defaultMarker),
|
Marker(markerId: const MarkerId("driver"), position: LatLng(driverLat, driverLng), infoWindow: InfoWindow(title: "Driver at Pickup".tr()), icon: taxiIcon ?? BitmapDescriptor.defaultMarker),
|
||||||
]);
|
]);
|
||||||
} else if (order.status == Constant.orderInTransit) {
|
} else if (order.status == Constant.orderInTransit) {
|
||||||
markers.addAll([
|
markers.addAll([
|
||||||
Marker(
|
Marker(
|
||||||
markerId: const MarkerId("destination"),
|
markerId: const MarkerId("destination"),
|
||||||
position: LatLng(destLat, destLng),
|
position: LatLng(destLat, destLng),
|
||||||
infoWindow: InfoWindow(title: "Destination Location".tr),
|
infoWindow: InfoWindow(title: "Destination Location".tr()),
|
||||||
icon: destinationIcon ?? BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueRed),
|
icon: destinationIcon ?? BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueRed),
|
||||||
),
|
),
|
||||||
Marker(markerId: const MarkerId("driver"), position: LatLng(driverLat, driverLng), infoWindow: InfoWindow(title: "Driver Location".tr), icon: taxiIcon ?? BitmapDescriptor.defaultMarker),
|
Marker(markerId: const MarkerId("driver"), position: LatLng(driverLat, driverLng), infoWindow: InfoWindow(title: "Driver Location".tr()), icon: taxiIcon ?? BitmapDescriptor.defaultMarker),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -412,7 +413,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
||||||
currentOrder.value.paymentMethod = selectedPaymentMethod.value;
|
currentOrder.value.paymentMethod = selectedPaymentMethod.value;
|
||||||
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment method changed".tr);
|
ShowToastDialog.showToast("Payment method changed".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
@@ -433,8 +434,8 @@ class IntercityHomeController extends GetxController {
|
|||||||
userId: FireStoreUtils.getCurrentUid(),
|
userId: FireStoreUtils.getCurrentUid(),
|
||||||
isTopup: false,
|
isTopup: false,
|
||||||
orderId: currentOrder.value.id,
|
orderId: currentOrder.value.id,
|
||||||
note: "Cab Amount debited".tr,
|
note: "Cab Amount debited".tr(),
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
serviceType: Constant.parcelServiceType,
|
serviceType: Constant.parcelServiceType,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -446,7 +447,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -572,7 +573,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
final LatLng pos = LatLng(lat, lng);
|
final LatLng pos = LatLng(lat, lng);
|
||||||
final markerId = MarkerId(isDeparture ? 'Departure' : 'Destination');
|
final markerId = MarkerId(isDeparture ? 'Departure' : 'Destination');
|
||||||
final icon = isDeparture ? departureIcon! : destinationIcon!;
|
final icon = isDeparture ? departureIcon! : destinationIcon!;
|
||||||
final title = isDeparture ? 'Departure'.tr : 'Destination'.tr;
|
final title = isDeparture ? 'Departure'.tr() : 'Destination'.tr();
|
||||||
|
|
||||||
if (isDeparture) {
|
if (isDeparture) {
|
||||||
departureLatLong.value = pos;
|
departureLatLong.value = pos;
|
||||||
@@ -1031,7 +1032,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
log("stripe Responce====>$paymentIntentData");
|
log("stripe Responce====>$paymentIntentData");
|
||||||
if (paymentIntentData!.containsKey("error")) {
|
if (paymentIntentData!.containsKey("error")) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
await Stripe.instance.initPaymentSheet(
|
await Stripe.instance.initPaymentSheet(
|
||||||
paymentSheetParameters: SetupPaymentSheetParameters(
|
paymentSheetParameters: SetupPaymentSheetParameters(
|
||||||
@@ -1055,7 +1056,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -1121,10 +1122,10 @@ class IntercityHomeController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -1156,15 +1157,15 @@ class IntercityHomeController extends GetxController {
|
|||||||
note: "Contact us for any questions on your order.",
|
note: "Contact us for any questions on your order.",
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
completeOrder();
|
completeOrder();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1188,14 +1189,14 @@ class IntercityHomeController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1225,10 +1226,10 @@ class IntercityHomeController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -1256,11 +1257,11 @@ class IntercityHomeController extends GetxController {
|
|||||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1365,7 +1366,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
return GetPaymentTxtTokenModel.fromJson(data);
|
return GetPaymentTxtTokenModel.fromJson(data);
|
||||||
}
|
}
|
||||||
@@ -1398,18 +1399,18 @@ class IntercityHomeController extends GetxController {
|
|||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
||||||
@@ -1424,10 +1425,10 @@ class IntercityHomeController extends GetxController {
|
|||||||
if (url != '') {
|
if (url != '') {
|
||||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1452,7 +1453,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
final responseData = jsonDecode(response.body);
|
final responseData = jsonDecode(response.body);
|
||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1477,13 +1478,13 @@ class IntercityHomeController extends GetxController {
|
|||||||
if (paymentURL.toString() != '') {
|
if (paymentURL.toString() != '') {
|
||||||
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
();
|
();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1506,7 +1507,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1543,7 +1544,7 @@ class IntercityHomeController extends GetxController {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1562,11 +1563,11 @@ class IntercityHomeController extends GetxController {
|
|||||||
if (model.id != null) {
|
if (model.id != null) {
|
||||||
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
();
|
();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
|
|||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
import 'package:customer/widget/geoflutterfire/src/geoflutterfire.dart';
|
import 'package:customer/widget/geoflutterfire/src/geoflutterfire.dart';
|
||||||
import 'package:dropdown_textfield/dropdown_textfield.dart';
|
import 'package:dropdown_textfield/dropdown_textfield.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geocoding/geocoding.dart';
|
import 'package:geocoding/geocoding.dart';
|
||||||
@@ -101,10 +102,10 @@ class BookParcelController extends GetxController {
|
|||||||
|
|
||||||
void onCameraClick(BuildContext context) {
|
void onCameraClick(BuildContext context) {
|
||||||
final action = CupertinoActionSheet(
|
final action = CupertinoActionSheet(
|
||||||
message: Text('Add your parcel image.'.tr, style: const TextStyle(fontSize: 15.0)),
|
message: Text('Add your parcel image.'.tr(), style: const TextStyle(fontSize: 15.0)),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
CupertinoActionSheetAction(
|
CupertinoActionSheetAction(
|
||||||
child: Text('Choose image from gallery'.tr),
|
child: Text('Choose image from gallery'.tr()),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
final imageList = await _picker.pickMultiImage();
|
final imageList = await _picker.pickMultiImage();
|
||||||
@@ -114,7 +115,7 @@ class BookParcelController extends GetxController {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
CupertinoActionSheetAction(
|
CupertinoActionSheetAction(
|
||||||
child: Text('Take a picture'.tr),
|
child: Text('Take a picture'.tr()),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
final XFile? photo = await _picker.pickImage(source: ImageSource.camera);
|
final XFile? photo = await _picker.pickImage(source: ImageSource.camera);
|
||||||
@@ -124,7 +125,7 @@ class BookParcelController extends GetxController {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
cancelButton: CupertinoActionSheetAction(child: Text('Cancel'.tr), onPressed: () => Navigator.pop(context)),
|
cancelButton: CupertinoActionSheetAction(child: Text('Cancel'.tr()), onPressed: () => Navigator.pop(context)),
|
||||||
);
|
);
|
||||||
showCupertinoModalPopup(context: context, builder: (context) => action);
|
showCupertinoModalPopup(context: context, builder: (context) => action);
|
||||||
}
|
}
|
||||||
@@ -147,38 +148,38 @@ class BookParcelController extends GetxController {
|
|||||||
|
|
||||||
bool validateFields() {
|
bool validateFields() {
|
||||||
if (senderNameController.value.text.isEmpty) {
|
if (senderNameController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter sender name".tr);
|
ShowToastDialog.showToast("Please enter sender name".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (senderMobileController.value.text.isEmpty) {
|
} else if (senderMobileController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter sender mobile".tr);
|
ShowToastDialog.showToast("Please enter sender mobile".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (senderLocationController.value.text.isEmpty) {
|
} else if (senderLocationController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter sender address".tr);
|
ShowToastDialog.showToast("Please enter sender address".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (receiverNameController.value.text.isEmpty) {
|
} else if (receiverNameController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter receiver name".tr);
|
ShowToastDialog.showToast("Please enter receiver name".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (receiverMobileController.value.text.isEmpty) {
|
} else if (receiverMobileController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter receiver mobile".tr);
|
ShowToastDialog.showToast("Please enter receiver mobile".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (receiverLocationController.value.text.isEmpty) {
|
} else if (receiverLocationController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter receiver address".tr);
|
ShowToastDialog.showToast("Please enter receiver address".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (isScheduled.value) {
|
} else if (isScheduled.value) {
|
||||||
if (scheduledDate.value.isEmpty) {
|
if (scheduledDate.value.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please select scheduled date".tr);
|
ShowToastDialog.showToast("Please select scheduled date".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (scheduledTime.value.isEmpty) {
|
} else if (scheduledTime.value.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please select scheduled time".tr);
|
ShowToastDialog.showToast("Please select scheduled time".tr());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedWeight == null) {
|
if (selectedWeight == null) {
|
||||||
ShowToastDialog.showToast("Please select parcel weight".tr);
|
ShowToastDialog.showToast("Please select parcel weight".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (senderLocation.value == null || receiverLocation.value == null) {
|
} else if (senderLocation.value == null || receiverLocation.value == null) {
|
||||||
ShowToastDialog.showToast("Please select both sender and receiver locations".tr);
|
ShowToastDialog.showToast("Please select both sender and receiver locations".tr());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -203,14 +204,14 @@ class BookParcelController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (distance.value < 0.5) {
|
if (distance.value < 0.5) {
|
||||||
ShowToastDialog.showToast("Sender's location to receiver's location should be more than 1 km.".tr);
|
ShowToastDialog.showToast("Sender's location to receiver's location should be more than 1 km.".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
subTotal.value = (distance.value * double.parse(selectedWeight!.deliveryCharge.toString()));
|
subTotal.value = (distance.value * double.parse(selectedWeight!.deliveryCharge.toString()));
|
||||||
goToCart();
|
goToCart();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.showToast("Something went wrong while booking.".tr);
|
ShowToastDialog.showToast("Something went wrong while booking.".tr());
|
||||||
debugPrint("bookNow error: $e");
|
debugPrint("bookNow error: $e");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import 'package:customer/payment/xenditScreen.dart';
|
|||||||
import 'package:customer/service/fire_store_utils.dart';
|
import 'package:customer/service/fire_store_utils.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
import 'package:customer/utils/preferences.dart';
|
import 'package:customer/utils/preferences.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
@@ -304,20 +305,20 @@ class CabBookingController extends GetxController {
|
|||||||
Marker(
|
Marker(
|
||||||
markerId: const MarkerId("pickup"),
|
markerId: const MarkerId("pickup"),
|
||||||
position: LatLng(pickupLat, pickupLng),
|
position: LatLng(pickupLat, pickupLng),
|
||||||
infoWindow: InfoWindow(title: "Pickup Location".tr),
|
infoWindow: InfoWindow(title: "Pickup Location".tr()),
|
||||||
icon: departureIcon ?? BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueGreen),
|
icon: departureIcon ?? BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueGreen),
|
||||||
),
|
),
|
||||||
Marker(markerId: const MarkerId("driver"), position: LatLng(driverLat, driverLng), infoWindow: InfoWindow(title: "Driver at Pickup".tr), icon: taxiIcon ?? BitmapDescriptor.defaultMarker),
|
Marker(markerId: const MarkerId("driver"), position: LatLng(driverLat, driverLng), infoWindow: InfoWindow(title: "Driver at Pickup".tr()), icon: taxiIcon ?? BitmapDescriptor.defaultMarker),
|
||||||
]);
|
]);
|
||||||
} else if (order.status == Constant.orderInTransit) {
|
} else if (order.status == Constant.orderInTransit) {
|
||||||
markers.addAll([
|
markers.addAll([
|
||||||
Marker(
|
Marker(
|
||||||
markerId: const MarkerId("destination"),
|
markerId: const MarkerId("destination"),
|
||||||
position: LatLng(destLat, destLng),
|
position: LatLng(destLat, destLng),
|
||||||
infoWindow: InfoWindow(title: "Destination Location".tr),
|
infoWindow: InfoWindow(title: "Destination Location".tr()),
|
||||||
icon: destinationIcon ?? BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueRed),
|
icon: destinationIcon ?? BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueRed),
|
||||||
),
|
),
|
||||||
Marker(markerId: const MarkerId("driver"), position: LatLng(driverLat, driverLng), infoWindow: InfoWindow(title: "Driver Location".tr), icon: taxiIcon ?? BitmapDescriptor.defaultMarker),
|
Marker(markerId: const MarkerId("driver"), position: LatLng(driverLat, driverLng), infoWindow: InfoWindow(title: "Driver Location".tr()), icon: taxiIcon ?? BitmapDescriptor.defaultMarker),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -403,7 +404,7 @@ class CabBookingController extends GetxController {
|
|||||||
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
||||||
currentOrder.value.paymentMethod = selectedPaymentMethod.value;
|
currentOrder.value.paymentMethod = selectedPaymentMethod.value;
|
||||||
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment method changed".tr);
|
ShowToastDialog.showToast("Payment method changed".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
@@ -437,7 +438,7 @@ class CabBookingController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -539,7 +540,7 @@ class CabBookingController extends GetxController {
|
|||||||
final markerId = MarkerId('Stop $index');
|
final markerId = MarkerId('Stop $index');
|
||||||
|
|
||||||
markers.removeWhere((marker) => marker.markerId == markerId);
|
markers.removeWhere((marker) => marker.markerId == markerId);
|
||||||
markers.add(Marker(markerId: markerId, infoWindow: InfoWindow(title: '${'Stop'.tr} ${String.fromCharCode(index + 65)}'), position: LatLng(lat, lng), icon: stopIcon!));
|
markers.add(Marker(markerId: markerId, infoWindow: InfoWindow(title: '${'Stop'.tr()} ${String.fromCharCode(index + 65)}'), position: LatLng(lat, lng), icon: stopIcon!));
|
||||||
|
|
||||||
getDirections();
|
getDirections();
|
||||||
}
|
}
|
||||||
@@ -563,7 +564,7 @@ class CabBookingController extends GetxController {
|
|||||||
final LatLng pos = LatLng(lat, lng);
|
final LatLng pos = LatLng(lat, lng);
|
||||||
final markerId = MarkerId(isDeparture ? 'Departure' : 'Destination');
|
final markerId = MarkerId(isDeparture ? 'Departure' : 'Destination');
|
||||||
final icon = isDeparture ? departureIcon! : destinationIcon!;
|
final icon = isDeparture ? departureIcon! : destinationIcon!;
|
||||||
final title = isDeparture ? 'Departure'.tr : 'Destination'.tr;
|
final title = isDeparture ? 'Departure'.tr() : 'Destination'.tr();
|
||||||
|
|
||||||
if (isDeparture) {
|
if (isDeparture) {
|
||||||
departureLatLong.value = pos;
|
departureLatLong.value = pos;
|
||||||
@@ -1022,7 +1023,7 @@ class CabBookingController extends GetxController {
|
|||||||
log("stripe Responce====>$paymentIntentData");
|
log("stripe Responce====>$paymentIntentData");
|
||||||
if (paymentIntentData!.containsKey("error")) {
|
if (paymentIntentData!.containsKey("error")) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
await Stripe.instance.initPaymentSheet(
|
await Stripe.instance.initPaymentSheet(
|
||||||
paymentSheetParameters: SetupPaymentSheetParameters(
|
paymentSheetParameters: SetupPaymentSheetParameters(
|
||||||
@@ -1046,7 +1047,7 @@ class CabBookingController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -1112,10 +1113,10 @@ class CabBookingController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -1147,15 +1148,15 @@ class CabBookingController extends GetxController {
|
|||||||
note: "Contact us for any questions on your order.",
|
note: "Contact us for any questions on your order.",
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
completeOrder();
|
completeOrder();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1179,14 +1180,14 @@ class CabBookingController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1216,10 +1217,10 @@ class CabBookingController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -1247,11 +1248,11 @@ class CabBookingController extends GetxController {
|
|||||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1356,7 +1357,7 @@ class CabBookingController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
return GetPaymentTxtTokenModel.fromJson(data);
|
return GetPaymentTxtTokenModel.fromJson(data);
|
||||||
}
|
}
|
||||||
@@ -1389,18 +1390,18 @@ class CabBookingController extends GetxController {
|
|||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
||||||
@@ -1415,10 +1416,10 @@ class CabBookingController extends GetxController {
|
|||||||
if (url != '') {
|
if (url != '') {
|
||||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1443,7 +1444,7 @@ class CabBookingController extends GetxController {
|
|||||||
final responseData = jsonDecode(response.body);
|
final responseData = jsonDecode(response.body);
|
||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1468,13 +1469,13 @@ class CabBookingController extends GetxController {
|
|||||||
if (paymentURL.toString() != '') {
|
if (paymentURL.toString() != '') {
|
||||||
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
();
|
();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1497,7 +1498,7 @@ class CabBookingController extends GetxController {
|
|||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1534,7 +1535,7 @@ class CabBookingController extends GetxController {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1553,11 +1554,11 @@ class CabBookingController extends GetxController {
|
|||||||
if (model.id != null) {
|
if (model.id != null) {
|
||||||
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
();
|
();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:customer/models/cab_order_model.dart';
|
import 'package:customer/models/cab_order_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../constant/collection_name.dart';
|
import '../constant/collection_name.dart';
|
||||||
@@ -67,11 +68,11 @@ class CabReviewController extends GetxController {
|
|||||||
/// Save / update review
|
/// Save / update review
|
||||||
Future<void> submitReview() async {
|
Future<void> submitReview() async {
|
||||||
if (comment.value.text.trim().isEmpty || ratings.value == 0) {
|
if (comment.value.text.trim().isEmpty || ratings.value == 0) {
|
||||||
ShowToastDialog.showToast("Please provide rating and comment".tr);
|
ShowToastDialog.showToast("Please provide rating and comment".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowToastDialog.showLoader("Submit in...".tr);
|
ShowToastDialog.showLoader("Submit in...".tr());
|
||||||
|
|
||||||
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');
|
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:customer/models/user_model.dart';
|
|||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/utils/preferences.dart';
|
import 'package:customer/utils/preferences.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||||
@@ -327,7 +328,7 @@ class CartController extends GetxController {
|
|||||||
if (double.parse(userModel.value.walletAmount.toString()) >= totalAmount.value) {
|
if (double.parse(userModel.value.walletAmount.toString()) >= totalAmount.value) {
|
||||||
setOrder();
|
setOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("You don't have sufficient wallet balance to place order".tr);
|
ShowToastDialog.showToast("You don't have sufficient wallet balance to place order".tr());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setOrder();
|
setOrder();
|
||||||
@@ -335,13 +336,13 @@ class CartController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setOrder() async {
|
Future<void> setOrder() async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
if ((Constant.isSubscriptionModelApplied == true || Constant.sectionConstantModel?.adminCommision?.isEnabled == true) && vendorModel.value.subscriptionPlan != null) {
|
if ((Constant.isSubscriptionModelApplied == true || Constant.sectionConstantModel?.adminCommision?.isEnabled == true) && vendorModel.value.subscriptionPlan != null) {
|
||||||
await FireStoreUtils.getVendorById(vendorModel.value.id!).then((vender) async {
|
await FireStoreUtils.getVendorById(vendorModel.value.id!).then((vender) async {
|
||||||
if (vender?.subscriptionTotalOrders == '0' || vender?.subscriptionTotalOrders == null) {
|
if (vender?.subscriptionTotalOrders == '0' || vender?.subscriptionTotalOrders == null) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("This vendor has reached their maximum order capacity. Please select a different vendor or try again later.".tr);
|
ShowToastDialog.showToast("This vendor has reached their maximum order capacity. Please select a different vendor or try again later.".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -402,8 +403,8 @@ class CartController extends GetxController {
|
|||||||
userId: FireStoreUtils.getCurrentUid(),
|
userId: FireStoreUtils.getCurrentUid(),
|
||||||
isTopup: false,
|
isTopup: false,
|
||||||
orderId: orderModel.id,
|
orderId: orderModel.id,
|
||||||
note: "Order Amount debited".tr,
|
note: "Order Amount debited".tr(),
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
);
|
);
|
||||||
|
|
||||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
||||||
@@ -540,7 +541,7 @@ class CartController extends GetxController {
|
|||||||
log("stripe Responce====>$paymentIntentData");
|
log("stripe Responce====>$paymentIntentData");
|
||||||
if (paymentIntentData!.containsKey("error")) {
|
if (paymentIntentData!.containsKey("error")) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
await Stripe.instance.initPaymentSheet(
|
await Stripe.instance.initPaymentSheet(
|
||||||
paymentSheetParameters: SetupPaymentSheetParameters(
|
paymentSheetParameters: SetupPaymentSheetParameters(
|
||||||
@@ -564,7 +565,7 @@ class CartController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -630,10 +631,10 @@ class CartController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -665,15 +666,15 @@ class CartController extends GetxController {
|
|||||||
note: "Contact us for any questions on your order.",
|
note: "Contact us for any questions on your order.",
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
placeOrder();
|
placeOrder();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -697,14 +698,14 @@ class CartController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -734,10 +735,10 @@ class CartController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -765,11 +766,11 @@ class CartController extends GetxController {
|
|||||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -874,7 +875,7 @@ class CartController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
return GetPaymentTxtTokenModel.fromJson(data);
|
return GetPaymentTxtTokenModel.fromJson(data);
|
||||||
}
|
}
|
||||||
@@ -906,18 +907,18 @@ class CartController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
||||||
@@ -932,10 +933,10 @@ class CartController extends GetxController {
|
|||||||
if (url != '') {
|
if (url != '') {
|
||||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -960,7 +961,7 @@ class CartController extends GetxController {
|
|||||||
final responseData = jsonDecode(response.body);
|
final responseData = jsonDecode(response.body);
|
||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -985,13 +986,13 @@ class CartController extends GetxController {
|
|||||||
if (paymentURL.toString() != '') {
|
if (paymentURL.toString() != '') {
|
||||||
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
();
|
();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1014,7 +1015,7 @@ class CartController extends GetxController {
|
|||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1051,7 +1052,7 @@ class CartController extends GetxController {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1070,11 +1071,11 @@ class CartController extends GetxController {
|
|||||||
if (model.id != null) {
|
if (model.id != null) {
|
||||||
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
();
|
();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
import '../models/conversation_model.dart';
|
import '../models/conversation_model.dart';
|
||||||
@@ -93,11 +94,11 @@ class ChatController extends GetxController {
|
|||||||
|
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
if (url.mime.contains('image')) {
|
if (url.mime.contains('image')) {
|
||||||
conversationModel.message = "sent a message".tr;
|
conversationModel.message = "sent a message".tr();
|
||||||
} else if (url.mime.contains('video')) {
|
} else if (url.mime.contains('video')) {
|
||||||
conversationModel.message = "Sent a video".tr;
|
conversationModel.message = "Sent a video".tr();
|
||||||
} else if (url.mime.contains('audio')) {
|
} else if (url.mime.contains('audio')) {
|
||||||
conversationModel.message = "Sent a audio".tr;
|
conversationModel.message = "Sent a audio".tr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +137,7 @@ class ChatController extends GetxController {
|
|||||||
// sendMessage('', url, '', 'image');
|
// sendMessage('', url, '', 'image');
|
||||||
// Get.back();
|
// Get.back();
|
||||||
// } on PlatformException catch (e) {
|
// } on PlatformException catch (e) {
|
||||||
// ShowToastDialog.showToast("${"failed_to_pick".tr} : \n $e");
|
// ShowToastDialog.showToast("${"failed_to_pick".tr()} : \n $e");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../models/cab_order_model.dart';
|
import '../models/cab_order_model.dart';
|
||||||
@@ -21,7 +22,7 @@ class ComplainController extends GetxController {
|
|||||||
order.value = args['order'] as CabOrderModel;
|
order.value = args['order'] as CabOrderModel;
|
||||||
getComplain();
|
getComplain();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Order data not found".tr);
|
ShowToastDialog.showToast("Order data not found".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,7 +36,7 @@ class ComplainController extends GetxController {
|
|||||||
comment.value.text = data['description'] ?? '';
|
comment.value.text = data['description'] ?? '';
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.showToast("Failed to load complaint".tr);
|
ShowToastDialog.showToast("Failed to load complaint".tr());
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -44,12 +45,12 @@ class ComplainController extends GetxController {
|
|||||||
Future<void> submitComplain() async {
|
Future<void> submitComplain() async {
|
||||||
// Validation
|
// Validation
|
||||||
if (title.value.text.trim().isEmpty) {
|
if (title.value.text.trim().isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter complaint title".tr);
|
ShowToastDialog.showToast("Please enter complaint title".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comment.value.text.trim().isEmpty) {
|
if (comment.value.text.trim().isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter complaint description".tr);
|
ShowToastDialog.showToast("Please enter complaint description".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,15 +73,15 @@ class ComplainController extends GetxController {
|
|||||||
);
|
);
|
||||||
|
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Your complaint has been submitted to admin".tr);
|
ShowToastDialog.showToast("Your complaint has been submitted to admin".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Your complaint is already submitted".tr);
|
ShowToastDialog.showToast("Your complaint is already submitted".tr());
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Something went wrong, please try again".tr);
|
ShowToastDialog.showToast("Something went wrong, please try again".tr());
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:customer/constant/constant.dart';
|
|||||||
import 'package:customer/models/dine_in_booking_model.dart';
|
import 'package:customer/models/dine_in_booking_model.dart';
|
||||||
import 'package:customer/models/favourite_model.dart';
|
import 'package:customer/models/favourite_model.dart';
|
||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../screen_ui/multi_vendor_service/dine_in_booking/dine_in_booking_screen.dart';
|
import '../screen_ui/multi_vendor_service/dine_in_booking/dine_in_booking_screen.dart';
|
||||||
import '../service/fire_store_utils.dart';
|
import '../service/fire_store_utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -34,9 +35,9 @@ class DineInRestaurantDetailsController extends GetxController {
|
|||||||
String getLocalizedOccasion(String key) {
|
String getLocalizedOccasion(String key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "Birthday":
|
case "Birthday":
|
||||||
return "Birthday".tr;
|
return "Birthday".tr();
|
||||||
case "Anniversary":
|
case "Anniversary":
|
||||||
return "Anniversary".tr;
|
return "Anniversary".tr();
|
||||||
default:
|
default:
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
@@ -61,7 +62,7 @@ class DineInRestaurantDetailsController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> orderBook() async {
|
Future<void> orderBook() async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
DateTime dt = selectedDate.value.toDate();
|
DateTime dt = selectedDate.value.toDate();
|
||||||
String hour = DateFormat("kk:mm").format(DateFormat('hh:mm a').parse((Intl.getCurrentLocale() == "en_US") ? selectedTimeSlot.value : selectedTimeSlot.value.toLowerCase()));
|
String hour = DateFormat("kk:mm").format(DateFormat('hh:mm a').parse((Intl.getCurrentLocale() == "en_US") ? selectedTimeSlot.value : selectedTimeSlot.value.toLowerCase()));
|
||||||
@@ -91,7 +92,7 @@ class DineInRestaurantDetailsController extends GetxController {
|
|||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.to(const DineInBookingScreen());
|
Get.to(const DineInBookingScreen());
|
||||||
ShowToastDialog.showToast('Dine-In Request submitted successfully.'.tr);
|
ShowToastDialog.showToast('Dine-In Request submitted successfully.'.tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void getRecord() {
|
void getRecord() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/models/user_model.dart';
|
import 'package:customer/models/user_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../service/fire_store_utils.dart';
|
import '../service/fire_store_utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -42,7 +43,7 @@ class EditProfileController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> saveData() async {
|
Future<void> saveData() async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
if (Constant().hasValidUrl(profileImage.value) == false && profileImage.value.isNotEmpty) {
|
if (Constant().hasValidUrl(profileImage.value) == false && profileImage.value.isNotEmpty) {
|
||||||
profileImage.value = await Constant.uploadUserImageToFireStorage(
|
profileImage.value = await Constant.uploadUserImageToFireStorage(
|
||||||
File(profileImage.value),
|
File(profileImage.value),
|
||||||
@@ -71,7 +72,7 @@ class EditProfileController extends GetxController {
|
|||||||
Get.back();
|
Get.back();
|
||||||
profileImage.value = image.path;
|
profileImage.value = image.path;
|
||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
ShowToastDialog.showToast("${"failed_to_pick".tr} : \n $e");
|
ShowToastDialog.showToast("${"failed_to_pick".tr()} : \n $e");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:customer/service/fire_store_utils.dart';
|
import 'package:customer/service/fire_store_utils.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -69,13 +70,13 @@ class EnterManuallyLocationController extends GetxController {
|
|||||||
String getLocalizedSaveAs(String key) {
|
String getLocalizedSaveAs(String key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'Home':
|
case 'Home':
|
||||||
return 'Home'.tr;
|
return 'Home'.tr();
|
||||||
case 'Work':
|
case 'Work':
|
||||||
return 'Work'.tr;
|
return 'Work'.tr();
|
||||||
case 'Hotel':
|
case 'Hotel':
|
||||||
return 'Hotel'.tr;
|
return 'Hotel'.tr();
|
||||||
case 'Other':
|
case 'Other':
|
||||||
return 'Other'.tr;
|
return 'Other'.tr();
|
||||||
default:
|
default:
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import 'package:customer/models/favourite_model.dart';
|
|||||||
import 'package:customer/models/vendor_category_model.dart';
|
import 'package:customer/models/vendor_category_model.dart';
|
||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
import 'package:customer/utils/preferences.dart';
|
import 'package:customer/utils/preferences.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
@@ -32,7 +33,7 @@ class FoodHomeController extends GetxController {
|
|||||||
RxBool isLoading = true.obs;
|
RxBool isLoading = true.obs;
|
||||||
RxBool isListView = true.obs;
|
RxBool isListView = true.obs;
|
||||||
RxBool isPopular = true.obs;
|
RxBool isPopular = true.obs;
|
||||||
RxString selectedOrderTypeValue = "Delivery".tr.obs;
|
RxString selectedOrderTypeValue = "Delivery".tr().obs;
|
||||||
|
|
||||||
Rx<PageController> pageController = PageController(viewportFraction: 0.877).obs;
|
Rx<PageController> pageController = PageController(viewportFraction: 0.877).obs;
|
||||||
Rx<PageController> pageBottomController = PageController(viewportFraction: 0.877).obs;
|
Rx<PageController> pageBottomController = PageController(viewportFraction: 0.877).obs;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart';
|
import 'package:firebase_auth/firebase_auth.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -11,17 +12,17 @@ class ForgotPasswordController extends GetxController {
|
|||||||
final email = emailEditingController.value.text.trim();
|
final email = emailEditingController.value.text.trim();
|
||||||
|
|
||||||
if (email.isEmpty) {
|
if (email.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter your email address.".tr);
|
ShowToastDialog.showToast("Please enter your email address.".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetUtils.isEmail(email)) {
|
if (!GetUtils.isEmail(email)) {
|
||||||
ShowToastDialog.showToast("Please enter a valid email address.".tr);
|
ShowToastDialog.showToast("Please enter a valid email address.".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
await FirebaseAuth.instance.sendPasswordResetEmail(email: email);
|
await FirebaseAuth.instance.sendPasswordResetEmail(email: email);
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast(
|
ShowToastDialog.showToast(
|
||||||
@@ -31,9 +32,9 @@ class ForgotPasswordController extends GetxController {
|
|||||||
} on FirebaseAuthException catch (e) {
|
} on FirebaseAuthException catch (e) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
if (e.code == 'user-not-found') {
|
if (e.code == 'user-not-found') {
|
||||||
ShowToastDialog.showToast('No user found for that email.'.tr);
|
ShowToastDialog.showToast('No user found for that email.'.tr());
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast(e.message?.tr ?? "something_went_wrong".tr);
|
ShowToastDialog.showToast(e.message?.tr() ?? "something_went_wrong".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
|
|||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/models/gift_cards_model.dart';
|
import 'package:customer/models/gift_cards_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||||
import 'package:razorpay_flutter/razorpay_flutter.dart';
|
import 'package:razorpay_flutter/razorpay_flutter.dart';
|
||||||
@@ -95,7 +96,7 @@ class GiftCardController extends GetxController {
|
|||||||
if (double.parse(userModel.value.walletAmount.toString()) >= double.parse(amountController.value.text)) {
|
if (double.parse(userModel.value.walletAmount.toString()) >= double.parse(amountController.value.text)) {
|
||||||
setOrder();
|
setOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("You don't have sufficient wallet balance to purchase gift card".tr);
|
ShowToastDialog.showToast("You don't have sufficient wallet balance to purchase gift card".tr());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setOrder();
|
setOrder();
|
||||||
@@ -103,7 +104,7 @@ class GiftCardController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setOrder() async {
|
Future<void> setOrder() async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
GiftCardsOrderModel giftCardsOrderModel = GiftCardsOrderModel();
|
GiftCardsOrderModel giftCardsOrderModel = GiftCardsOrderModel();
|
||||||
giftCardsOrderModel.id = const Uuid().v4();
|
giftCardsOrderModel.id = const Uuid().v4();
|
||||||
giftCardsOrderModel.giftId = selectedGiftCard.value.id.toString();
|
giftCardsOrderModel.giftId = selectedGiftCard.value.id.toString();
|
||||||
@@ -129,8 +130,8 @@ class GiftCardController extends GetxController {
|
|||||||
userId: FireStoreUtils.getCurrentUid(),
|
userId: FireStoreUtils.getCurrentUid(),
|
||||||
isTopup: false,
|
isTopup: false,
|
||||||
orderId: giftCardsOrderModel.id,
|
orderId: giftCardsOrderModel.id,
|
||||||
note: "Gift card purchase amount debited".tr,
|
note: "Gift card purchase amount debited".tr(),
|
||||||
paymentStatus: "success".tr);
|
paymentStatus: "success".tr());
|
||||||
|
|
||||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
@@ -141,7 +142,7 @@ class GiftCardController extends GetxController {
|
|||||||
await FireStoreUtils.placeGiftCardOrder(giftCardsOrderModel);
|
await FireStoreUtils.placeGiftCardOrder(giftCardsOrderModel);
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
Get.off(const HistoryGiftCard());
|
Get.off(const HistoryGiftCard());
|
||||||
ShowToastDialog.showToast("Gift card Purchases successfully".tr);
|
ShowToastDialog.showToast("Gift card Purchases successfully".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
String generateGiftCode() {
|
String generateGiftCode() {
|
||||||
@@ -328,7 +329,7 @@ class GiftCardController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -401,10 +402,10 @@ class GiftCardController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -429,14 +430,14 @@ class GiftCardController extends GetxController {
|
|||||||
))!
|
))!
|
||||||
.then((value) {
|
.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -472,10 +473,10 @@ class GiftCardController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -503,11 +504,11 @@ class GiftCardController extends GetxController {
|
|||||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -534,15 +535,15 @@ class GiftCardController extends GetxController {
|
|||||||
note: "Contact us for any questions on your order.",
|
note: "Contact us for any questions on your order.",
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
placeOrder();
|
placeOrder();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -654,7 +655,7 @@ class GiftCardController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
return GetPaymentTxtTokenModel.fromJson(data);
|
return GetPaymentTxtTokenModel.fromJson(data);
|
||||||
}
|
}
|
||||||
@@ -690,18 +691,18 @@ class GiftCardController extends GetxController {
|
|||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Midtrans payment
|
//Midtrans payment
|
||||||
@@ -714,10 +715,10 @@ class GiftCardController extends GetxController {
|
|||||||
))!
|
))!
|
||||||
.then((value) {
|
.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -749,7 +750,7 @@ class GiftCardController extends GetxController {
|
|||||||
final responseData = jsonDecode(response.body);
|
final responseData = jsonDecode(response.body);
|
||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -782,13 +783,13 @@ class GiftCardController extends GetxController {
|
|||||||
))!
|
))!
|
||||||
.then((value) {
|
.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
();
|
();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -815,7 +816,7 @@ class GiftCardController extends GetxController {
|
|||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -853,7 +854,7 @@ class GiftCardController extends GetxController {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -877,11 +878,11 @@ class GiftCardController extends GetxController {
|
|||||||
))!
|
))!
|
||||||
.then((value) {
|
.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
();
|
();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/models/gift_cards_order_model.dart';
|
import 'package:customer/models/gift_cards_order_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import '../service/fire_store_utils.dart';
|
import '../service/fire_store_utils.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -32,7 +33,7 @@ class HistoryGiftCardController extends GetxController {
|
|||||||
|
|
||||||
Future<void> share(String giftCode, String giftPin, String msg, String amount, Timestamp date) async {
|
Future<void> share(String giftCode, String giftPin, String msg, String amount, Timestamp date) async {
|
||||||
await Share.share(
|
await Share.share(
|
||||||
"${'Gift Code :'.tr} $giftCode\n${'Gift Pin :'.tr} $giftPin\n${'Price :'.tr} ${Constant.amountShow(amount: amount)}\n${'Expire Date :'.tr} ${date.toDate()}\n\n${'Message'.tr} : $msg",
|
"${'Gift Code :'.tr()} $giftCode\n${'Gift Pin :'.tr()} $giftPin\n${'Price :'.tr()} ${Constant.amountShow(amount: amount)}\n${'Expire Date :'.tr()} ${date.toDate()}\n\n${'Message'.tr()} : $msg",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
|
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart';
|
import 'package:firebase_auth/firebase_auth.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -32,18 +33,18 @@ class LoginController extends GetxController {
|
|||||||
final email = emailController.value.text.trim();
|
final email = emailController.value.text.trim();
|
||||||
final password = passwordController.value.text.trim();
|
final password = passwordController.value.text.trim();
|
||||||
if (email.isEmpty || !email.contains('@')) {
|
if (email.isEmpty || !email.contains('@')) {
|
||||||
ShowToastDialog.showToast("Please enter a valid email address".tr);
|
ShowToastDialog.showToast("Please enter a valid email address".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (password.isEmpty) {
|
if (password.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter your password".tr);
|
ShowToastDialog.showToast("Please enter your password".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
ShowToastDialog.showLoader("Logging in...".tr);
|
ShowToastDialog.showLoader("Logging in...".tr());
|
||||||
|
|
||||||
final credential = await FirebaseAuth.instance.signInWithEmailAndPassword(email: email, password: password);
|
final credential = await FirebaseAuth.instance.signInWithEmailAndPassword(email: email, password: password);
|
||||||
|
|
||||||
@@ -68,23 +69,23 @@ class LoginController extends GetxController {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await FirebaseAuth.instance.signOut();
|
await FirebaseAuth.instance.signOut();
|
||||||
ShowToastDialog.showToast("This user is disabled. Please contact admin.".tr);
|
ShowToastDialog.showToast("This user is disabled. Please contact admin.".tr());
|
||||||
Get.offAll(() => const LoginScreen());
|
Get.offAll(() => const LoginScreen());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await FirebaseAuth.instance.signOut();
|
await FirebaseAuth.instance.signOut();
|
||||||
ShowToastDialog.showToast("This user does not exist in the customer app.".tr);
|
ShowToastDialog.showToast("This user does not exist in the customer app.".tr());
|
||||||
Get.offAll(() => const LoginScreen());
|
Get.offAll(() => const LoginScreen());
|
||||||
}
|
}
|
||||||
} on FirebaseAuthException catch (e) {
|
} on FirebaseAuthException catch (e) {
|
||||||
if (e.code == 'user-not-found') {
|
if (e.code == 'user-not-found') {
|
||||||
ShowToastDialog.showToast("No user found for that email.".tr);
|
ShowToastDialog.showToast("No user found for that email.".tr());
|
||||||
} else if (e.code == 'wrong-password') {
|
} else if (e.code == 'wrong-password') {
|
||||||
ShowToastDialog.showToast("Wrong password provided.".tr);
|
ShowToastDialog.showToast("Wrong password provided.".tr());
|
||||||
} else if (e.code == 'invalid-email') {
|
} else if (e.code == 'invalid-email') {
|
||||||
ShowToastDialog.showToast("Invalid email.".tr);
|
ShowToastDialog.showToast("Invalid email.".tr());
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast(e.message?.tr ?? "Login failed. Please try again.".tr);
|
ShowToastDialog.showToast(e.message?.tr() ?? "Login failed. Please try again.".tr());
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
@@ -93,7 +94,7 @@ class LoginController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> loginWithGoogle() async {
|
Future<void> loginWithGoogle() async {
|
||||||
ShowToastDialog.showLoader("please wait...".tr);
|
ShowToastDialog.showLoader("please wait...".tr());
|
||||||
await signInWithGoogle().then((value) async {
|
await signInWithGoogle().then((value) async {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
@@ -131,12 +132,12 @@ class LoginController extends GetxController {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await FirebaseAuth.instance.signOut();
|
await FirebaseAuth.instance.signOut();
|
||||||
ShowToastDialog.showToast("This user is disabled. Please contact admin.".tr);
|
ShowToastDialog.showToast("This user is disabled. Please contact admin.".tr());
|
||||||
Get.offAll(() => const LoginScreen());
|
Get.offAll(() => const LoginScreen());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await FirebaseAuth.instance.signOut();
|
await FirebaseAuth.instance.signOut();
|
||||||
ShowToastDialog.showToast("This user does not exist in the customer app.".tr);
|
ShowToastDialog.showToast("This user does not exist in the customer app.".tr());
|
||||||
Get.offAll(() => const LoginScreen());
|
Get.offAll(() => const LoginScreen());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -156,7 +157,7 @@ class LoginController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> loginWithApple() async {
|
Future<void> loginWithApple() async {
|
||||||
ShowToastDialog.showLoader("please wait...".tr);
|
ShowToastDialog.showLoader("please wait...".tr());
|
||||||
await signInWithApple().then((value) async {
|
await signInWithApple().then((value) async {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
@@ -197,12 +198,12 @@ class LoginController extends GetxController {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await FirebaseAuth.instance.signOut();
|
await FirebaseAuth.instance.signOut();
|
||||||
ShowToastDialog.showToast("This user is disabled. Please contact admin.".tr);
|
ShowToastDialog.showToast("This user is disabled. Please contact admin.".tr());
|
||||||
Get.offAll(() => const LoginScreen());
|
Get.offAll(() => const LoginScreen());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await FirebaseAuth.instance.signOut();
|
await FirebaseAuth.instance.signOut();
|
||||||
ShowToastDialog.showToast("This user does not exist in the customer app.".tr);
|
ShowToastDialog.showToast("This user does not exist in the customer app.".tr());
|
||||||
Get.offAll(() => const LoginScreen());
|
Get.offAll(() => const LoginScreen());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart';
|
import 'package:firebase_auth/firebase_auth.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -18,12 +19,12 @@ class MobileLoginController extends GetxController {
|
|||||||
final countryCode = countryCodeController.value.text.trim();
|
final countryCode = countryCodeController.value.text.trim();
|
||||||
|
|
||||||
if (mobile.isEmpty || mobile.length != 10) {
|
if (mobile.isEmpty || mobile.length != 10) {
|
||||||
ShowToastDialog.showToast("Please enter a valid 10-digit mobile number".tr);
|
ShowToastDialog.showToast("Please enter a valid 10-digit mobile number".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ShowToastDialog.showLoader("Sending OTP...".tr);
|
ShowToastDialog.showLoader("Sending OTP...".tr());
|
||||||
|
|
||||||
await _auth.verifyPhoneNumber(
|
await _auth.verifyPhoneNumber(
|
||||||
phoneNumber: '$countryCode$mobile',
|
phoneNumber: '$countryCode$mobile',
|
||||||
@@ -33,9 +34,9 @@ class MobileLoginController extends GetxController {
|
|||||||
verificationFailed: (FirebaseAuthException e) {
|
verificationFailed: (FirebaseAuthException e) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
if (e.code == 'invalid-phone-number') {
|
if (e.code == 'invalid-phone-number') {
|
||||||
ShowToastDialog.showToast("Invalid phone number".tr);
|
ShowToastDialog.showToast("Invalid phone number".tr());
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast(e.message ?? "OTP verification failed".tr);
|
ShowToastDialog.showToast(e.message ?? "OTP verification failed".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
codeSent: (String verificationId, int? resendToken) {
|
codeSent: (String verificationId, int? resendToken) {
|
||||||
@@ -44,13 +45,13 @@ class MobileLoginController extends GetxController {
|
|||||||
},
|
},
|
||||||
codeAutoRetrievalTimeout: (String verificationId) {
|
codeAutoRetrievalTimeout: (String verificationId) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("OTP timed out. Please try again.".tr);
|
ShowToastDialog.showToast("OTP timed out. Please try again.".tr());
|
||||||
// Optional: Handle timeout
|
// Optional: Handle timeout
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Something went wrong. Please try again.".tr);
|
ShowToastDialog.showToast("Something went wrong. Please try again.".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import 'package:customer/payment/xenditScreen.dart';
|
|||||||
import 'package:customer/service/fire_store_utils.dart';
|
import 'package:customer/service/fire_store_utils.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
import 'package:customer/utils/preferences.dart';
|
import 'package:customer/utils/preferences.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart';
|
import 'package:firebase_auth/firebase_auth.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
@@ -112,13 +113,13 @@ class MyCabBookingController extends GetxController {
|
|||||||
String getLocalizedTabTitle(String tabKey) {
|
String getLocalizedTabTitle(String tabKey) {
|
||||||
switch (tabKey) {
|
switch (tabKey) {
|
||||||
case "New":
|
case "New":
|
||||||
return "New".tr;
|
return "New".tr();
|
||||||
case "On Going":
|
case "On Going":
|
||||||
return "On Going".tr;
|
return "On Going".tr();
|
||||||
case "Completed":
|
case "Completed":
|
||||||
return "Completed".tr;
|
return "Completed".tr();
|
||||||
case "Cancelled":
|
case "Cancelled":
|
||||||
return "Cancelled".tr;
|
return "Cancelled".tr();
|
||||||
default:
|
default:
|
||||||
return tabKey;
|
return tabKey;
|
||||||
}
|
}
|
||||||
@@ -185,7 +186,7 @@ class MyCabBookingController extends GetxController {
|
|||||||
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
||||||
selectedOrder.value.paymentMethod = selectedPaymentMethod.value;
|
selectedOrder.value.paymentMethod = selectedPaymentMethod.value;
|
||||||
await FireStoreUtils.cabOrderPlace(selectedOrder.value).then((value) {
|
await FireStoreUtils.cabOrderPlace(selectedOrder.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment method changed".tr);
|
ShowToastDialog.showToast("Payment method changed".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -203,8 +204,8 @@ class MyCabBookingController extends GetxController {
|
|||||||
userId: FireStoreUtils.getCurrentUid(),
|
userId: FireStoreUtils.getCurrentUid(),
|
||||||
isTopup: false,
|
isTopup: false,
|
||||||
orderId: selectedOrder.value.id,
|
orderId: selectedOrder.value.id,
|
||||||
note: "Cab Amount debited".tr,
|
note: "Cab Amount debited".tr(),
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
serviceType: Constant.parcelServiceType,
|
serviceType: Constant.parcelServiceType,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -214,7 +215,7 @@ class MyCabBookingController extends GetxController {
|
|||||||
}
|
}
|
||||||
selectedOrder.value.paymentStatus = true;
|
selectedOrder.value.paymentStatus = true;
|
||||||
await FireStoreUtils.cabOrderPlace(selectedOrder.value).then((value) {
|
await FireStoreUtils.cabOrderPlace(selectedOrder.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -280,7 +281,7 @@ class MyCabBookingController extends GetxController {
|
|||||||
log("stripe Responce====>$paymentIntentData");
|
log("stripe Responce====>$paymentIntentData");
|
||||||
if (paymentIntentData!.containsKey("error")) {
|
if (paymentIntentData!.containsKey("error")) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
await Stripe.instance.initPaymentSheet(
|
await Stripe.instance.initPaymentSheet(
|
||||||
paymentSheetParameters: SetupPaymentSheetParameters(
|
paymentSheetParameters: SetupPaymentSheetParameters(
|
||||||
@@ -304,7 +305,7 @@ class MyCabBookingController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -374,10 +375,10 @@ class MyCabBookingController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -409,15 +410,15 @@ class MyCabBookingController extends GetxController {
|
|||||||
note: "Contact us for any questions on your order.",
|
note: "Contact us for any questions on your order.",
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
completeOrder();
|
completeOrder();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -444,14 +445,14 @@ class MyCabBookingController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -481,10 +482,10 @@ class MyCabBookingController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -514,11 +515,11 @@ class MyCabBookingController extends GetxController {
|
|||||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -635,7 +636,7 @@ class MyCabBookingController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
return GetPaymentTxtTokenModel.fromJson(data);
|
return GetPaymentTxtTokenModel.fromJson(data);
|
||||||
}
|
}
|
||||||
@@ -668,18 +669,18 @@ class MyCabBookingController extends GetxController {
|
|||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
||||||
@@ -694,10 +695,10 @@ class MyCabBookingController extends GetxController {
|
|||||||
if (url != '') {
|
if (url != '') {
|
||||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -728,7 +729,7 @@ class MyCabBookingController extends GetxController {
|
|||||||
final responseData = jsonDecode(response.body);
|
final responseData = jsonDecode(response.body);
|
||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -762,13 +763,13 @@ class MyCabBookingController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
();
|
();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -795,7 +796,7 @@ class MyCabBookingController extends GetxController {
|
|||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -840,7 +841,7 @@ class MyCabBookingController extends GetxController {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -861,11 +862,11 @@ class MyCabBookingController extends GetxController {
|
|||||||
() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()),
|
() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
();
|
();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:customer/constant/constant.dart';
|
|||||||
import 'package:customer/models/wallet_transaction_model.dart';
|
import 'package:customer/models/wallet_transaction_model.dart';
|
||||||
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../models/rental_order_model.dart';
|
import '../models/rental_order_model.dart';
|
||||||
import '../models/tax_model.dart';
|
import '../models/tax_model.dart';
|
||||||
@@ -111,7 +112,7 @@ class MyRentalBookingController extends GetxController {
|
|||||||
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
||||||
selectedOrder.value.paymentMethod = selectedPaymentMethod.value;
|
selectedOrder.value.paymentMethod = selectedPaymentMethod.value;
|
||||||
await FireStoreUtils.rentalOrderPlace(selectedOrder.value).then((value) {
|
await FireStoreUtils.rentalOrderPlace(selectedOrder.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment method changed".tr);
|
ShowToastDialog.showToast("Payment method changed".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
@@ -128,8 +129,8 @@ class MyRentalBookingController extends GetxController {
|
|||||||
userId: FireStoreUtils.getCurrentUid(),
|
userId: FireStoreUtils.getCurrentUid(),
|
||||||
isTopup: false,
|
isTopup: false,
|
||||||
orderId: selectedOrder.value.id,
|
orderId: selectedOrder.value.id,
|
||||||
note: "Rental Amount debited".tr,
|
note: "Rental Amount debited".tr(),
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
serviceType: Constant.parcelServiceType,
|
serviceType: Constant.parcelServiceType,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -141,7 +142,7 @@ class MyRentalBookingController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await FireStoreUtils.rentalOrderPlace(selectedOrder.value).then((value) {
|
await FireStoreUtils.rentalOrderPlace(selectedOrder.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
@@ -204,17 +205,17 @@ class MyRentalBookingController extends GetxController {
|
|||||||
isTopup: true,
|
isTopup: true,
|
||||||
// refund
|
// refund
|
||||||
orderId: order.id,
|
orderId: order.id,
|
||||||
note: "Refund for cancelled booking".tr,
|
note: "Refund for cancelled booking".tr(),
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
serviceType: Constant.parcelServiceType,
|
serviceType: Constant.parcelServiceType,
|
||||||
);
|
);
|
||||||
|
|
||||||
await FireStoreUtils.setWalletTransaction(walletTransaction);
|
await FireStoreUtils.setWalletTransaction(walletTransaction);
|
||||||
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
|
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
|
||||||
}
|
}
|
||||||
ShowToastDialog.showToast("Booking cancelled successfully".tr);
|
ShowToastDialog.showToast("Booking cancelled successfully".tr());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.showToast("Failed to cancel booking: $e".tr);
|
ShowToastDialog.showToast("Failed to cancel booking: $e".tr());
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
|
|||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/models/coupon_model.dart';
|
import 'package:customer/models/coupon_model.dart';
|
||||||
import 'package:customer/models/user_model.dart';
|
import 'package:customer/models/user_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
@@ -132,9 +133,9 @@ class OnDemandBookingController extends GetxController {
|
|||||||
|
|
||||||
Future<void> confirmBooking(BuildContext context) async {
|
Future<void> confirmBooking(BuildContext context) async {
|
||||||
if (selectedAddress.value.getFullAddress().isEmpty) {
|
if (selectedAddress.value.getFullAddress().isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter address".tr);
|
ShowToastDialog.showToast("Please enter address".tr());
|
||||||
} else if (dateTimeController.value.text.isEmpty) {
|
} else if (dateTimeController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please select time slot.".tr);
|
ShowToastDialog.showToast("Please select time slot.".tr());
|
||||||
} else {
|
} else {
|
||||||
UserModel? providerUser = await FireStoreUtils.getUserProfile(provider.value!.author!);
|
UserModel? providerUser = await FireStoreUtils.getUserProfile(provider.value!.author!);
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ class OnDemandBookingController extends GetxController {
|
|||||||
|
|
||||||
Get.to(() => OnDemandPaymentScreen(), arguments: {'onDemandOrderModel': Rxn<OnProviderOrderModel>(onDemandOrderModel), 'totalAmount': totalAmount.value, 'isExtra': false});
|
Get.to(() => OnDemandPaymentScreen(), arguments: {'onDemandOrderModel': Rxn<OnProviderOrderModel>(onDemandOrderModel), 'totalAmount': totalAmount.value, 'isExtra': false});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
OnProviderOrderModel onDemandOrder = OnProviderOrderModel(
|
OnProviderOrderModel onDemandOrder = OnProviderOrderModel(
|
||||||
otp: Constant.getReferralCode(),
|
otp: Constant.getReferralCode(),
|
||||||
authorID: FireStoreUtils.getCurrentUid(),
|
authorID: FireStoreUtils.getCurrentUid(),
|
||||||
@@ -207,7 +208,7 @@ class OnDemandBookingController extends GetxController {
|
|||||||
Get.offAll(const OnDemandDashboardScreen());
|
Get.offAll(const OnDemandDashboardScreen());
|
||||||
OnDemandDashboardController controller = Get.put(OnDemandDashboardController());
|
OnDemandDashboardController controller = Get.put(OnDemandDashboardController());
|
||||||
controller.selectedIndex.value = 2;
|
controller.selectedIndex.value = 2;
|
||||||
ShowToastDialog.showToast("OnDemand Service successfully booked".tr);
|
ShowToastDialog.showToast("OnDemand Service successfully booked".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:developer';
|
|||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:customer/models/coupon_model.dart';
|
import 'package:customer/models/coupon_model.dart';
|
||||||
import 'package:customer/models/user_model.dart';
|
import 'package:customer/models/user_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../constant/constant.dart';
|
import '../constant/constant.dart';
|
||||||
@@ -144,7 +145,7 @@ class OnDemandOrderDetailsController extends GetxController {
|
|||||||
final order = onProviderOrder.value;
|
final order = onProviderOrder.value;
|
||||||
if (order == null) return;
|
if (order == null) return;
|
||||||
|
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
double total = 0.0;
|
double total = 0.0;
|
||||||
@@ -186,7 +187,7 @@ class OnDemandOrderDetailsController extends GetxController {
|
|||||||
isTopup: true,
|
isTopup: true,
|
||||||
orderId: order.id,
|
orderId: order.id,
|
||||||
note: 'Booking Amount Refund',
|
note: 'Booking Amount Refund',
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -204,7 +205,7 @@ class OnDemandOrderDetailsController extends GetxController {
|
|||||||
isTopup: false,
|
isTopup: false,
|
||||||
orderId: order.id,
|
orderId: order.id,
|
||||||
note: 'Booking Amount Refund',
|
note: 'Booking Amount Refund',
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -224,7 +225,7 @@ class OnDemandOrderDetailsController extends GetxController {
|
|||||||
isTopup: true,
|
isTopup: true,
|
||||||
orderId: order.id,
|
orderId: order.id,
|
||||||
note: 'Admin commission refund',
|
note: 'Admin commission refund',
|
||||||
paymentStatus: "success".tr,
|
paymentStatus: "success".tr(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -244,11 +245,11 @@ class OnDemandOrderDetailsController extends GetxController {
|
|||||||
|
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Booking cancelled successfully".tr);
|
ShowToastDialog.showToast("Booking cancelled successfully".tr());
|
||||||
} catch (e, st) {
|
} catch (e, st) {
|
||||||
log("Cancel error: $e\n$st");
|
log("Cancel error: $e\n$st");
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Something went wrong".tr);
|
ShowToastDialog.showToast("Something went wrong".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../constant/collection_name.dart';
|
import '../constant/collection_name.dart';
|
||||||
@@ -111,7 +112,7 @@ class OnDemandReviewController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _providerReviewSubmit() async {
|
Future<void> _providerReviewSubmit() async {
|
||||||
ShowToastDialog.showLoader("Submit in...".tr);
|
ShowToastDialog.showLoader("Submit in...".tr());
|
||||||
providerServiceModel.value!.reviewsCount = serviceReviewCount.value + 1;
|
providerServiceModel.value!.reviewsCount = serviceReviewCount.value + 1;
|
||||||
providerServiceModel.value!.reviewsSum = serviceReviewSum.value + ratings.value;
|
providerServiceModel.value!.reviewsSum = serviceReviewSum.value + ratings.value;
|
||||||
|
|
||||||
@@ -142,7 +143,7 @@ class OnDemandReviewController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _workerReviewSubmit() async {
|
Future<void> _workerReviewSubmit() async {
|
||||||
ShowToastDialog.showLoader("Submit in...".tr);
|
ShowToastDialog.showLoader("Submit in...".tr());
|
||||||
workerModel.value!.reviewsCount = workerReviewCount.value + 1;
|
workerModel.value!.reviewsCount = workerReviewCount.value + 1;
|
||||||
workerModel.value!.reviewsSum = workerReviewSum.value + ratings.value;
|
workerModel.value!.reviewsSum = workerReviewSum.value + ratings.value;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
|
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart';
|
import 'package:firebase_auth/firebase_auth.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -42,7 +43,7 @@ class OtpVerifyController extends GetxController {
|
|||||||
codeSent: (String verificationId0, int? resendToken0) async {
|
codeSent: (String verificationId0, int? resendToken0) async {
|
||||||
verificationId.value = verificationId0;
|
verificationId.value = verificationId0;
|
||||||
resendToken.value = resendToken0!;
|
resendToken.value = resendToken0!;
|
||||||
ShowToastDialog.showToast("OTP sent".tr);
|
ShowToastDialog.showToast("OTP sent".tr());
|
||||||
},
|
},
|
||||||
timeout: const Duration(seconds: 25),
|
timeout: const Duration(seconds: 25),
|
||||||
forceResendingToken: resendToken.value,
|
forceResendingToken: resendToken.value,
|
||||||
@@ -55,12 +56,12 @@ class OtpVerifyController extends GetxController {
|
|||||||
|
|
||||||
void verifyOtp() async {
|
void verifyOtp() async {
|
||||||
if (otpController.value.text.length != 6) {
|
if (otpController.value.text.length != 6) {
|
||||||
ShowToastDialog.showToast("Enter valid 6-digit OTP".tr);
|
ShowToastDialog.showToast("Enter valid 6-digit OTP".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ShowToastDialog.showLoader("Verifying OTP...".tr);
|
ShowToastDialog.showLoader("Verifying OTP...".tr());
|
||||||
|
|
||||||
final credential = PhoneAuthProvider.credential(verificationId: verificationId.value, smsCode: otpController.value.text.trim());
|
final credential = PhoneAuthProvider.credential(verificationId: verificationId.value, smsCode: otpController.value.text.trim());
|
||||||
|
|
||||||
@@ -91,7 +92,7 @@ class OtpVerifyController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (userModel.active == false) {
|
if (userModel.active == false) {
|
||||||
ShowToastDialog.showToast("This user is disabled".tr);
|
ShowToastDialog.showToast("This user is disabled".tr());
|
||||||
await _auth.signOut();
|
await _auth.signOut();
|
||||||
Get.offAll(() => const LoginScreen());
|
Get.offAll(() => const LoginScreen());
|
||||||
return;
|
return;
|
||||||
@@ -110,7 +111,7 @@ class OtpVerifyController extends GetxController {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Invalid OTP or Verification Failed".tr);
|
ShowToastDialog.showToast("Invalid OTP or Verification Failed".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import '../constant/constant.dart';
|
import '../constant/constant.dart';
|
||||||
@@ -81,7 +82,7 @@ class ParcelMyBookingController extends GetxController {
|
|||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
|
||||||
if (order.status != Constant.orderPlaced) {
|
if (order.status != Constant.orderPlaced) {
|
||||||
ShowToastDialog.showToast("You can only cancel before pickup.".tr);
|
ShowToastDialog.showToast("You can only cancel before pickup.".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,9 +125,9 @@ class ParcelMyBookingController extends GetxController {
|
|||||||
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
|
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowToastDialog.showToast("Order cancelled successfully".tr);
|
ShowToastDialog.showToast("Order cancelled successfully".tr());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.showToast("${'Failed to cancel order:'.tr} $e".tr);
|
ShowToastDialog.showToast("${'Failed to cancel order:'.tr()} $e".tr());
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'dart:math' as maths;
|
|||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:customer/models/coupon_model.dart';
|
import 'package:customer/models/coupon_model.dart';
|
||||||
import 'package:customer/models/wallet_transaction_model.dart';
|
import 'package:customer/models/wallet_transaction_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||||
@@ -135,7 +136,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> placeOrder() async {
|
Future<void> placeOrder() async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<String> parcelImages = [];
|
List<String> parcelImages = [];
|
||||||
@@ -206,7 +207,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
value,
|
value,
|
||||||
) async {
|
) async {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Order placed successfully".tr);
|
ShowToastDialog.showToast("Order placed successfully".tr());
|
||||||
Get.offAll(
|
Get.offAll(
|
||||||
() => OrderSuccessfullyPlaced(),
|
() => OrderSuccessfullyPlaced(),
|
||||||
arguments: {'parcelOrder': parcelOrder.value},
|
arguments: {'parcelOrder': parcelOrder.value},
|
||||||
@@ -215,7 +216,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Something went wrong. Please try again.".tr);
|
ShowToastDialog.showToast("Something went wrong. Please try again.".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,7 +324,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
if (paymentIntentData!.containsKey("error")) {
|
if (paymentIntentData!.containsKey("error")) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast(
|
ShowToastDialog.showToast(
|
||||||
"Something went wrong, please contact admin.".tr,
|
"Something went wrong, please contact admin.".tr(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await Stripe.instance.initPaymentSheet(
|
await Stripe.instance.initPaymentSheet(
|
||||||
@@ -356,7 +357,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -439,10 +440,10 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -479,17 +480,17 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
debugPrint("✅ PayPal Payment Success: $params");
|
debugPrint("✅ PayPal Payment Success: $params");
|
||||||
placeOrder();
|
placeOrder();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
debugPrint("❌ PayPal Payment Error: $error");
|
debugPrint("❌ PayPal Payment Error: $error");
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
debugPrint("⚠️ PayPal Payment Canceled: $params");
|
debugPrint("⚠️ PayPal Payment Canceled: $params");
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -520,15 +521,15 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
// note: "Contact us for any questions on your order.",
|
// note: "Contact us for any questions on your order.",
|
||||||
// onSuccess: (Map params) async {
|
// onSuccess: (Map params) async {
|
||||||
// placeOrder();
|
// placeOrder();
|
||||||
// ShowToastDialog.showToast("Payment Successful!!".tr);
|
// ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
// },
|
// },
|
||||||
// onError: (error) {
|
// onError: (error) {
|
||||||
// Get.back();
|
// Get.back();
|
||||||
// ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
// ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
// },
|
// },
|
||||||
// onCancel: (params) {
|
// onCancel: (params) {
|
||||||
// Get.back();
|
// Get.back();
|
||||||
// ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
// ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
@@ -558,15 +559,15 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast(
|
ShowToastDialog.showToast(
|
||||||
"Something went wrong, please contact admin.".tr,
|
"Something went wrong, please contact admin.".tr(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -613,10 +614,10 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
bool isVerified = await verifyFlutterWavePayment(_ref!);
|
bool isVerified = await verifyFlutterWavePayment(_ref!);
|
||||||
|
|
||||||
if (isVerified) {
|
if (isVerified) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -675,11 +676,11 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
);
|
);
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -832,7 +833,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
data["body"]["txnToken"].toString().isEmpty) {
|
data["body"]["txnToken"].toString().isEmpty) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast(
|
ShowToastDialog.showToast(
|
||||||
"Something went wrong, please contact admin.".tr,
|
"Something went wrong, please contact admin.".tr(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -865,7 +866,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
// final data = jsonDecode(response.body);
|
// final data = jsonDecode(response.body);
|
||||||
// if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
// if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
||||||
// Get.back();
|
// Get.back();
|
||||||
// ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
// ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
// }
|
// }
|
||||||
// return GetPaymentTxtTokenModel.fromJson(data);
|
// return GetPaymentTxtTokenModel.fromJson(data);
|
||||||
// }
|
// }
|
||||||
@@ -901,18 +902,18 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
||||||
@@ -930,10 +931,10 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
if (url != '') {
|
if (url != '') {
|
||||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -974,7 +975,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast(
|
ShowToastDialog.showToast(
|
||||||
"something went wrong, please contact admin.".tr,
|
"something went wrong, please contact admin.".tr(),
|
||||||
);
|
);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -1001,7 +1002,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
debugPrint('🟩 Starting OrangePay Payment...');
|
debugPrint('🟩 Starting OrangePay Payment...');
|
||||||
debugPrint('💰 Amount: $amount | 🆔 Order ID: $id');
|
debugPrint('💰 Amount: $amount | 🆔 Order ID: $id');
|
||||||
|
|
||||||
ShowToastDialog.showLoader("Initializing payment...".tr);
|
ShowToastDialog.showLoader("Initializing payment...".tr());
|
||||||
|
|
||||||
var paymentURL = await fetchToken(
|
var paymentURL = await fetchToken(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -1026,20 +1027,20 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
),
|
),
|
||||||
)?.then((value) async {
|
)?.then((value) async {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
debugPrint('🎉 Payment Successful for Order ID: $orderId');
|
debugPrint('🎉 Payment Successful for Order ID: $orderId');
|
||||||
|
|
||||||
if (Get.isBottomSheetOpen ?? false) Get.back();
|
if (Get.isBottomSheetOpen ?? false) Get.back();
|
||||||
await placeOrder();
|
await placeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
debugPrint('⚠️ Payment flow closed without success.');
|
debugPrint('⚠️ Payment flow closed without success.');
|
||||||
|
|
||||||
if (Get.isBottomSheetOpen ?? false) Get.back();
|
if (Get.isBottomSheetOpen ?? false) Get.back();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
if (Get.isBottomSheetOpen ?? false) Get.back();
|
if (Get.isBottomSheetOpen ?? false) Get.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1085,7 +1086,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
} else {
|
} else {
|
||||||
debugPrint('❌ Failed to fetch access token.');
|
debugPrint('❌ Failed to fetch access token.');
|
||||||
ShowToastDialog.showToast(
|
ShowToastDialog.showToast(
|
||||||
"Something went wrong, please contact admin.".tr,
|
"Something went wrong, please contact admin.".tr(),
|
||||||
);
|
);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -1151,7 +1152,7 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
} else {
|
} else {
|
||||||
debugPrint('❌ Payment request failed.');
|
debugPrint('❌ Payment request failed.');
|
||||||
ShowToastDialog.showToast(
|
ShowToastDialog.showToast(
|
||||||
"Something went wrong, please contact admin.".tr,
|
"Something went wrong, please contact admin.".tr(),
|
||||||
);
|
);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -1178,11 +1179,11 @@ class ParcelOrderConfirmationController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
placeOrder();
|
placeOrder();
|
||||||
();
|
();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:customer/models/rating_model.dart';
|
|||||||
import 'package:customer/models/wallet_transaction_model.dart';
|
import 'package:customer/models/wallet_transaction_model.dart';
|
||||||
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import '../constant/constant.dart';
|
import '../constant/constant.dart';
|
||||||
@@ -87,7 +88,7 @@ class ParcelOrderDetailsController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> cancelParcelOrder() async {
|
Future<void> cancelParcelOrder() async {
|
||||||
ShowToastDialog.showLoader("Cancelling order...".tr);
|
ShowToastDialog.showLoader("Cancelling order...".tr());
|
||||||
parcelOrder.value.status = Constant.orderCancelled;
|
parcelOrder.value.status = Constant.orderCancelled;
|
||||||
if (parcelOrder.value.paymentMethod?.toLowerCase() != "cod") {
|
if (parcelOrder.value.paymentMethod?.toLowerCase() != "cod") {
|
||||||
WalletTransactionModel walletTransaction = WalletTransactionModel(
|
WalletTransactionModel walletTransaction = WalletTransactionModel(
|
||||||
@@ -113,7 +114,7 @@ class ParcelOrderDetailsController extends GetxController {
|
|||||||
|
|
||||||
await FireStoreUtils.parcelOrderPlace(parcelOrder.value);
|
await FireStoreUtils.parcelOrderPlace(parcelOrder.value);
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Order cancelled successfully".tr);
|
ShowToastDialog.showToast("Order cancelled successfully".tr());
|
||||||
Get.back(result: true);
|
Get.back(result: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:customer/models/parcel_order_model.dart';
|
import 'package:customer/models/parcel_order_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../models/rating_model.dart';
|
import '../models/rating_model.dart';
|
||||||
@@ -70,11 +71,11 @@ class ParcelReviewController extends GetxController {
|
|||||||
/// Save / update review
|
/// Save / update review
|
||||||
Future<void> submitReview() async {
|
Future<void> submitReview() async {
|
||||||
if (comment.value.text.trim().isEmpty || ratings.value == 0) {
|
if (comment.value.text.trim().isEmpty || ratings.value == 0) {
|
||||||
ShowToastDialog.showToast("Please provide rating and comment".tr);
|
ShowToastDialog.showToast("Please provide rating and comment".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowToastDialog.showLoader("Submit in...".tr);
|
ShowToastDialog.showLoader("Submit in...".tr());
|
||||||
|
|
||||||
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');
|
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/models/order_model.dart';
|
|||||||
import 'package:customer/models/product_model.dart';
|
import 'package:customer/models/product_model.dart';
|
||||||
import 'package:customer/models/vendor_category_model.dart';
|
import 'package:customer/models/vendor_category_model.dart';
|
||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../models/rating_model.dart';
|
import '../models/rating_model.dart';
|
||||||
import '../models/review_attribute_model.dart';
|
import '../models/review_attribute_model.dart';
|
||||||
import '../service/fire_store_utils.dart';
|
import '../service/fire_store_utils.dart';
|
||||||
@@ -118,7 +119,7 @@ class RateProductController extends GetxController {
|
|||||||
|
|
||||||
Future<void> saveRating() async {
|
Future<void> saveRating() async {
|
||||||
if (ratings.value != 0.0) {
|
if (ratings.value != 0.0) {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
productModel.value.reviewsCount = productReviewCount.value + 1;
|
productModel.value.reviewsCount = productReviewCount.value + 1;
|
||||||
productModel.value.reviewsSum = productReviewSum.value + ratings.value;
|
productModel.value.reviewsSum = productReviewSum.value + ratings.value;
|
||||||
productModel.value.reviewAttributes = reviewProductAttributes;
|
productModel.value.reviewAttributes = reviewProductAttributes;
|
||||||
@@ -171,10 +172,10 @@ class RateProductController extends GetxController {
|
|||||||
await FireStoreUtils.updateVendor(vendorModel.value);
|
await FireStoreUtils.updateVendor(vendorModel.value);
|
||||||
await FireStoreUtils.setProduct(productModel.value);
|
await FireStoreUtils.setProduct(productModel.value);
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Rating saved successfully.".tr);
|
ShowToastDialog.showToast("Rating saved successfully.".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Please add rate for food item.".tr);
|
ShowToastDialog.showToast("Please add rate for food item.".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:customer/models/coupon_model.dart';
|
|||||||
import 'package:customer/models/rental_order_model.dart';
|
import 'package:customer/models/rental_order_model.dart';
|
||||||
import 'package:customer/service/fire_store_utils.dart';
|
import 'package:customer/service/fire_store_utils.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ class RentalConformationController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> placeOrder() async {
|
Future<void> placeOrder() async {
|
||||||
ShowToastDialog.showLoader("Placing booking...".tr);
|
ShowToastDialog.showLoader("Placing booking...".tr());
|
||||||
rentalOrderModel.value.discount = discount.value.toString();
|
rentalOrderModel.value.discount = discount.value.toString();
|
||||||
rentalOrderModel.value.couponCode = selectedCouponModel.value.code;
|
rentalOrderModel.value.couponCode = selectedCouponModel.value.code;
|
||||||
rentalOrderModel.value.couponId = selectedCouponModel.value.id;
|
rentalOrderModel.value.couponId = selectedCouponModel.value.id;
|
||||||
@@ -79,7 +80,7 @@ class RentalConformationController extends GetxController {
|
|||||||
rentalOrderModel.value.otpCode = (maths.Random().nextInt(9000) + 1000).toString();
|
rentalOrderModel.value.otpCode = (maths.Random().nextInt(9000) + 1000).toString();
|
||||||
await FireStoreUtils.rentalOrderPlace(rentalOrderModel.value).then((value) async {
|
await FireStoreUtils.rentalOrderPlace(rentalOrderModel.value).then((value) async {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Order placed successfully".tr);
|
ShowToastDialog.showToast("Order placed successfully".tr());
|
||||||
Get.offAll(const RentalDashboardScreen());
|
Get.offAll(const RentalDashboardScreen());
|
||||||
CabRentalDashboardControllers controller = Get.put(CabRentalDashboardControllers());
|
CabRentalDashboardControllers controller = Get.put(CabRentalDashboardControllers());
|
||||||
controller.selectedIndex.value = 1;
|
controller.selectedIndex.value = 1;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:customer/models/user_model.dart';
|
|||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
import 'package:customer/screen_ui/rental_service/rental_conformation_screen.dart';
|
import 'package:customer/screen_ui/rental_service/rental_conformation_screen.dart';
|
||||||
import 'package:customer/widget/geoflutterfire/src/geoflutterfire.dart';
|
import 'package:customer/widget/geoflutterfire/src/geoflutterfire.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -81,7 +82,7 @@ class RentalHomeController extends GetxController {
|
|||||||
sourceTextEditController.value.text = address;
|
sourceTextEditController.value.text = address;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.showToast("Unable to fetch current location".tr);
|
ShowToastDialog.showToast("Unable to fetch current location".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_scr
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
import 'package:customer/utils/preferences.dart';
|
import 'package:customer/utils/preferences.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||||
@@ -163,7 +164,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
|
|
||||||
totalAmount.value = (subTotal.value - discount.value) + taxAmount.value;
|
totalAmount.value = (subTotal.value - discount.value) + taxAmount.value;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.showToast("${'Failed to calculate total:'.tr} $e");
|
ShowToastDialog.showToast("${'Failed to calculate total:'.tr()} $e");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +172,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
||||||
order.value.paymentMethod = selectedPaymentMethod.value;
|
order.value.paymentMethod = selectedPaymentMethod.value;
|
||||||
await FireStoreUtils.rentalOrderPlace(order.value).then((value) {
|
await FireStoreUtils.rentalOrderPlace(order.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment method changed".tr);
|
ShowToastDialog.showToast("Payment method changed".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
@@ -201,7 +202,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await FireStoreUtils.rentalOrderPlace(order.value).then((value) {
|
await FireStoreUtils.rentalOrderPlace(order.value).then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
@@ -245,10 +246,10 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
await FireStoreUtils.setWalletTransaction(walletTransaction);
|
await FireStoreUtils.setWalletTransaction(walletTransaction);
|
||||||
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
|
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
|
||||||
}
|
}
|
||||||
ShowToastDialog.showToast("Booking cancelled successfully".tr);
|
ShowToastDialog.showToast("Booking cancelled successfully".tr());
|
||||||
Get.back();
|
Get.back();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.showToast("${'Failed to cancel booking:'.tr} $e".tr);
|
ShowToastDialog.showToast("${'Failed to cancel booking:'.tr()} $e".tr());
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -329,7 +330,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
log("stripe Responce====>$paymentIntentData");
|
log("stripe Responce====>$paymentIntentData");
|
||||||
if (paymentIntentData!.containsKey("error")) {
|
if (paymentIntentData!.containsKey("error")) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
await Stripe.instance.initPaymentSheet(
|
await Stripe.instance.initPaymentSheet(
|
||||||
paymentSheetParameters: SetupPaymentSheetParameters(
|
paymentSheetParameters: SetupPaymentSheetParameters(
|
||||||
@@ -353,7 +354,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -419,10 +420,10 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -454,15 +455,15 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
note: "Contact us for any questions on your order.",
|
note: "Contact us for any questions on your order.",
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
completeOrder();
|
completeOrder();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -489,14 +490,14 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -526,10 +527,10 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -557,11 +558,11 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -666,7 +667,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
return GetPaymentTxtTokenModel.fromJson(data);
|
return GetPaymentTxtTokenModel.fromJson(data);
|
||||||
}
|
}
|
||||||
@@ -699,18 +700,18 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
|
||||||
@@ -725,10 +726,10 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
if (url != '') {
|
if (url != '') {
|
||||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -753,7 +754,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
final responseData = jsonDecode(response.body);
|
final responseData = jsonDecode(response.body);
|
||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -778,13 +779,13 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
if (paymentURL.toString() != '') {
|
if (paymentURL.toString() != '') {
|
||||||
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
();
|
();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -807,7 +808,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -844,7 +845,7 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -862,10 +863,10 @@ class RentalOrderDetailsController extends GetxController {
|
|||||||
if (model.id != null) {
|
if (model.id != null) {
|
||||||
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
completeOrder();
|
completeOrder();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../constant/collection_name.dart';
|
import '../constant/collection_name.dart';
|
||||||
@@ -71,11 +72,11 @@ class RentalReviewController extends GetxController {
|
|||||||
/// Save / update review
|
/// Save / update review
|
||||||
Future<void> submitReview() async {
|
Future<void> submitReview() async {
|
||||||
if (comment.value.text.trim().isEmpty || ratings.value == 0) {
|
if (comment.value.text.trim().isEmpty || ratings.value == 0) {
|
||||||
ShowToastDialog.showToast("Please provide rating and comment".tr);
|
ShowToastDialog.showToast("Please provide rating and comment".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowToastDialog.showLoader("Submit in...".tr);
|
ShowToastDialog.showLoader("Submit in...".tr());
|
||||||
|
|
||||||
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');
|
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import 'package:customer/models/currency_model.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart' as auth;
|
import 'package:firebase_auth/firebase_auth.dart' as auth;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@@ -75,7 +76,7 @@ class ServiceListController extends GetxController {
|
|||||||
SectionModel sectionModel,
|
SectionModel sectionModel,
|
||||||
) async {
|
) async {
|
||||||
try {
|
try {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
Constant.sectionConstantModel = sectionModel;
|
Constant.sectionConstantModel = sectionModel;
|
||||||
AppThemeData.primary300 = Color(
|
AppThemeData.primary300 = Color(
|
||||||
int.tryParse(sectionModel.color?.replaceFirst("#", "0xff") ?? '') ??
|
int.tryParse(sectionModel.color?.replaceFirst("#", "0xff") ?? '') ??
|
||||||
@@ -160,7 +161,7 @@ class ServiceListController extends GetxController {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"If you select this Section/Service, your previously added items will be removed from the cart."
|
"If you select this Section/Service, your previously added items will be removed from the cart."
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
@@ -170,7 +171,7 @@ class ServiceListController extends GetxController {
|
|||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
title: "Cancel".tr,
|
title: "Cancel".tr(),
|
||||||
onPress: () {
|
onPress: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
@@ -182,7 +183,7 @@ class ServiceListController extends GetxController {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "OK".tr,
|
title: "OK".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
DatabaseHelper.instance.deleteAllCartProducts();
|
DatabaseHelper.instance.deleteAllCartProducts();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:customer/models/user_model.dart';
|
import 'package:customer/models/user_model.dart';
|
||||||
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
|
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart' as auth;
|
import 'package:firebase_auth/firebase_auth.dart' as auth;
|
||||||
@@ -65,7 +66,7 @@ class SignUpController extends GetxController {
|
|||||||
try {
|
try {
|
||||||
if (!_validateInputs()) return;
|
if (!_validateInputs()) return;
|
||||||
|
|
||||||
ShowToastDialog.showLoader("Creating account...".tr);
|
ShowToastDialog.showLoader("Creating account...".tr());
|
||||||
|
|
||||||
if (type.value == "mobileNumber") {
|
if (type.value == "mobileNumber") {
|
||||||
await _signUpWithMobile();
|
await _signUpWithMobile();
|
||||||
@@ -77,29 +78,29 @@ class SignUpController extends GetxController {
|
|||||||
} catch (e, st) {
|
} catch (e, st) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
debugPrint("SIGNUP OUTER EXCEPTION: $e\n$st");
|
debugPrint("SIGNUP OUTER EXCEPTION: $e\n$st");
|
||||||
ShowToastDialog.showToast("${'signup_failed'.tr}: $e");
|
ShowToastDialog.showToast("${'signup_failed'.tr()}: $e");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Validation Logic
|
/// Validation Logic
|
||||||
bool _validateInputs() {
|
bool _validateInputs() {
|
||||||
if (firstNameController.value.text.isEmpty) {
|
if (firstNameController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter first name".tr);
|
ShowToastDialog.showToast("Please enter first name".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (lastNameController.value.text.isEmpty) {
|
} else if (lastNameController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter last name".tr);
|
ShowToastDialog.showToast("Please enter last name".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (emailController.value.text.isEmpty || !emailController.value.text.isEmail) {
|
} else if (emailController.value.text.isEmpty || !emailController.value.text.isEmail) {
|
||||||
ShowToastDialog.showToast("Please enter a valid email address".tr);
|
ShowToastDialog.showToast("Please enter a valid email address".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (mobileController.value.text.isEmpty) {
|
} else if (mobileController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter a valid phone number".tr);
|
ShowToastDialog.showToast("Please enter a valid phone number".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (passwordController.value.text.length < 6) {
|
} else if (passwordController.value.text.length < 6) {
|
||||||
ShowToastDialog.showToast("Password must be at least 6 characters".tr);
|
ShowToastDialog.showToast("Password must be at least 6 characters".tr());
|
||||||
return false;
|
return false;
|
||||||
} else if (passwordController.value.text != confirmPasswordController.value.text) {
|
} else if (passwordController.value.text != confirmPasswordController.value.text) {
|
||||||
ShowToastDialog.showToast("Password and Confirm password do not match".tr);
|
ShowToastDialog.showToast("Password and Confirm password do not match".tr());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -120,17 +121,17 @@ class SignUpController extends GetxController {
|
|||||||
} on auth.FirebaseAuthException catch (e) {
|
} on auth.FirebaseAuthException catch (e) {
|
||||||
debugPrint("FirebaseAuthException caught: code=${e.code}, message=${e.message}");
|
debugPrint("FirebaseAuthException caught: code=${e.code}, message=${e.message}");
|
||||||
if (e.code == 'email-already-in-use') {
|
if (e.code == 'email-already-in-use') {
|
||||||
ShowToastDialog.showToast("Email already in use".tr);
|
ShowToastDialog.showToast("Email already in use".tr());
|
||||||
} else if (e.code == 'weak-password') {
|
} else if (e.code == 'weak-password') {
|
||||||
ShowToastDialog.showToast("Password is too weak".tr);
|
ShowToastDialog.showToast("Password is too weak".tr());
|
||||||
} else if (e.code == 'invalid-email') {
|
} else if (e.code == 'invalid-email') {
|
||||||
ShowToastDialog.showToast("Invalid email address".tr);
|
ShowToastDialog.showToast("Invalid email address".tr());
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast(e.message ?? "signup_failed".tr);
|
ShowToastDialog.showToast(e.message ?? "signup_failed".tr());
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint("Something went wrong: ${e.toString()}");
|
debugPrint("Something went wrong: ${e.toString()}");
|
||||||
ShowToastDialog.showToast("${'something_went_wrong'.tr}: ${e.toString()}");
|
ShowToastDialog.showToast("${'something_went_wrong'.tr()}: ${e.toString()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +148,7 @@ class SignUpController extends GetxController {
|
|||||||
|
|
||||||
_navigateBasedOnAddress(userModel.value);
|
_navigateBasedOnAddress(userModel.value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ShowToastDialog.showToast("${'signup_failed'.tr}: $e");
|
ShowToastDialog.showToast("${'signup_failed'.tr()}: $e");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import 'package:customer/models/payment_model/xendit.dart';
|
|||||||
import 'package:customer/models/user_model.dart';
|
import 'package:customer/models/user_model.dart';
|
||||||
import 'package:customer/models/wallet_transaction_model.dart';
|
import 'package:customer/models/wallet_transaction_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||||
import 'package:razorpay_flutter/razorpay_flutter.dart';
|
import 'package:razorpay_flutter/razorpay_flutter.dart';
|
||||||
@@ -131,7 +132,7 @@ class WalletController extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ShowToastDialog.showToast("Amount Top-up successfully".tr);
|
ShowToastDialog.showToast("Amount Top-up successfully".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Strip
|
// Strip
|
||||||
@@ -142,7 +143,7 @@ class WalletController extends GetxController {
|
|||||||
log("stripe Responce====>$paymentIntentData");
|
log("stripe Responce====>$paymentIntentData");
|
||||||
if (paymentIntentData!.containsKey("error")) {
|
if (paymentIntentData!.containsKey("error")) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
await Stripe.instance.initPaymentSheet(
|
await Stripe.instance.initPaymentSheet(
|
||||||
paymentSheetParameters: SetupPaymentSheetParameters(
|
paymentSheetParameters: SetupPaymentSheetParameters(
|
||||||
@@ -166,7 +167,7 @@ class WalletController extends GetxController {
|
|||||||
Future<void> displayStripePaymentSheet({required String amount}) async {
|
Future<void> displayStripePaymentSheet({required String amount}) async {
|
||||||
try {
|
try {
|
||||||
await Stripe.instance.presentPaymentSheet().then((value) {
|
await Stripe.instance.presentPaymentSheet().then((value) {
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
});
|
});
|
||||||
} on StripeException catch (e) {
|
} on StripeException catch (e) {
|
||||||
@@ -231,14 +232,14 @@ class WalletController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something want wrong please contact administrator".tr);
|
ShowToastDialog.showToast("Something want wrong please contact administrator".tr());
|
||||||
print('Error creating preference: ${response.body}');
|
print('Error creating preference: ${response.body}');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -266,15 +267,15 @@ class WalletController extends GetxController {
|
|||||||
note: "Contact us for any questions on your order.",
|
note: "Contact us for any questions on your order.",
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -298,14 +299,14 @@ class WalletController extends GetxController {
|
|||||||
),
|
),
|
||||||
)!.then((value) {
|
)!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -335,10 +336,10 @@ class WalletController extends GetxController {
|
|||||||
final data = jsonDecode(response.body);
|
final data = jsonDecode(response.body);
|
||||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -366,11 +367,11 @@ class WalletController extends GetxController {
|
|||||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||||
if (isDone) {
|
if (isDone) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment successfully".tr);
|
ShowToastDialog.showToast("Payment successfully".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed".tr);
|
ShowToastDialog.showToast("Payment Failed".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -402,18 +403,18 @@ class WalletController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleExternalWaller(ExternalWalletResponse response) {
|
void handleExternalWaller(ExternalWalletResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Processing!! via".tr);
|
ShowToastDialog.showToast("Payment Processing!! via".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePaymentError(PaymentFailureResponse response) {
|
void handlePaymentError(PaymentFailureResponse response) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Payment Failed!!".tr);
|
ShowToastDialog.showToast("Payment Failed!!".tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Midtrans payment
|
//Midtrans payment
|
||||||
@@ -423,10 +424,10 @@ class WalletController extends GetxController {
|
|||||||
if (url != '') {
|
if (url != '') {
|
||||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -451,7 +452,7 @@ class WalletController extends GetxController {
|
|||||||
final responseData = jsonDecode(response.body);
|
final responseData = jsonDecode(response.body);
|
||||||
return responseData['payment_url'];
|
return responseData['payment_url'];
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -476,12 +477,12 @@ class WalletController extends GetxController {
|
|||||||
if (paymentURL.toString() != '') {
|
if (paymentURL.toString() != '') {
|
||||||
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +502,7 @@ class WalletController extends GetxController {
|
|||||||
accessToken = responseData['access_token'];
|
accessToken = responseData['access_token'];
|
||||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -540,7 +541,7 @@ class WalletController extends GetxController {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -559,10 +560,10 @@ class WalletController extends GetxController {
|
|||||||
if (model.id != null) {
|
if (model.id != null) {
|
||||||
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||||
walletTopUp();
|
walletTopUp();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:customer/service/localization_service.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/easy_loading_config.dart';
|
import 'package:customer/themes/easy_loading_config.dart';
|
||||||
import 'package:customer/utils/preferences.dart';
|
import 'package:customer/utils/preferences.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
@@ -14,6 +15,7 @@ import 'firebase_options.dart';
|
|||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await EasyLocalization.ensureInitialized();
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
name: 'default',
|
name: 'default',
|
||||||
options: DefaultFirebaseOptions.currentPlatform,
|
options: DefaultFirebaseOptions.currentPlatform,
|
||||||
@@ -24,7 +26,18 @@ void main() async {
|
|||||||
Get.put(ThemeController());
|
Get.put(ThemeController());
|
||||||
await configEasyLoading();
|
await configEasyLoading();
|
||||||
|
|
||||||
runApp(MyApp());
|
runApp(
|
||||||
|
EasyLocalization(
|
||||||
|
supportedLocales: [
|
||||||
|
Locale('en', 'US'),
|
||||||
|
Locale('uz', 'UZ'),
|
||||||
|
Locale('ru', 'RU'),
|
||||||
|
],
|
||||||
|
path: 'assets/translations',
|
||||||
|
fallbackLocale: Locale('en', 'US'),
|
||||||
|
child: MyApp(),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
@@ -41,6 +54,9 @@ class MyApp extends StatelessWidget {
|
|||||||
minTextAdapt: true,
|
minTextAdapt: true,
|
||||||
splitScreenMode: true,
|
splitScreenMode: true,
|
||||||
child: GetMaterialApp(
|
child: GetMaterialApp(
|
||||||
|
localizationsDelegates: context.localizationDelegates,
|
||||||
|
supportedLocales: context.supportedLocales,
|
||||||
|
locale: context.locale,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
@@ -50,7 +66,6 @@ class MyApp extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
translations: LocalizationService(),
|
translations: LocalizationService(),
|
||||||
locale: LocalizationService.locale,
|
|
||||||
fallbackLocale: LocalizationService.locale,
|
fallbackLocale: LocalizationService.locale,
|
||||||
themeMode: themeController.themeMode,
|
themeMode: themeController.themeMode,
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
@@ -57,7 +58,7 @@ class _MercadoPagoScreenState extends State<MercadoPagoScreen> {
|
|||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text("Payment".tr),
|
title: Text("Payment".tr()),
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
leading: GestureDetector(
|
leading: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -77,18 +78,18 @@ class _MercadoPagoScreenState extends State<MercadoPagoScreen> {
|
|||||||
barrierDismissible: true, // user must tap button!
|
barrierDismissible: true, // user must tap button!
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text('Cancel Payment'.tr),
|
title: Text('Cancel Payment'.tr()),
|
||||||
content: SingleChildScrollView(child: Text("Cancel Payment?".tr)),
|
content: SingleChildScrollView(child: Text("Cancel Payment?".tr())),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Cancel'.tr, style: const TextStyle(color: Colors.red)),
|
child: Text('Cancel'.tr(), style: const TextStyle(color: Colors.red)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Get.back(result: false);
|
Get.back(result: false);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Continue'.tr, style: const TextStyle(color: Colors.green)),
|
child: Text('Continue'.tr(), style: const TextStyle(color: Colors.green)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:customer/models/payment_model/pay_fast_model.dart';
|
import 'package:customer/models/payment_model/pay_fast_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -84,17 +85,17 @@ class _PayFastScreenState extends State<PayFastScreen> {
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Cancel Payment'),
|
title: const Text('Cancel Payment'),
|
||||||
content: SingleChildScrollView(child: Text("Cancel Payment?".tr)),
|
content: SingleChildScrollView(child: Text("Cancel Payment?".tr())),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Exit'.tr, style: TextStyle(color: Colors.red)),
|
child: Text('Exit'.tr(), style: TextStyle(color: Colors.red)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back(result: false);
|
Get.back(result: false);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Continue Payment'.tr, style: TextStyle(color: Colors.green)),
|
child: Text('Continue Payment'.tr(), style: TextStyle(color: Colors.green)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
@@ -91,18 +92,18 @@ class _MidtransScreenState extends State<MidtransScreen> {
|
|||||||
barrierDismissible: true, // user must tap button!
|
barrierDismissible: true, // user must tap button!
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text('Cancel Payment'.tr),
|
title: Text('Cancel Payment'.tr()),
|
||||||
content: SingleChildScrollView(child: Text("Cancel Payment?".tr)),
|
content: SingleChildScrollView(child: Text("Cancel Payment?".tr())),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Cancel'.tr, style: const TextStyle(color: Colors.red)),
|
child: Text('Cancel'.tr(), style: const TextStyle(color: Colors.red)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back(result: false);
|
Get.back(result: false);
|
||||||
Get.back(result: false);
|
Get.back(result: false);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Continue'.tr, style: const TextStyle(color: Colors.green)),
|
child: Text('Continue'.tr(), style: const TextStyle(color: Colors.green)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back(result: false);
|
Get.back(result: false);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:customer/models/payment_model/orange_money.dart';
|
import 'package:customer/models/payment_model/orange_money.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
@@ -107,7 +108,7 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
leading: IconButton(icon: const Icon(Icons.arrow_back, color: Colors.white), onPressed: _showCancelDialog),
|
leading: IconButton(icon: const Icon(Icons.arrow_back, color: Colors.white), onPressed: _showCancelDialog),
|
||||||
title: Text('Orange Money Payment'.tr),
|
title: Text('Orange Money Payment'.tr()),
|
||||||
),
|
),
|
||||||
body: isLoading ? const Center(child: CircularProgressIndicator()) : WebViewWidget(controller: controller),
|
body: isLoading ? const Center(child: CircularProgressIndicator()) : WebViewWidget(controller: controller),
|
||||||
),
|
),
|
||||||
@@ -120,12 +121,12 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
|
|||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text('Cancel Payment'.tr),
|
title: Text('Cancel Payment'.tr()),
|
||||||
content: Text('Are you sure you want to cancel this payment?'.tr),
|
content: Text('Are you sure you want to cancel this payment?'.tr()),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(child: Text('No', style: TextStyle(color: Colors.green)), onPressed: () => Get.back()),
|
TextButton(child: Text('No', style: TextStyle(color: Colors.green)), onPressed: () => Get.back()),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Yes'.tr, style: TextStyle(color: Colors.red)),
|
child: Text('Yes'.tr(), style: TextStyle(color: Colors.red)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
timer?.cancel();
|
timer?.cancel();
|
||||||
Get.back(); // close dialog
|
Get.back(); // close dialog
|
||||||
@@ -298,14 +299,14 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
|
|||||||
// barrierDismissible: true, // user must tap button!
|
// barrierDismissible: true, // user must tap button!
|
||||||
// builder: (BuildContext context) {
|
// builder: (BuildContext context) {
|
||||||
// return AlertDialog(
|
// return AlertDialog(
|
||||||
// title: Text('Cancel Payment'.tr),
|
// title: Text('Cancel Payment'.tr()),
|
||||||
// content: SingleChildScrollView(
|
// content: SingleChildScrollView(
|
||||||
// child: Text("cancelPayment?".tr),
|
// child: Text("cancelPayment?".tr()),
|
||||||
// ),
|
// ),
|
||||||
// actions: <Widget>[
|
// actions: <Widget>[
|
||||||
// TextButton(
|
// TextButton(
|
||||||
// child: Text(
|
// child: Text(
|
||||||
// 'Cancel'.tr,
|
// 'Cancel'.tr(),
|
||||||
// style: const TextStyle(color: Colors.red),
|
// style: const TextStyle(color: Colors.red),
|
||||||
// ),
|
// ),
|
||||||
// onPressed: () {
|
// onPressed: () {
|
||||||
@@ -315,7 +316,7 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
|
|||||||
// ),
|
// ),
|
||||||
// TextButton(
|
// TextButton(
|
||||||
// child: Text(
|
// child: Text(
|
||||||
// 'Continue'.tr,
|
// 'Continue'.tr(),
|
||||||
// style: const TextStyle(color: Colors.green),
|
// style: const TextStyle(color: Colors.green),
|
||||||
// ),
|
// ),
|
||||||
// onPressed: () {
|
// onPressed: () {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:customer/payment/paystack/paystack_url_genrater.dart';
|
import 'package:customer/payment/paystack/paystack_url_genrater.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
@@ -72,7 +73,7 @@ class _PayStackScreenState extends State<PayStackScreen> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: AppThemeData.grey50,
|
backgroundColor: AppThemeData.grey50,
|
||||||
title: Text("Payment".tr),
|
title: Text("Payment".tr()),
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
leading: GestureDetector(
|
leading: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'dart:convert';
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:customer/payment/xenditModel.dart';
|
import 'package:customer/payment/xenditModel.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
@@ -112,18 +113,18 @@ class _XenditScreenState extends State<XenditScreen> {
|
|||||||
barrierDismissible: true, // user must tap button!
|
barrierDismissible: true, // user must tap button!
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text('Cancel Payment'.tr),
|
title: Text('Cancel Payment'.tr()),
|
||||||
content: SingleChildScrollView(child: Text("Cancel Payment?".tr)),
|
content: SingleChildScrollView(child: Text("Cancel Payment?".tr())),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Cancel'.tr, style: const TextStyle(color: Colors.red)),
|
child: Text('Cancel'.tr(), style: const TextStyle(color: Colors.red)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop(false);
|
Navigator.of(context).pop(false);
|
||||||
Navigator.of(context).pop(false);
|
Navigator.of(context).pop(false);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Continue'.tr, style: const TextStyle(color: Colors.green)),
|
child: Text('Continue'.tr(), style: const TextStyle(color: Colors.green)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop(false);
|
Navigator.of(context).pop(false);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:customer/constant/constant.dart';
|
|||||||
import 'package:customer/controllers/dash_board_controller.dart';
|
import 'package:customer/controllers/dash_board_controller.dart';
|
||||||
import 'package:customer/controllers/dash_board_ecommarce_controller.dart';
|
import 'package:customer/controllers/dash_board_ecommarce_controller.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -41,17 +42,17 @@ class DashBoardEcommerceScreen extends StatelessWidget {
|
|||||||
items:
|
items:
|
||||||
Constant.walletSetting == false
|
Constant.walletSetting == false
|
||||||
? [
|
? [
|
||||||
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr, controller: controller),
|
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr, controller: controller),
|
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr, controller: controller),
|
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr, controller: controller),
|
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr(), controller: controller),
|
||||||
]
|
]
|
||||||
: [
|
: [
|
||||||
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr, controller: controller),
|
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr, controller: controller),
|
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_wallet.svg", label: 'Wallet'.tr, controller: controller),
|
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_wallet.svg", label: 'Wallet'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr, controller: controller),
|
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 4, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr, controller: controller),
|
navigationBarItem(isDark, index: 4, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr(), controller: controller),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import 'package:customer/widget/osm_map/map_picker_page.dart';
|
|||||||
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
||||||
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
||||||
import 'package:customer/widget/video_widget.dart';
|
import 'package:customer/widget/video_widget.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:geocoding/geocoding.dart';
|
import 'package:geocoding/geocoding.dart';
|
||||||
@@ -68,7 +69,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Get.offAll(const LoginScreen());
|
Get.offAll(const LoginScreen());
|
||||||
},
|
},
|
||||||
child: Text("Login".tr, textAlign: TextAlign.center, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 12)),
|
child: Text("Login".tr(), textAlign: TextAlign.center, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 12)),
|
||||||
)
|
)
|
||||||
: Text(Constant.userModel!.fullName(), textAlign: TextAlign.center, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 12)),
|
: Text(Constant.userModel!.fullName(), textAlign: TextAlign.center, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 12)),
|
||||||
InkWell(
|
InkWell(
|
||||||
@@ -84,7 +85,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
} else {
|
} else {
|
||||||
Constant.checkPermission(
|
Constant.checkPermission(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
// ✅ declare it once here!
|
// ✅ declare it once here!
|
||||||
ShippingAddress shippingAddress = ShippingAddress();
|
ShippingAddress shippingAddress = ShippingAddress();
|
||||||
@@ -203,7 +204,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
Get.to(const SearchScreen(), arguments: {"vendorList": controller.allNearestRestaurant});
|
Get.to(const SearchScreen(), arguments: {"vendorList": controller.allNearestRestaurant});
|
||||||
},
|
},
|
||||||
child: TextFieldWidget(
|
child: TextFieldWidget(
|
||||||
hintText: 'Search the store, item and more...'.tr,
|
hintText: 'Search the store, item and more...'.tr(),
|
||||||
controller: null,
|
controller: null,
|
||||||
enable: false,
|
enable: false,
|
||||||
backgroundColor: AppThemeData.grey50,
|
backgroundColor: AppThemeData.grey50,
|
||||||
@@ -233,7 +234,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Category".tr,
|
"Category".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16),
|
style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -243,7 +244,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
Get.to(const ViewAllCategoryScreen());
|
Get.to(const ViewAllCategoryScreen());
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View all".tr,
|
"View all".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: AppThemeData.semiBoldTextStyle(
|
style: AppThemeData.semiBoldTextStyle(
|
||||||
decoration: TextDecoration.underline,
|
decoration: TextDecoration.underline,
|
||||||
@@ -312,7 +313,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Highlights for you".tr,
|
"Highlights for you".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -324,7 +325,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View all".tr,
|
"View all".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||||
),
|
),
|
||||||
@@ -353,7 +354,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
"New Arrivals".tr,
|
"New Arrivals".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16),
|
style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -382,9 +383,9 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
radius: 10,
|
radius: 10,
|
||||||
color: isDark ? AppThemeData.greyDark100 : AppThemeData.grey100,
|
color: isDark ? AppThemeData.greyDark100 : AppThemeData.grey100,
|
||||||
borderColor: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200,
|
borderColor: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200,
|
||||||
title: 'View All Arrivals'.tr,
|
title: 'View All Arrivals'.tr(),
|
||||||
onPress: () {
|
onPress: () {
|
||||||
Get.to(RestaurantListScreen(), arguments: {"vendorList": controller.newArrivalRestaurantList, "title": "New Arrivals".tr});
|
Get.to(RestaurantListScreen(), arguments: {"vendorList": controller.newArrivalRestaurantList, "title": "New Arrivals".tr()});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -394,7 +395,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("Top Brands".tr, textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16)),
|
Text("Top Brands".tr(), textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16)),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
GridView.builder(
|
GridView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@@ -466,7 +467,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(item.title.toString(), textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(color: AppThemeData.grey900, fontSize: 18)),
|
Text(item.title.toString(), textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(color: AppThemeData.grey900, fontSize: 18)),
|
||||||
Text(
|
Text(
|
||||||
"Style up with the latest fits, now at unbeatable prices.".tr,
|
"Style up with the latest fits, now at unbeatable prices.".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: AppThemeData.regularTextStyle(color: AppThemeData.grey900, fontSize: 12),
|
style: AppThemeData.regularTextStyle(color: AppThemeData.grey900, fontSize: 12),
|
||||||
),
|
),
|
||||||
@@ -630,7 +631,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
// children: [
|
// children: [
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// child: Text(
|
// child: Text(
|
||||||
// "Highlights for you".tr,
|
// "Highlights for you".tr(),
|
||||||
// textAlign: TextAlign.start,
|
// textAlign: TextAlign.start,
|
||||||
// style: TextStyle(
|
// style: TextStyle(
|
||||||
// fontFamily: AppThemeData.semiBold,
|
// fontFamily: AppThemeData.semiBold,
|
||||||
@@ -646,7 +647,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
// child: Text(
|
// child: Text(
|
||||||
// "View all".tr,
|
// "View all".tr(),
|
||||||
// textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
// style: TextStyle(
|
// style: TextStyle(
|
||||||
// fontFamily: AppThemeData.regular,
|
// fontFamily: AppThemeData.regular,
|
||||||
@@ -686,7 +687,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("All Store".tr, textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16)),
|
Text("All Store".tr(), textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16)),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@@ -754,7 +755,7 @@ class HomeECommerceScreen extends StatelessWidget {
|
|||||||
radius: 10,
|
radius: 10,
|
||||||
color: isDark ? AppThemeData.greyDark100 : AppThemeData.grey100,
|
color: isDark ? AppThemeData.greyDark100 : AppThemeData.grey100,
|
||||||
borderColor: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200,
|
borderColor: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200,
|
||||||
title: 'View All Stores'.tr,
|
title: 'View All Stores'.tr(),
|
||||||
onPress: () {
|
onPress: () {
|
||||||
Get.to(const RestaurantListScreen(), arguments: {"vendorList": controller.allNearestRestaurant});
|
Get.to(const RestaurantListScreen(), arguments: {"vendorList": controller.allNearestRestaurant});
|
||||||
},
|
},
|
||||||
@@ -863,13 +864,13 @@ class BannerView extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (bannerModel.redirect_type == "store") {
|
if (bannerModel.redirect_type == "store") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
|
||||||
|
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||||
} else if (bannerModel.redirect_type == "product") {
|
} else if (bannerModel.redirect_type == "product") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
ProductModel? productModel = await FireStoreUtils.getProductById(bannerModel.redirect_id.toString());
|
ProductModel? productModel = await FireStoreUtils.getProductById(bannerModel.redirect_id.toString());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
|
||||||
|
|
||||||
@@ -880,7 +881,7 @@ class BannerView extends StatelessWidget {
|
|||||||
if (await canLaunchUrl(uri)) {
|
if (await canLaunchUrl(uri)) {
|
||||||
await launchUrl(uri);
|
await launchUrl(uri);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Could not launch".tr);
|
ShowToastDialog.showToast("Could not launch".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -942,13 +943,13 @@ class BannerBottomView extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (bannerModel.redirect_type == "store") {
|
if (bannerModel.redirect_type == "store") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
|
||||||
|
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||||
} else if (bannerModel.redirect_type == "product") {
|
} else if (bannerModel.redirect_type == "product") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
ProductModel? productModel = await FireStoreUtils.getProductById(bannerModel.redirect_id.toString());
|
ProductModel? productModel = await FireStoreUtils.getProductById(bannerModel.redirect_id.toString());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
|
||||||
|
|
||||||
@@ -959,7 +960,7 @@ class BannerBottomView extends StatelessWidget {
|
|||||||
if (await canLaunchUrl(uri)) {
|
if (await canLaunchUrl(uri)) {
|
||||||
await launchUrl(uri);
|
await launchUrl(uri);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Could not launch".tr);
|
ShowToastDialog.showToast("Could not launch".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1006,7 +1007,7 @@ class AdvertisementHomeCard extends StatelessWidget {
|
|||||||
final isDark = themeController.isDark.value;
|
final isDark = themeController.isDark.value;
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(model.vendorId!);
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(model.vendorId!);
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/models/user_model.dart';
|
|||||||
import 'package:customer/screen_ui/location_enable_screens/enter_manually_location.dart';
|
import 'package:customer/screen_ui/location_enable_screens/enter_manually_location.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart' show AppThemeData;
|
import 'package:customer/themes/app_them_data.dart' show AppThemeData;
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -38,14 +39,14 @@ class AddressListScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("My Addresses".tr, style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text("My Addresses".tr(), style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text("Allows users to view, manage, add, or edit delivery addresses.".tr, style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600)),
|
Text("Allows users to view, manage, add, or edit delivery addresses.".tr(), style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600)),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
Expanded(
|
Expanded(
|
||||||
child:
|
child:
|
||||||
controller.shippingAddressList.isEmpty
|
controller.shippingAddressList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Address not found".tr)
|
? Constant.showEmptyView(message: "Address not found".tr())
|
||||||
: ListView.separated(
|
: ListView.separated(
|
||||||
itemCount: controller.shippingAddressList.length,
|
itemCount: controller.shippingAddressList.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
@@ -80,7 +81,7 @@ class AddressListScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Default".tr,
|
"Default".tr(),
|
||||||
style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/utils/utils.dart';
|
|||||||
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
||||||
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
||||||
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -45,15 +46,15 @@ class EnterManuallyLocationScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
controller.mode == "Edit" ? "Edit Address".tr : "Add a New Address".tr,
|
controller.mode == "Edit" ? "Edit Address".tr() : "Add a New Address".tr(),
|
||||||
style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text("Enter your location details so we can deliver your orders quickly and accurately.".tr, style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600)),
|
Text("Enter your location details so we can deliver your orders quickly and accurately.".tr(), style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600)),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text("Set as Default Address".tr, style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600))),
|
Expanded(child: Text("Set as Default Address".tr(), style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600))),
|
||||||
Transform.scale(
|
Transform.scale(
|
||||||
scale: 0.7, // Decrease the size (try 0.5, 0.6, etc.)
|
scale: 0.7, // Decrease the size (try 0.5, 0.6, etc.)
|
||||||
child: Switch(
|
child: Switch(
|
||||||
@@ -97,8 +98,8 @@ class EnterManuallyLocationScreen extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: TextFieldWidget(
|
child: TextFieldWidget(
|
||||||
title: "Choose Location".tr,
|
title: "Choose Location".tr(),
|
||||||
hintText: "Choose Location".tr,
|
hintText: "Choose Location".tr(),
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
enable: false,
|
enable: false,
|
||||||
controller: null,
|
controller: null,
|
||||||
@@ -137,15 +138,15 @@ class EnterManuallyLocationScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
TextFieldWidget(title: "Flat/House/Floor/Building*".tr, hintText: "Enter address details".tr, controller: controller.houseBuildingTextEditingController.value),
|
TextFieldWidget(title: "Flat/House/Floor/Building*".tr(), hintText: "Enter address details".tr(), controller: controller.houseBuildingTextEditingController.value),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
TextFieldWidget(title: "Area/Sector/Locality*".tr, hintText: "Enter area/locality".tr, controller: controller.localityEditingController.value),
|
TextFieldWidget(title: "Area/Sector/Locality*".tr(), hintText: "Enter area/locality".tr(), controller: controller.localityEditingController.value),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
TextFieldWidget(title: "Nearby Landmark".tr, hintText: "Add a landmark".tr, controller: controller.landmarkEditingController.value),
|
TextFieldWidget(title: "Nearby Landmark".tr(), hintText: "Add a landmark".tr(), controller: controller.landmarkEditingController.value),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
Container(height: 1, color: AppThemeData.grey200),
|
Container(height: 1, color: AppThemeData.grey200),
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
Text("Save Address As".tr, style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
|
Text("Save Address As".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Wrap(
|
Wrap(
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
@@ -175,18 +176,18 @@ class EnterManuallyLocationScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Save Address".tr,
|
title: "Save Address".tr(),
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
if (controller.location.value.latitude == null || controller.location.value.longitude == null) {
|
if (controller.location.value.latitude == null || controller.location.value.longitude == null) {
|
||||||
ShowToastDialog.showToast("Please select Location".tr);
|
ShowToastDialog.showToast("Please select Location".tr());
|
||||||
} else if (controller.houseBuildingTextEditingController.value.text.isEmpty) {
|
} else if (controller.houseBuildingTextEditingController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please Enter Flat / House / Floor / Building".tr);
|
ShowToastDialog.showToast("Please Enter Flat / House / Floor / Building".tr());
|
||||||
} else if (controller.localityEditingController.value.text.isEmpty) {
|
} else if (controller.localityEditingController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please Enter Area / Sector / Locality".tr);
|
ShowToastDialog.showToast("Please Enter Area / Sector / Locality".tr());
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
//Common values
|
//Common values
|
||||||
controller.shippingModel.value.location = controller.location.value;
|
controller.shippingModel.value.location = controller.location.value;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import 'package:customer/themes/show_toast_dialog.dart';
|
|||||||
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
||||||
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
||||||
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:geocoding/geocoding.dart';
|
import 'package:geocoding/geocoding.dart';
|
||||||
@@ -39,7 +40,7 @@ class LocationPermissionScreen extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 25),
|
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Enable Location for a Personalized Experience".tr,
|
"Enable Location for a Personalized Experience".tr(),
|
||||||
style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
@@ -48,7 +49,7 @@ class LocationPermissionScreen extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Allow location access to discover beauty stores and services near you.".tr,
|
"Allow location access to discover beauty stores and services near you.".tr(),
|
||||||
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
@@ -56,12 +57,12 @@ class LocationPermissionScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Use current location".tr,
|
title: "Use current location".tr(),
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
Constant.checkPermission(
|
Constant.checkPermission(
|
||||||
context: context,
|
context: context,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
ShippingAddress addressModel = ShippingAddress();
|
ShippingAddress addressModel = ShippingAddress();
|
||||||
try {
|
try {
|
||||||
await Geolocator.requestPermission();
|
await Geolocator.requestPermission();
|
||||||
@@ -107,12 +108,12 @@ class LocationPermissionScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Set from map".tr,
|
title: "Set from map".tr(),
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
Constant.checkPermission(
|
Constant.checkPermission(
|
||||||
context: context,
|
context: context,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
ShippingAddress addressModel = ShippingAddress();
|
ShippingAddress addressModel = ShippingAddress();
|
||||||
try {
|
try {
|
||||||
await Geolocator.requestPermission();
|
await Geolocator.requestPermission();
|
||||||
@@ -180,7 +181,7 @@ class LocationPermissionScreen extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text("Enter Manually location".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
child: Text("Enter Manually location".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -15,12 +16,12 @@ class MaintenanceModeScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Center(child: Image.asset('assets/images/maintenance.png', height: 200, width: 200)),
|
Center(child: Image.asset('assets/images/maintenance.png', height: 200, width: 200)),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text("We'll be back soon!".tr, style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold)),
|
Text("We'll be back soon!".tr(), style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold)),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Sorry for the inconvenience but we're performing some maintenance at the moment. We'll be back online shortly!".tr,
|
"Sorry for the inconvenience but we're performing some maintenance at the moment. We'll be back online shortly!".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: const TextStyle(fontSize: 16),
|
style: const TextStyle(fontSize: 16),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/models/vendor_model.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -33,7 +34,7 @@ class AllAdvertisementScreen extends StatelessWidget {
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
"Highlights for you".tr,
|
"Highlights for you".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -42,7 +43,7 @@ class AllAdvertisementScreen extends StatelessWidget {
|
|||||||
controller.isLoading.value
|
controller.isLoading.value
|
||||||
? Constant.loader()
|
? Constant.loader()
|
||||||
: controller.advertisementList.isEmpty
|
: controller.advertisementList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Highlights for you not found.".tr)
|
? Constant.showEmptyView(message: "Highlights for you not found.".tr())
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -72,7 +73,7 @@ class AdvertisementCard extends StatelessWidget {
|
|||||||
final isDark = themeController.isDark.value;
|
final isDark = themeController.isDark.value;
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(model.vendorId!);
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(model.vendorId!);
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import 'package:customer/themes/responsive.dart';
|
|||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@@ -44,7 +45,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface),
|
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface),
|
||||||
body:
|
body:
|
||||||
cartItem.isEmpty
|
cartItem.isEmpty
|
||||||
? Constant.showEmptyView(message: "Item Not available".tr)
|
? Constant.showEmptyView(message: "Item Not available".tr())
|
||||||
: SingleChildScrollView(
|
: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -62,7 +63,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
controller.selectedAddress.value = shippingAddress;
|
controller.selectedAddress.value = shippingAddress;
|
||||||
controller.calculatePrice();
|
controller.calculatePrice();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Service not available in this area".tr);
|
ShowToastDialog.showToast("Service not available in this area".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -252,20 +253,20 @@ class CartScreen extends StatelessWidget {
|
|||||||
-1) {
|
-1) {
|
||||||
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
|
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Out of stock".tr);
|
ShowToastDialog.showToast("Out of stock".tr());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((productModel!.quantity ?? 0) > (cartProductModel.quantity ?? 0) || productModel!.quantity == -1) {
|
if ((productModel!.quantity ?? 0) > (cartProductModel.quantity ?? 0) || productModel!.quantity == -1) {
|
||||||
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
|
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Out of stock".tr);
|
ShowToastDialog.showToast("Out of stock".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((productModel!.quantity ?? 0) > (cartProductModel.quantity ?? 0) || productModel!.quantity == -1) {
|
if ((productModel!.quantity ?? 0) > (cartProductModel.quantity ?? 0) || productModel!.quantity == -1) {
|
||||||
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
|
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Out of stock".tr);
|
ShowToastDialog.showToast("Out of stock".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -285,7 +286,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Variants".tr,
|
"Variants".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -324,7 +325,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Addons".tr,
|
"Addons".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -381,7 +382,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${'Delivery Type'.tr} (${controller.selectedFoodType.value})".tr,
|
"${'Delivery Type'.tr()} (${controller.selectedFoodType.value})".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -400,13 +401,13 @@ class CartScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Instant Delivery".tr,
|
"Instant Delivery".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"Standard".tr,
|
"Standard".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||||
),
|
),
|
||||||
@@ -415,7 +416,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Radio(
|
Radio(
|
||||||
value: controller.deliveryType.value,
|
value: controller.deliveryType.value,
|
||||||
groupValue: "instant".tr,
|
groupValue: "instant".tr(),
|
||||||
activeColor: AppThemeData.primary300,
|
activeColor: AppThemeData.primary300,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
controller.deliveryType.value = "instant";
|
controller.deliveryType.value = "instant";
|
||||||
@@ -438,7 +439,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
minDateTime: DateTime.now(),
|
minDateTime: DateTime.now(),
|
||||||
displaySubmitButton: true,
|
displaySubmitButton: true,
|
||||||
pickerTitle: Text('Schedule Time'.tr),
|
pickerTitle: Text('Schedule Time'.tr()),
|
||||||
buttonSingleColor: AppThemeData.primary300,
|
buttonSingleColor: AppThemeData.primary300,
|
||||||
).show(context);
|
).show(context);
|
||||||
},
|
},
|
||||||
@@ -451,13 +452,13 @@ class CartScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Schedule Time".tr,
|
"Schedule Time".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
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,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||||
),
|
),
|
||||||
@@ -466,7 +467,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Radio(
|
Radio(
|
||||||
value: controller.deliveryType.value,
|
value: controller.deliveryType.value,
|
||||||
groupValue: "schedule".tr,
|
groupValue: "schedule".tr(),
|
||||||
activeColor: AppThemeData.primary300,
|
activeColor: AppThemeData.primary300,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
controller.deliveryType.value = "schedule";
|
controller.deliveryType.value = "schedule";
|
||||||
@@ -477,7 +478,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
minDateTime: controller.scheduleDateTime.value,
|
minDateTime: controller.scheduleDateTime.value,
|
||||||
displaySubmitButton: true,
|
displaySubmitButton: true,
|
||||||
pickerTitle: Text('Schedule Time'.tr),
|
pickerTitle: Text('Schedule Time'.tr()),
|
||||||
buttonSingleColor: AppThemeData.primary300,
|
buttonSingleColor: AppThemeData.primary300,
|
||||||
).show(context);
|
).show(context);
|
||||||
},
|
},
|
||||||
@@ -497,7 +498,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Offers & Benefits".tr,
|
"Offers & Benefits".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -520,7 +521,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Apply Coupons".tr,
|
"Apply Coupons".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -542,7 +543,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Bill Details".tr,
|
"Bill Details".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -563,7 +564,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Item totals".tr,
|
"Item totals".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -583,14 +584,14 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Delivery Fee".tr,
|
"Delivery Fee".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(controller.vendorModel.value.isSelfDelivery == true && Constant.isSelfDeliveryFeature == true)
|
(controller.vendorModel.value.isSelfDelivery == true && Constant.isSelfDeliveryFeature == true)
|
||||||
? Text(
|
? Text(
|
||||||
'Free Delivery'.tr,
|
'Free Delivery'.tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: AppThemeData.success400, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: AppThemeData.success400, fontSize: 16),
|
||||||
)
|
)
|
||||||
@@ -609,7 +610,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Coupon Discount".tr,
|
"Coupon Discount".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -630,7 +631,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Special Discount".tr,
|
"Special Discount".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -656,7 +657,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Delivery Tips".tr,
|
"Delivery Tips".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -668,7 +669,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
controller.calculatePrice();
|
controller.calculatePrice();
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Remove".tr,
|
"Remove".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||||
),
|
),
|
||||||
@@ -728,7 +729,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"To Pay".tr,
|
"To Pay".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -756,7 +757,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"Thanks with a tip!".tr,
|
"Thanks with a tip!".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -777,7 +778,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Around the clock, our delivery partners make it happen. Show gratitude with a tip..".tr,
|
"Around the clock, our delivery partners make it happen. Show gratitude with a tip..".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600),
|
||||||
),
|
),
|
||||||
@@ -927,7 +928,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Other'.tr,
|
'Other'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -952,7 +953,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Column(children: [TextFieldWidget(title: 'Remarks'.tr, controller: controller.reMarkController.value, hintText: 'Write remarks for the store'.tr, maxLine: 4)]),
|
child: Column(children: [TextFieldWidget(title: 'Remarks'.tr(), controller: controller.reMarkController.value, hintText: 'Write remarks for the store'.tr(), maxLine: 4)]),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -973,14 +974,14 @@ class CartScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: Text("Cashback Offer".tr, style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontSize: 13)),
|
child: Text("Cashback Offer".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontSize: 13)),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${"Cashback Name :".tr} ${controller.bestCashback.value.title ?? ''}",
|
"${"Cashback Name :".tr()} ${controller.bestCashback.value.title ?? ''}",
|
||||||
style: TextStyle(color: AppThemeData.success300, fontFamily: AppThemeData.semiBold, fontSize: 13),
|
style: TextStyle(color: AppThemeData.success300, fontFamily: AppThemeData.semiBold, fontSize: 13),
|
||||||
),
|
),
|
||||||
Text(
|
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, fontSize: 13),
|
style: TextStyle(color: AppThemeData.success300, fontFamily: AppThemeData.semiBold, fontSize: 13),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -1034,7 +1035,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Pay Via".tr,
|
"Pay Via".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontSize: 12),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontSize: 12),
|
||||||
),
|
),
|
||||||
@@ -1060,7 +1061,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
: isDark
|
: isDark
|
||||||
? AppThemeData.grey800
|
? AppThemeData.grey800
|
||||||
: AppThemeData.grey100,
|
: AppThemeData.grey100,
|
||||||
title: "Pay Now".tr,
|
title: "Pay Now".tr(),
|
||||||
height: 5,
|
height: 5,
|
||||||
color:
|
color:
|
||||||
controller.selectedPaymentMethod.value != ''
|
controller.selectedPaymentMethod.value != ''
|
||||||
@@ -1071,11 +1072,11 @@ class CartScreen extends StatelessWidget {
|
|||||||
fontSizes: 16,
|
fontSizes: 16,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
if ((controller.couponAmount.value >= 1) && (controller.couponAmount.value > controller.totalAmount.value)) {
|
if ((controller.couponAmount.value >= 1) && (controller.couponAmount.value > 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);
|
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());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((controller.specialDiscountAmount.value >= 1) && (controller.specialDiscountAmount.value > controller.totalAmount.value)) {
|
if ((controller.specialDiscountAmount.value >= 1) && (controller.specialDiscountAmount.value > 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);
|
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());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (controller.isOrderPlaced.value == false) {
|
if (controller.isOrderPlaced.value == false) {
|
||||||
@@ -1109,7 +1110,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
) {
|
) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
CreateRazorPayOrderModel result = value;
|
CreateRazorPayOrderModel result = value;
|
||||||
controller.openCheckout(amount: controller.totalAmount.value.toString(), orderId: result.id);
|
controller.openCheckout(amount: controller.totalAmount.value.toString(), orderId: result.id);
|
||||||
@@ -1117,7 +1118,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
controller.isOrderPlaced.value = false;
|
controller.isOrderPlaced.value = false;
|
||||||
ShowToastDialog.showToast("Please select payment method".tr);
|
ShowToastDialog.showToast("Please select payment method".tr());
|
||||||
}
|
}
|
||||||
controller.isOrderPlaced.value = false;
|
controller.isOrderPlaced.value = false;
|
||||||
}
|
}
|
||||||
@@ -1162,16 +1163,16 @@ class CartScreen extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
TextFieldWidget(
|
TextFieldWidget(
|
||||||
title: 'Tips Amount'.tr,
|
title: 'Tips Amount'.tr(),
|
||||||
controller: controller.tipsController.value,
|
controller: controller.tipsController.value,
|
||||||
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true),
|
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true),
|
||||||
textInputAction: TextInputAction.done,
|
textInputAction: TextInputAction.done,
|
||||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
||||||
prefix: Padding(
|
prefix: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||||
child: Text(Constant.currencyModel!.symbol.tr, style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontSize: 18)),
|
child: Text(Constant.currencyModel!.symbol.tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontSize: 18)),
|
||||||
),
|
),
|
||||||
hintText: 'Enter Tips Amount'.tr,
|
hintText: 'Enter Tips Amount'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Row(
|
Row(
|
||||||
@@ -1179,7 +1180,7 @@ class CartScreen extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Cancel".tr,
|
title: "Cancel".tr(),
|
||||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||||
textColor: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
textColor: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
@@ -1191,12 +1192,12 @@ class CartScreen extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Add".tr,
|
title: "Add".tr(),
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
if (controller.tipsController.value.text.isEmpty) {
|
if (controller.tipsController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter tips Amount".tr);
|
ShowToastDialog.showToast("Please enter tips Amount".tr());
|
||||||
} else {
|
} else {
|
||||||
controller.deliveryTips.value = double.parse(controller.tipsController.value.text);
|
controller.deliveryTips.value = double.parse(controller.tipsController.value.text);
|
||||||
controller.calculatePrice();
|
controller.calculatePrice();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/themes/responsive.dart';
|
|||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
import 'package:customer/widget/my_separator.dart';
|
import 'package:customer/widget/my_separator.dart';
|
||||||
import 'package:dotted_border/dotted_border.dart';
|
import 'package:dotted_border/dotted_border.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
@@ -27,20 +28,20 @@ class CouponListScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Coupon Code".tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
title: Text("Coupon Code".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
bottom: PreferredSize(
|
bottom: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(55),
|
preferredSize: const Size.fromHeight(55),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: TextFieldWidget(
|
child: TextFieldWidget(
|
||||||
hintText: 'Enter coupon code'.tr,
|
hintText: 'Enter coupon code'.tr(),
|
||||||
controller: controller.couponCodeController.value,
|
controller: controller.couponCodeController.value,
|
||||||
suffix: Padding(
|
suffix: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (controller.couponCodeController.value.text.isEmpty) {
|
if (controller.couponCodeController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter coupon code".tr);
|
ShowToastDialog.showToast("Please enter coupon code".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CouponModel? matchedCoupon = controller.couponList.firstWhereOrNull((coupon) => coupon.code!.toLowerCase() == controller.couponCodeController.value.text.toLowerCase());
|
CouponModel? matchedCoupon = controller.couponList.firstWhereOrNull((coupon) => coupon.code!.toLowerCase() == controller.couponCodeController.value.text.toLowerCase());
|
||||||
@@ -52,14 +53,14 @@ class CouponListScreen extends StatelessWidget {
|
|||||||
controller.calculatePrice();
|
controller.calculatePrice();
|
||||||
Get.back();
|
Get.back();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Coupon code not applied".tr);
|
ShowToastDialog.showToast("Coupon code not applied".tr());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Invalid Coupon".tr);
|
ShowToastDialog.showToast("Invalid Coupon".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Apply".tr,
|
"Apply".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||||
),
|
),
|
||||||
@@ -93,7 +94,7 @@ class CouponListScreen extends StatelessWidget {
|
|||||||
child: RotatedBox(
|
child: RotatedBox(
|
||||||
quarterTurns: -1,
|
quarterTurns: -1,
|
||||||
child: Text(
|
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,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),
|
||||||
),
|
),
|
||||||
@@ -132,11 +133,11 @@ class CouponListScreen extends StatelessWidget {
|
|||||||
controller.calculatePrice();
|
controller.calculatePrice();
|
||||||
Get.back();
|
Get.back();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Coupon code not applied".tr);
|
ShowToastDialog.showToast("Coupon code not applied".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Tap To Apply".tr,
|
"Tap To Apply".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/models/cart_product_model.dart';
|
|||||||
import 'package:customer/screen_ui/ecommarce/dash_board_e_commerce_screen.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/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -38,12 +39,12 @@ class OrderPlacingScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Order Placed".tr,
|
"Order Placed".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 34, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 34, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Hang tight — your items are being delivered quickly and safely!".tr,
|
"Hang tight — your items are being delivered quickly and safely!".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
@@ -63,7 +64,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
|||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Order ID".tr,
|
"Order ID".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -92,12 +93,12 @@ class OrderPlacingScreen extends StatelessWidget {
|
|||||||
Center(child: Image.asset("assets/images/ic_timer.gif", height: 140)),
|
Center(child: Image.asset("assets/images/ic_timer.gif", height: 140)),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"Placing your order".tr,
|
"Placing your order".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 34, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 34, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Take a moment to review your order before proceeding to checkout.".tr,
|
"Take a moment to review your order before proceeding to checkout.".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
@@ -117,7 +118,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
|||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Delivery Address".tr,
|
"Delivery Address".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -150,7 +151,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
|||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Order Summary".tr,
|
"Order Summary".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -167,12 +168,12 @@ class OrderPlacingScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${cartProductModel.quantity} x".tr,
|
"${cartProductModel.quantity} x".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${cartProductModel.name}".tr,
|
"${cartProductModel.name}".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
@@ -196,7 +197,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
|||||||
controller.isPlacing.value
|
controller.isPlacing.value
|
||||||
? RoundedButtonFill(
|
? RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Track Order".tr,
|
title: "Track Order".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
@@ -215,7 +216,7 @@ class OrderPlacingScreen extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: RoundedButtonFill(
|
: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Track Order".tr,
|
title: "Track Order".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||||
textColor: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
textColor: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:customer/constant/constant.dart';
|
|||||||
import 'package:customer/controllers/cart_controller.dart';
|
import 'package:customer/controllers/cart_controller.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -26,7 +27,7 @@ class SelectPaymentScreen extends StatelessWidget {
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
"Payment Option".tr,
|
"Payment Option".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.medium,
|
fontFamily: AppThemeData.medium,
|
||||||
@@ -42,7 +43,7 @@ class SelectPaymentScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Preferred Payment".tr,
|
"Preferred Payment".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
@@ -92,7 +93,7 @@ class SelectPaymentScreen extends StatelessWidget {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Other Payment Options".tr,
|
"Other Payment Options".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
@@ -180,7 +181,7 @@ class SelectPaymentScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "${'Pay Now'.tr} | ${Constant.amountShow(amount: controller.totalAmount.value.toString())}".tr,
|
title: "${'Pay Now'.tr()} | ${Constant.amountShow(amount: controller.totalAmount.value.toString())}".tr(),
|
||||||
height: 5,
|
height: 5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/controllers/cashback_controller.dart';
|
import 'package:customer/controllers/cashback_controller.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ class CashbackOffersListScreen extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Cashback Offers".tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
title: Text("Cashback Offers".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
),
|
),
|
||||||
body:
|
body:
|
||||||
@@ -59,11 +60,11 @@ class CashbackOffersListScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
Text(
|
Text(
|
||||||
"${"Min spent".tr} ${Constant.amountShow(amount: "${controller.cashbackList[index].minimumPurchaseAmount ?? 0.0}")} | ${"Valid till".tr} ${Constant.timestampToDateTime2(controller.cashbackList[index].endDate!)}",
|
"${"Min spent".tr()} ${Constant.amountShow(amount: "${controller.cashbackList[index].minimumPurchaseAmount ?? 0.0}")} | ${"Valid till".tr()} ${Constant.timestampToDateTime2(controller.cashbackList[index].endDate!)}",
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontSize: 14),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontSize: 14),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${"Maximum cashback up to".tr} ${Constant.amountShow(amount: "${controller.cashbackList[index].maximumDiscount ?? 0.0}")}",
|
"${"Maximum cashback up to".tr()} ${Constant.amountShow(amount: "${controller.cashbackList[index].maximumDiscount ?? 0.0}")}",
|
||||||
style: TextStyle(color: isDark ? AppThemeData.primary200 : AppThemeData.primary300, fontFamily: AppThemeData.regular, fontSize: 14),
|
style: TextStyle(color: isDark ? AppThemeData.primary200 : AppThemeData.primary300, fontFamily: AppThemeData.regular, fontSize: 14),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:customer/controllers/change_language_controller.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
import 'package:customer/utils/preferences.dart';
|
import 'package:customer/utils/preferences.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
@@ -30,11 +31,11 @@ class ChangeLanguageScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Change Language".tr,
|
"Change Language".tr(),
|
||||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Select your preferred language for a personalized app experience.".tr,
|
"Select your preferred language for a personalized app experience.".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:customer/constant/constant.dart';
|
|||||||
import 'package:customer/controllers/chat_controller.dart';
|
import 'package:customer/controllers/chat_controller.dart';
|
||||||
import 'package:customer/models/conversation_model.dart';
|
import 'package:customer/models/conversation_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@@ -55,7 +56,7 @@ class ChatScreen extends StatelessWidget {
|
|||||||
ConversationModel inboxModel = ConversationModel.fromJson(documentSnapshots[index].data() as Map<String, dynamic>);
|
ConversationModel inboxModel = ConversationModel.fromJson(documentSnapshots[index].data() as Map<String, dynamic>);
|
||||||
return chatItemView(isDark, inboxModel.senderId == FireStoreUtils.getCurrentUid(), inboxModel);
|
return chatItemView(isDark, inboxModel.senderId == FireStoreUtils.getCurrentUid(), inboxModel);
|
||||||
},
|
},
|
||||||
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr),
|
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr()),
|
||||||
// orderBy is compulsory to enable pagination
|
// orderBy is compulsory to enable pagination
|
||||||
query: FirebaseFirestore.instance
|
query: FirebaseFirestore.instance
|
||||||
.collection(
|
.collection(
|
||||||
@@ -103,7 +104,7 @@ class ChatScreen extends StatelessWidget {
|
|||||||
contentPadding: const EdgeInsets.only(top: 3, left: 10),
|
contentPadding: const EdgeInsets.only(top: 3, left: 10),
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
hintText: 'Type message here....'.tr,
|
hintText: 'Type message here....'.tr(),
|
||||||
),
|
),
|
||||||
onSubmitted: (value) async {
|
onSubmitted: (value) async {
|
||||||
if (controller.messageController.value.text.isNotEmpty) {
|
if (controller.messageController.value.text.isNotEmpty) {
|
||||||
@@ -245,7 +246,7 @@ class ChatScreen extends StatelessWidget {
|
|||||||
|
|
||||||
void onCameraClick(BuildContext context, ChatController controller) {
|
void onCameraClick(BuildContext context, ChatController controller) {
|
||||||
final action = CupertinoActionSheet(
|
final action = CupertinoActionSheet(
|
||||||
message: Text('Send Media'.tr, style: const TextStyle(fontSize: 15.0)),
|
message: Text('Send Media'.tr(), style: const TextStyle(fontSize: 15.0)),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
CupertinoActionSheetAction(
|
CupertinoActionSheetAction(
|
||||||
isDefaultAction: false,
|
isDefaultAction: false,
|
||||||
@@ -257,7 +258,7 @@ class ChatScreen extends StatelessWidget {
|
|||||||
controller.sendMessage('', url, '', 'image');
|
controller.sendMessage('', url, '', 'image');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text("Choose image from gallery".tr),
|
child: Text("Choose image from gallery".tr()),
|
||||||
),
|
),
|
||||||
CupertinoActionSheetAction(
|
CupertinoActionSheetAction(
|
||||||
isDefaultAction: false,
|
isDefaultAction: false,
|
||||||
@@ -271,7 +272,7 @@ class ChatScreen extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text("Choose video from gallery".tr),
|
child: Text("Choose video from gallery".tr()),
|
||||||
),
|
),
|
||||||
CupertinoActionSheetAction(
|
CupertinoActionSheetAction(
|
||||||
isDestructiveAction: false,
|
isDestructiveAction: false,
|
||||||
@@ -283,7 +284,7 @@ class ChatScreen extends StatelessWidget {
|
|||||||
controller.sendMessage('', url, '', 'image');
|
controller.sendMessage('', url, '', 'image');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text("Take a picture".tr),
|
child: Text("Take a picture".tr()),
|
||||||
),
|
),
|
||||||
// CupertinoActionSheetAction(
|
// CupertinoActionSheetAction(
|
||||||
// isDestructiveAction: false,
|
// isDestructiveAction: false,
|
||||||
@@ -295,11 +296,11 @@ class ChatScreen extends StatelessWidget {
|
|||||||
// controller.sendMessage('', videoContainer.videoUrl, videoContainer.thumbnailUrl, 'video');
|
// controller.sendMessage('', videoContainer.videoUrl, videoContainer.thumbnailUrl, 'video');
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
// child: Text("Record video".tr),
|
// child: Text("Record video".tr()),
|
||||||
// )
|
// )
|
||||||
],
|
],
|
||||||
cancelButton: CupertinoActionSheetAction(
|
cancelButton: CupertinoActionSheetAction(
|
||||||
child: Text('Cancel'.tr),
|
child: Text('Cancel'.tr()),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:customer/models/user_model.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ class DriverInboxScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Driver Inbox".tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
title: Text("Driver Inbox".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
body: FirestorePagination(
|
body: FirestorePagination(
|
||||||
//item builder type is compulsory.
|
//item builder type is compulsory.
|
||||||
@@ -37,7 +38,7 @@ class DriverInboxScreen extends StatelessWidget {
|
|||||||
InboxModel inboxModel = InboxModel.fromJson(data!);
|
InboxModel inboxModel = InboxModel.fromJson(data!);
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
UserModel? customer = await FireStoreUtils.getUserProfile(inboxModel.customerId.toString());
|
UserModel? customer = await FireStoreUtils.getUserProfile(inboxModel.customerId.toString());
|
||||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(inboxModel.restaurantId.toString());
|
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(inboxModel.restaurantId.toString());
|
||||||
@@ -113,7 +114,7 @@ class DriverInboxScreen extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr),
|
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr()),
|
||||||
// orderBy is compulsory to enable pagination
|
// orderBy is compulsory to enable pagination
|
||||||
query: FirebaseFirestore.instance.collection('chat_driver').where("customerId", isEqualTo: FireStoreUtils.getCurrentUid()).orderBy('createdAt', descending: true),
|
query: FirebaseFirestore.instance.collection('chat_driver').where("customerId", isEqualTo: FireStoreUtils.getCurrentUid()).orderBy('createdAt', descending: true),
|
||||||
//Change types customerId
|
//Change types customerId
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:customer/themes/responsive.dart';
|
|||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
import 'package:customer/widget/firebase_pagination/src/fireStore_pagination.dart';
|
import 'package:customer/widget/firebase_pagination/src/fireStore_pagination.dart';
|
||||||
import 'package:customer/widget/firebase_pagination/src/models/view_type.dart';
|
import 'package:customer/widget/firebase_pagination/src/models/view_type.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ class RestaurantInboxScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Store Inbox".tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
title: Text("Store Inbox".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
body: FirestorePagination(
|
body: FirestorePagination(
|
||||||
//item builder type is compulsory.
|
//item builder type is compulsory.
|
||||||
@@ -38,7 +39,7 @@ class RestaurantInboxScreen extends StatelessWidget {
|
|||||||
InboxModel inboxModel = InboxModel.fromJson(data!);
|
InboxModel inboxModel = InboxModel.fromJson(data!);
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
UserModel? customer = await FireStoreUtils.getUserProfile(inboxModel.customerId.toString());
|
UserModel? customer = await FireStoreUtils.getUserProfile(inboxModel.customerId.toString());
|
||||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(inboxModel.restaurantId.toString());
|
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(inboxModel.restaurantId.toString());
|
||||||
@@ -115,7 +116,7 @@ class RestaurantInboxScreen extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr),
|
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr()),
|
||||||
// orderBy is compulsory to enable pagination
|
// orderBy is compulsory to enable pagination
|
||||||
query: FirebaseFirestore.instance.collection('chat_store').where("customerId", isEqualTo: FireStoreUtils.getCurrentUid()).orderBy('createdAt', descending: true),
|
query: FirebaseFirestore.instance.collection('chat_store').where("customerId", isEqualTo: FireStoreUtils.getCurrentUid()).orderBy('createdAt', descending: true),
|
||||||
//Change types customerId
|
//Change types customerId
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/controllers/dash_board_controller.dart';
|
import 'package:customer/controllers/dash_board_controller.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -40,17 +41,17 @@ class DashBoardScreen extends StatelessWidget {
|
|||||||
items:
|
items:
|
||||||
Constant.walletSetting == false
|
Constant.walletSetting == false
|
||||||
? [
|
? [
|
||||||
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr, controller: controller),
|
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr, controller: controller),
|
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr, controller: controller),
|
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr, controller: controller),
|
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr(), controller: controller),
|
||||||
]
|
]
|
||||||
: [
|
: [
|
||||||
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr, controller: controller),
|
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr, controller: controller),
|
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_wallet.svg", label: 'Wallet'.tr, controller: controller),
|
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_wallet.svg", label: 'Wallet'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr, controller: controller),
|
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr(), controller: controller),
|
||||||
navigationBarItem(isDark, index: 4, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr, controller: controller),
|
navigationBarItem(isDark, index: 4, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr(), controller: controller),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/controllers/dine_in_booking_details_controller.dart';
|
import 'package:customer/controllers/dine_in_booking_details_controller.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -24,7 +25,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
title: Text(
|
title: Text(
|
||||||
"Dine in Bookings".tr,
|
"Dine in Bookings".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -43,11 +44,11 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${'Order'.tr} ${Constant.orderId(orderId: controller.bookingModel.value.id.toString())}",
|
"${'Order'.tr()} ${Constant.orderId(orderId: controller.bookingModel.value.id.toString())}",
|
||||||
style: TextStyle(fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
style: TextStyle(fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${controller.bookingModel.value.totalGuest} ${'Peoples'.tr}",
|
"${controller.bookingModel.value.totalGuest} ${'Peoples'.tr()}",
|
||||||
style: TextStyle(fontSize: 14, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(fontSize: 14, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -113,7 +114,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View in Map".tr,
|
"View in Map".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||||
@@ -133,7 +134,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Call Now".tr,
|
"Call Now".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||||
@@ -153,7 +154,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"Booking Details".tr,
|
"Booking Details".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -169,7 +170,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Name".tr,
|
"Name".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -188,7 +189,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Phone number".tr,
|
"Phone number".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -207,7 +208,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Date and Time".tr,
|
"Date and Time".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -226,7 +227,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Guest".tr,
|
"Guest".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -245,7 +246,7 @@ class DineInBookingDetails extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Discount".tr,
|
"Discount".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:customer/controllers/dine_in_booking_controller.dart';
|
|||||||
import 'package:customer/models/dine_in_booking_model.dart';
|
import 'package:customer/models/dine_in_booking_model.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -27,7 +28,7 @@ class DineInBookingScreen extends StatelessWidget {
|
|||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
title: Text(
|
title: Text(
|
||||||
"Dine in Bookings".tr,
|
"Dine in Bookings".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -57,7 +58,7 @@ class DineInBookingScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Upcoming".tr,
|
"Upcoming".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
@@ -88,7 +89,7 @@ class DineInBookingScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child: Text(
|
child: Text(
|
||||||
"History".tr,
|
"History".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
@@ -118,7 +119,7 @@ class DineInBookingScreen extends StatelessWidget {
|
|||||||
child:
|
child:
|
||||||
controller.isFeature.value
|
controller.isFeature.value
|
||||||
? controller.featureList.isEmpty
|
? controller.featureList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Upcoming Booking not found.".tr)
|
? Constant.showEmptyView(message: "Upcoming Booking not found.".tr())
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@@ -130,7 +131,7 @@ class DineInBookingScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
: controller.historyList.isEmpty
|
: controller.historyList.isEmpty
|
||||||
? Constant.showEmptyView(message: "History not found.".tr)
|
? Constant.showEmptyView(message: "History not found.".tr())
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
itemCount: controller.historyList.length,
|
itemCount: controller.historyList.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@@ -208,7 +209,7 @@ class DineInBookingScreen extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text("Name".tr, style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400))),
|
Expanded(child: Text("Name".tr(), style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400))),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"${orderModel.guestFirstName} ${orderModel.guestLastName}",
|
"${orderModel.guestFirstName} ${orderModel.guestLastName}",
|
||||||
@@ -223,7 +224,7 @@ class DineInBookingScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("Guest Number".tr, style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400)),
|
child: Text("Guest Number".tr(), style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400)),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:customer/themes/responsive.dart';
|
|||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -27,7 +28,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
title: Text("Book Table".tr, style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
title: Text("Book Table".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
@@ -43,7 +44,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Numbers of Guests".tr,
|
"Numbers of Guests".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -105,7 +106,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"When are you visiting?".tr,
|
"When are you visiting?".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -151,9 +152,9 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
Constant.calculateDifference(controller.dateList[index].date.toDate()) == 0
|
Constant.calculateDifference(controller.dateList[index].date.toDate()) == 0
|
||||||
? "Today".tr
|
? "Today".tr()
|
||||||
: Constant.calculateDifference(controller.dateList[index].date.toDate()) == 1
|
: Constant.calculateDifference(controller.dateList[index].date.toDate()) == 1
|
||||||
? "Tomorrow".tr
|
? "Tomorrow".tr()
|
||||||
: DateFormat('EEE').format(controller.dateList[index].date.toDate()),
|
: DateFormat('EEE').format(controller.dateList[index].date.toDate()),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
@@ -185,7 +186,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "${controller.dateList[index].discountPer}%".tr,
|
title: "${controller.dateList[index].discountPer}%".tr(),
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
width: 12,
|
width: 12,
|
||||||
@@ -201,7 +202,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Select time slot and scroll to see offers".tr,
|
"Select time slot and scroll to see offers".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -256,7 +257,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Special Occasion".tr,
|
"Special Occasion".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -264,7 +265,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
controller.selectedOccasion.value = "";
|
controller.selectedOccasion.value = "";
|
||||||
},
|
},
|
||||||
child: Text("Clear".tr, style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500)),
|
child: Text("Clear".tr(), style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -282,7 +283,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
visualDensity: const VisualDensity(horizontal: 0, vertical: -4),
|
visualDensity: const VisualDensity(horizontal: 0, vertical: -4),
|
||||||
dense: true,
|
dense: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
//'${controller.occasionList[i]}'.tr,
|
//'${controller.occasionList[i]}'.tr(),
|
||||||
controller.getLocalizedOccasion(controller.occasionList[i]),
|
controller.getLocalizedOccasion(controller.occasionList[i]),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
@@ -301,7 +302,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
visualDensity: const VisualDensity(horizontal: 0, vertical: -4),
|
visualDensity: const VisualDensity(horizontal: 0, vertical: -4),
|
||||||
dense: true,
|
dense: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Is this your first visit?'.tr,
|
'Is this your first visit?'.tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
leading: Checkbox(
|
leading: Checkbox(
|
||||||
@@ -319,7 +320,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Personal Details".tr,
|
"Personal Details".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -358,11 +359,11 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Additional Requests".tr,
|
"Additional Requests".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
TextFieldWidget(controller: controller.additionRequestController.value, hintText: 'Add message here....'.tr, maxLine: 5),
|
TextFieldWidget(controller: controller.additionRequestController.value, hintText: 'Add message here....'.tr(), maxLine: 5),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -375,7 +376,7 @@ class BookTableScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Book Now".tr,
|
title: "Book Now".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:customer/models/favourite_model.dart';
|
|||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import '../../../service/fire_store_utils.dart';
|
import '../../../service/fire_store_utils.dart';
|
||||||
import '../../../themes/show_toast_dialog.dart';
|
import '../../../themes/show_toast_dialog.dart';
|
||||||
@@ -215,7 +216,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
Get.to(const ReviewListScreen(), arguments: {"vendorModel": controller.vendorModel.value});
|
Get.to(const ReviewListScreen(), arguments: {"vendorModel": controller.vendorModel.value});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"${controller.vendorModel.value.reviewsCount} ${'Ratings'.tr}",
|
"${controller.vendorModel.value.reviewsCount} ${'Ratings'.tr()}",
|
||||||
style: TextStyle(decoration: TextDecoration.underline, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700, fontFamily: AppThemeData.regular),
|
style: TextStyle(decoration: TextDecoration.underline, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700, fontFamily: AppThemeData.regular),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -226,7 +227,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
controller.isOpen.value ? "Open".tr : "Close".tr,
|
controller.isOpen.value ? "Open".tr() : "Close".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -243,7 +244,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
timeShowBottomSheet(context, controller);
|
timeShowBottomSheet(context, controller);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View Timings".tr,
|
"View Timings".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -259,7 +260,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Padding(padding: const EdgeInsets.symmetric(horizontal: 10), child: Icon(Icons.circle, size: 5, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500)),
|
Padding(padding: const EdgeInsets.symmetric(horizontal: 10), child: Icon(Icons.circle, size: 5, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500)),
|
||||||
Text(
|
Text(
|
||||||
"${Constant.amountShow(amount: controller.vendorModel.value.restaurantCost)} ${'for two'.tr}".tr,
|
"${Constant.amountShow(amount: controller.vendorModel.value.restaurantCost)} ${'for two'.tr()}".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -277,7 +278,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"Also applicable on food delivery".tr,
|
"Also applicable on food delivery".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -292,7 +293,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (Constant.userModel == null) {
|
if (Constant.userModel == null) {
|
||||||
ShowToastDialog.showToast("Please log in to the application. You are not logged in.".tr);
|
ShowToastDialog.showToast("Please log in to the application. You are not logged in.".tr());
|
||||||
} else {
|
} else {
|
||||||
Get.to(const BookTableScreen(), arguments: {"vendorModel": controller.vendorModel.value});
|
Get.to(const BookTableScreen(), arguments: {"vendorModel": controller.vendorModel.value});
|
||||||
}
|
}
|
||||||
@@ -326,7 +327,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Table Booking".tr,
|
"Table Booking".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||||
@@ -335,7 +336,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Quick Conformations".tr,
|
"Quick Conformations".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
|
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
|
||||||
@@ -386,7 +387,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Available food delivery".tr,
|
"Available food delivery".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||||
@@ -395,7 +396,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"in 30-45 mins.".tr,
|
"in 30-45 mins.".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
|
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
|
||||||
@@ -421,7 +422,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"Menu".tr,
|
"Menu".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -466,7 +467,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Location, Timing & Costs".tr,
|
"Location, Timing & Costs".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -508,7 +509,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View on Map".tr,
|
"View on Map".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -533,7 +534,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Timing".tr,
|
"Timing".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -545,7 +546,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
child: Text(
|
child: Text(
|
||||||
"${controller.vendorModel.value.openDineTime == '' ? "10:00 AM" : controller.vendorModel.value.openDineTime.toString()} ${"To".tr} ${controller.vendorModel.value.closeDineTime == '' ? "10:00 PM" : controller.vendorModel.value.closeDineTime.toString()}",
|
"${controller.vendorModel.value.openDineTime == '' ? "10:00 AM" : controller.vendorModel.value.openDineTime.toString()} ${"To".tr()} ${controller.vendorModel.value.closeDineTime == '' ? "10:00 PM" : controller.vendorModel.value.closeDineTime.toString()}",
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -573,7 +574,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Cost for Two".tr,
|
"Cost for Two".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -583,7 +584,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${Constant.amountShow(amount: controller.vendorModel.value.restaurantCost ?? "0.0")} ${'(approx)'.tr}",
|
"${Constant.amountShow(amount: controller.vendorModel.value.restaurantCost ?? "0.0")} ${'(approx)'.tr()}",
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -603,7 +604,7 @@ class DineInDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Cuisines".tr,
|
"Cuisines".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:customer/themes/app_them_data.dart';
|
|||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -80,7 +81,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Dine-In Reservations".tr,
|
"Dine-In Reservations".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
@@ -93,7 +94,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Book a table at your favorite restaurant and enjoy a delightful dining experience."
|
"Book a table at your favorite restaurant and enjoy a delightful dining experience."
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -131,7 +132,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(
|
Text(
|
||||||
"No Store Found in Your Area".tr,
|
"No Store Found in Your Area".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
isDark
|
isDark
|
||||||
@@ -144,7 +145,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"Currently, there are no available store in your zone. Try changing your location to find nearby options."
|
"Currently, there are no available store in your zone. Try changing your location to find nearby options."
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
@@ -158,7 +159,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Change Zone".tr,
|
title: "Change Zone".tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
@@ -182,7 +183,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
titleView(
|
titleView(
|
||||||
isDark,
|
isDark,
|
||||||
"Explore the Categories".tr,
|
"Explore the Categories".tr(),
|
||||||
() {
|
() {
|
||||||
Get.to(const ViewAllCategoryDineInScreen());
|
Get.to(const ViewAllCategoryDineInScreen());
|
||||||
},
|
},
|
||||||
@@ -218,7 +219,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"New Arrivals".tr,
|
"New Arrivals".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
@@ -244,7 +245,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View all".tr,
|
"View all".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
@@ -316,7 +317,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
vertical: 10,
|
vertical: 10,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Popular Stores".tr,
|
"Popular Stores".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
@@ -357,7 +358,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
vertical: 10,
|
vertical: 10,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
"All Stores".tr,
|
"All Stores".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
@@ -425,7 +426,7 @@ class DineInScreen extends StatelessWidget {
|
|||||||
onPress!();
|
onPress!();
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View all".tr,
|
"View all".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.regular,
|
fontFamily: AppThemeData.regular,
|
||||||
@@ -1292,7 +1293,7 @@ class BannerBottomView extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (bannerModel.redirect_type == "store") {
|
if (bannerModel.redirect_type == "store") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel =
|
VendorModel? vendorModel =
|
||||||
await FireStoreUtils.getVendorById(
|
await FireStoreUtils.getVendorById(
|
||||||
bannerModel.redirect_id.toString(),
|
bannerModel.redirect_id.toString(),
|
||||||
@@ -1304,7 +1305,7 @@ class BannerBottomView extends StatelessWidget {
|
|||||||
arguments: {"vendorModel": vendorModel},
|
arguments: {"vendorModel": vendorModel},
|
||||||
);
|
);
|
||||||
} else if (bannerModel.redirect_type == "product") {
|
} else if (bannerModel.redirect_type == "product") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
ProductModel? productModel =
|
ProductModel? productModel =
|
||||||
await FireStoreUtils.getProductById(
|
await FireStoreUtils.getProductById(
|
||||||
bannerModel.redirect_id.toString(),
|
bannerModel.redirect_id.toString(),
|
||||||
@@ -1324,7 +1325,7 @@ class BannerBottomView extends StatelessWidget {
|
|||||||
if (await canLaunchUrl(uri)) {
|
if (await canLaunchUrl(uri)) {
|
||||||
await launchUrl(uri);
|
await launchUrl(uri);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Could not launch".tr);
|
ShowToastDialog.showToast("Could not launch".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:customer/controllers/view_all_category_controller.dart';
|
|||||||
import 'package:customer/models/vendor_category_model.dart';
|
import 'package:customer/models/vendor_category_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -25,7 +26,7 @@ class ViewAllCategoryDineInScreen extends StatelessWidget {
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
"Categories".tr,
|
"Categories".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/themes/responsive.dart';
|
|||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -32,11 +33,11 @@ class EditProfileScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Profile Information".tr,
|
"Profile Information".tr(),
|
||||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"View and update your personal details, contact information, and preferences.".tr,
|
"View and update your personal details, contact information, and preferences.".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
@@ -79,13 +80,13 @@ class EditProfileScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: TextFieldWidget(title: 'First Name'.tr, controller: controller.firstNameController.value, hintText: 'First Name'.tr)),
|
Expanded(child: TextFieldWidget(title: 'First Name'.tr(), controller: controller.firstNameController.value, hintText: 'First Name'.tr())),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(child: TextFieldWidget(title: 'Last Name'.tr, controller: controller.lastNameController.value, hintText: 'Last Name'.tr)),
|
Expanded(child: TextFieldWidget(title: 'Last Name'.tr(), controller: controller.lastNameController.value, hintText: 'Last Name'.tr())),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
TextFieldWidget(title: 'Email'.tr, textInputType: TextInputType.emailAddress, controller: controller.emailController.value, hintText: 'Email'.tr, enable: false),
|
TextFieldWidget(title: 'Email'.tr(), textInputType: TextInputType.emailAddress, controller: controller.emailController.value, hintText: 'Email'.tr(), enable: false),
|
||||||
TextFieldWidget(title: 'Phone Number'.tr, textInputType: TextInputType.emailAddress, controller: controller.phoneNumberController.value, hintText: 'Phone Number'.tr, enable: false),
|
TextFieldWidget(title: 'Phone Number'.tr(), textInputType: TextInputType.emailAddress, controller: controller.phoneNumberController.value, hintText: 'Phone Number'.tr(), enable: false),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -97,7 +98,7 @@ class EditProfileScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Save Details".tr,
|
title: "Save Details".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
@@ -124,7 +125,7 @@ class EditProfileScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Padding(padding: const EdgeInsets.only(top: 15), child: Text("please select".tr, style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600))),
|
Padding(padding: const EdgeInsets.only(top: 15), child: Text("please select".tr(), style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600))),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@@ -135,7 +136,7 @@ class EditProfileScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
IconButton(onPressed: () => controller.pickFile(source: ImageSource.camera), icon: const Icon(Icons.camera_alt, size: 32)),
|
IconButton(onPressed: () => controller.pickFile(source: ImageSource.camera), icon: const Icon(Icons.camera_alt, size: 32)),
|
||||||
Padding(padding: const EdgeInsets.only(top: 3), child: Text("camera".tr, style: const TextStyle())),
|
Padding(padding: const EdgeInsets.only(top: 3), child: Text("camera".tr(), style: const TextStyle())),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -146,7 +147,7 @@ class EditProfileScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
IconButton(onPressed: () => controller.pickFile(source: ImageSource.gallery), icon: const Icon(Icons.photo_library_sharp, size: 32)),
|
IconButton(onPressed: () => controller.pickFile(source: ImageSource.gallery), icon: const Icon(Icons.photo_library_sharp, size: 32)),
|
||||||
Padding(padding: const EdgeInsets.only(top: 3), child: Text("gallery".tr, style: const TextStyle())),
|
Padding(padding: const EdgeInsets.only(top: 3), child: Text("gallery".tr(), style: const TextStyle())),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:customer/models/vendor_model.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -43,7 +44,7 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Your Favourites, All in One Place".tr,
|
"Your Favourites, All in One Place".tr(),
|
||||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -64,18 +65,18 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
Image.asset("assets/images/login.gif", height: 120),
|
Image.asset("assets/images/login.gif", height: 120),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(
|
Text(
|
||||||
"Please Log In to Continue".tr,
|
"Please Log In to Continue".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"You’re not logged in. Please sign in to access your account and explore all features.".tr,
|
"You’re not logged in. Please sign in to access your account and explore all features.".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Log in".tr,
|
title: "Log in".tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
@@ -113,7 +114,7 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Favourite Store".tr,
|
"Favourite Store".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||||
),
|
),
|
||||||
@@ -134,7 +135,7 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Favourite Item".tr,
|
"Favourite Item".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
@@ -164,7 +165,7 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
child:
|
child:
|
||||||
controller.favouriteRestaurant.value
|
controller.favouriteRestaurant.value
|
||||||
? controller.favouriteVendorList.isEmpty
|
? controller.favouriteVendorList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Favourite Store not found.".tr)
|
? Constant.showEmptyView(message: "Favourite Store not found.".tr())
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@@ -260,7 +261,7 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: AppThemeData.success600,
|
color: AppThemeData.success600,
|
||||||
@@ -370,7 +371,7 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
: controller.favouriteFoodList.isEmpty
|
: controller.favouriteFoodList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Favourite Item not found.".tr)
|
? Constant.showEmptyView(message: "Favourite Item not found.".tr())
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
itemCount: controller.favouriteFoodList.length,
|
itemCount: controller.favouriteFoodList.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@@ -384,7 +385,7 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
return Constant.loader();
|
return Constant.loader();
|
||||||
} else {
|
} else {
|
||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
return Center(child: Text('${"error".tr}: ${snapshot.error}'));
|
return Center(child: Text('${"error".tr()}: ${snapshot.error}'));
|
||||||
} else if (snapshot.data == null) {
|
} else if (snapshot.data == null) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
} else {
|
} else {
|
||||||
@@ -427,7 +428,7 @@ class FavouriteScreen extends StatelessWidget {
|
|||||||
: SvgPicture.asset("assets/icons/ic_veg.svg"),
|
: SvgPicture.asset("assets/icons/ic_veg.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
productModel.nonveg == true ? "Non Veg.".tr : "Pure veg.".tr,
|
productModel.nonveg == true ? "Non Veg.".tr() : "Pure veg.".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
|
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:customer/controllers/forgot_password_controller.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -26,13 +27,13 @@ class ForgotPasswordScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("Forgot Password".tr, style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
Text("Forgot Password".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||||
Text("No worries!! We’ll send you reset instructions".tr, style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.regular)),
|
Text("No worries!! We’ll send you reset instructions".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.regular)),
|
||||||
const SizedBox(height: 32),
|
const SizedBox(height: 32),
|
||||||
TextFieldWidget(
|
TextFieldWidget(
|
||||||
title: 'Email Address'.tr,
|
title: 'Email Address'.tr(),
|
||||||
controller: controller.emailEditingController.value,
|
controller: controller.emailEditingController.value,
|
||||||
hintText: 'Enter email address'.tr,
|
hintText: 'Enter email address'.tr(),
|
||||||
prefix: Padding(
|
prefix: Padding(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
child: SvgPicture.asset("assets/icons/ic_mail.svg", colorFilter: ColorFilter.mode(isDark ? AppThemeData.grey300 : AppThemeData.grey600, BlendMode.srcIn)),
|
child: SvgPicture.asset("assets/icons/ic_mail.svg", colorFilter: ColorFilter.mode(isDark ? AppThemeData.grey300 : AppThemeData.grey600, BlendMode.srcIn)),
|
||||||
@@ -40,12 +41,12 @@ class ForgotPasswordScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 32),
|
const SizedBox(height: 32),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Forgot Password".tr,
|
title: "Forgot Password".tr(),
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
if (controller.emailEditingController.value.text.trim().isEmpty) {
|
if (controller.emailEditingController.value.text.trim().isEmpty) {
|
||||||
ShowToastDialog.showToast("Please enter valid email".tr);
|
ShowToastDialog.showToast("Please enter valid email".tr());
|
||||||
} else {
|
} else {
|
||||||
controller.forgotPassword();
|
controller.forgotPassword();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:customer/themes/responsive.dart';
|
|||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -32,7 +33,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
"Customize Gift Card".tr,
|
"Customize Gift Card".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -97,16 +98,16 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
TextFieldWidget(
|
TextFieldWidget(
|
||||||
title: 'Choose an amount'.tr,
|
title: 'Choose an amount'.tr(),
|
||||||
controller: controller.amountController.value,
|
controller: controller.amountController.value,
|
||||||
hintText: 'Enter gift card amount'.tr,
|
hintText: 'Enter gift card amount'.tr(),
|
||||||
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true),
|
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true),
|
||||||
textInputAction: TextInputAction.done,
|
textInputAction: TextInputAction.done,
|
||||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
||||||
prefix: Padding(
|
prefix: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||||
child: Text(
|
child: Text(
|
||||||
Constant.currencyModel!.symbol.tr,
|
Constant.currencyModel!.symbol.tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontSize: 18),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontSize: 18),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -159,7 +160,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 40),
|
const SizedBox(height: 40),
|
||||||
TextFieldWidget(title: 'Add Message (Optional)'.tr, controller: controller.messageController.value, hintText: 'Add message here....'.tr, maxLine: 6),
|
TextFieldWidget(title: 'Add Message (Optional)'.tr(), controller: controller.messageController.value, hintText: 'Add message here....'.tr(), maxLine: 6),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -170,7 +171,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "Continue".tr,
|
title: "Continue".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
@@ -178,12 +179,12 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
onPress: () async {
|
onPress: () async {
|
||||||
if (controller.amountController.value.text.isNotEmpty) {
|
if (controller.amountController.value.text.isNotEmpty) {
|
||||||
if (Constant.userModel == null) {
|
if (Constant.userModel == null) {
|
||||||
ShowToastDialog.showToast("Please log in to the application. You are not logged in.".tr);
|
ShowToastDialog.showToast("Please log in to the application. You are not logged in.".tr());
|
||||||
} else {
|
} else {
|
||||||
giftCardBottomSheet(context, controller);
|
giftCardBottomSheet(context, controller);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Please enter Amount".tr);
|
ShowToastDialog.showToast("Please enter Amount".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -229,7 +230,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
decoration: ShapeDecoration(color: AppThemeData.ecommerce50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
|
decoration: ShapeDecoration(color: AppThemeData.ecommerce50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Complete payment and share this e-gift card with loved ones using any app'.tr,
|
'Complete payment and share this e-gift card with loved ones using any app'.tr(),
|
||||||
style: TextStyle(color: AppThemeData.ecommerce300, fontSize: 14, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
style: TextStyle(color: AppThemeData.ecommerce300, fontSize: 14, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -238,7 +239,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Bill Details".tr,
|
"Bill Details".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -255,7 +256,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Sub Total".tr,
|
"Sub Total".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -273,7 +274,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Grand Total".tr,
|
"Grand Total".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -294,7 +295,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"${'Gift Card expire'.tr} ${controller.selectedGiftCard.value.expiryDay} ${'days after purchase'.tr}".tr,
|
"${'Gift Card expire'.tr()} ${controller.selectedGiftCard.value.expiryDay} ${'days after purchase'.tr()}".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey500 : AppThemeData.grey400),
|
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey500 : AppThemeData.grey400),
|
||||||
),
|
),
|
||||||
@@ -309,7 +310,7 @@ class GiftCardScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "${'Pay'.tr} ${Constant.amountShow(amount: controller.amountController.value.text)}",
|
title: "${'Pay'.tr()} ${Constant.amountShow(amount: controller.amountController.value.text)}",
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:customer/constant/constant.dart';
|
|||||||
import 'package:customer/controllers/history_gift_card_controller.dart';
|
import 'package:customer/controllers/history_gift_card_controller.dart';
|
||||||
import 'package:customer/models/gift_cards_order_model.dart';
|
import 'package:customer/models/gift_cards_order_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
@@ -26,7 +27,7 @@ class HistoryGiftCard extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child:
|
child:
|
||||||
controller.giftCardsOrderList.isEmpty
|
controller.giftCardsOrderList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Purchased Gift card not found".tr)
|
? Constant.showEmptyView(message: "Purchased Gift card not found".tr())
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
itemCount: controller.giftCardsOrderList.length,
|
itemCount: controller.giftCardsOrderList.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@@ -71,7 +72,7 @@ class HistoryGiftCard extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Gift Code".tr,
|
"Gift Code".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -91,7 +92,7 @@ class HistoryGiftCard extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Gift Pin".tr,
|
"Gift Pin".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -157,7 +158,7 @@ class HistoryGiftCard extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Share'.tr,
|
'Share'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isDark ? AppThemeData.grey300 : AppThemeData.grey600,
|
color: isDark ? AppThemeData.grey300 : AppThemeData.grey600,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -174,7 +175,7 @@ class HistoryGiftCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const Expanded(child: SizedBox()),
|
const Expanded(child: SizedBox()),
|
||||||
Text(
|
Text(
|
||||||
giftCardOrderModel.redeem == true ? "Redeemed".tr : "Not Redeem".tr,
|
giftCardOrderModel.redeem == true ? "Redeemed".tr() : "Not Redeem".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: giftCardOrderModel.redeem == true ? AppThemeData.success400 : AppThemeData.danger300,
|
color: giftCardOrderModel.redeem == true ? AppThemeData.success400 : AppThemeData.danger300,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:customer/models/wallet_transaction_model.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -38,25 +39,25 @@ class RedeemGiftCardScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Redeem Gift Card".tr,
|
"Redeem Gift Card".tr(),
|
||||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Enter your gift card code to enjoy discounts and special offers on your orders.".tr,
|
"Enter your gift card code to enjoy discounts and special offers on your orders.".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
TextFieldWidget(
|
TextFieldWidget(
|
||||||
title: 'Gift Code'.tr,
|
title: 'Gift Code'.tr(),
|
||||||
controller: controller.giftCodeController.value,
|
controller: controller.giftCodeController.value,
|
||||||
hintText: 'Enter gift code'.tr,
|
hintText: 'Enter gift code'.tr(),
|
||||||
textInputType: TextInputType.number,
|
textInputType: TextInputType.number,
|
||||||
prefix: Padding(padding: const EdgeInsets.all(10), child: SvgPicture.asset("assets/icons/ic_gift_code.svg")),
|
prefix: Padding(padding: const EdgeInsets.all(10), child: SvgPicture.asset("assets/icons/ic_gift_code.svg")),
|
||||||
),
|
),
|
||||||
TextFieldWidget(
|
TextFieldWidget(
|
||||||
title: 'Gift Pin'.tr,
|
title: 'Gift Pin'.tr(),
|
||||||
controller: controller.giftPinController.value,
|
controller: controller.giftPinController.value,
|
||||||
hintText: 'Enter gift pin'.tr,
|
hintText: 'Enter gift pin'.tr(),
|
||||||
textInputType: TextInputType.number,
|
textInputType: TextInputType.number,
|
||||||
prefix: Padding(padding: const EdgeInsets.all(10), child: SvgPicture.asset("assets/icons/ic_gift_pin.svg")),
|
prefix: Padding(padding: const EdgeInsets.all(10), child: SvgPicture.asset("assets/icons/ic_gift_pin.svg")),
|
||||||
),
|
),
|
||||||
@@ -70,30 +71,30 @@ class RedeemGiftCardScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "Redeem".tr,
|
title: "Redeem".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
fontSizes: 16,
|
fontSizes: 16,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
if (controller.giftCodeController.value.text.isEmpty) {
|
if (controller.giftCodeController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please Enter Gift Code".tr);
|
ShowToastDialog.showToast("Please Enter Gift Code".tr());
|
||||||
} else if (controller.giftPinController.value.text.isEmpty) {
|
} else if (controller.giftPinController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please Enter Gift Pin".tr);
|
ShowToastDialog.showToast("Please Enter Gift Pin".tr());
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
await FireStoreUtils.checkRedeemCode(controller.giftCodeController.value.text.replaceAll(" ", "")).then((value) async {
|
await FireStoreUtils.checkRedeemCode(controller.giftCodeController.value.text.replaceAll(" ", "")).then((value) async {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
GiftCardsOrderModel giftCodeModel = value;
|
GiftCardsOrderModel giftCodeModel = value;
|
||||||
if (giftCodeModel.redeem == true) {
|
if (giftCodeModel.redeem == true) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Gift voucher already redeemed".tr);
|
ShowToastDialog.showToast("Gift voucher already redeemed".tr());
|
||||||
} else if (giftCodeModel.giftPin != controller.giftPinController.value.text) {
|
} else if (giftCodeModel.giftPin != controller.giftPinController.value.text) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Gift Pin Invalid".tr);
|
ShowToastDialog.showToast("Gift Pin Invalid".tr());
|
||||||
} else if (giftCodeModel.expireDate!.toDate().isBefore(DateTime.now())) {
|
} else if (giftCodeModel.expireDate!.toDate().isBefore(DateTime.now())) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Gift Voucher expire".tr);
|
ShowToastDialog.showToast("Gift Voucher expire".tr());
|
||||||
} else {
|
} else {
|
||||||
giftCodeModel.redeem = true;
|
giftCodeModel.redeem = true;
|
||||||
|
|
||||||
@@ -120,7 +121,7 @@ class RedeemGiftCardScreen extends StatelessWidget {
|
|||||||
DashBoardController controller = Get.put(DashBoardController());
|
DashBoardController controller = Get.put(DashBoardController());
|
||||||
controller.selectedIndex.value = 2;
|
controller.selectedIndex.value = 2;
|
||||||
}
|
}
|
||||||
ShowToastDialog.showToast("Voucher redeem successfully".tr);
|
ShowToastDialog.showToast("Voucher redeem successfully".tr());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -128,7 +129,7 @@ class RedeemGiftCardScreen extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Invalid Gift Code".tr);
|
ShowToastDialog.showToast("Invalid Gift Code".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:customer/payment/createRazorPayOrderModel.dart';
|
|||||||
import 'package:customer/payment/rozorpayConroller.dart';
|
import 'package:customer/payment/rozorpayConroller.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
@@ -26,7 +27,7 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Payment Option".tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
title: Text("Payment Option".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
@@ -35,7 +36,7 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Preferred Payment".tr,
|
"Preferred Payment".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -64,7 +65,7 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Other Payment Options".tr,
|
"Other Payment Options".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -114,7 +115,7 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "Pay Now".tr,
|
title: "Pay Now".tr(),
|
||||||
height: 5,
|
height: 5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
@@ -144,14 +145,14 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
|||||||
RazorPayController().createOrderRazorPay(amount: double.parse(controller.amountController.value.text), razorpayModel: controller.razorPayModel.value).then((value) {
|
RazorPayController().createOrderRazorPay(amount: double.parse(controller.amountController.value.text), razorpayModel: controller.razorPayModel.value).then((value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
CreateRazorPayOrderModel result = value;
|
CreateRazorPayOrderModel result = value;
|
||||||
controller.openCheckout(amount: controller.amountController.value.text, orderId: result.id);
|
controller.openCheckout(amount: controller.amountController.value.text, orderId: result.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Please select payment method".tr);
|
ShowToastDialog.showToast("Please select payment method".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:customer/controllers/category_restaurant_controller.dart';
|
|||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -26,7 +27,7 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
|||||||
controller.isLoading.value
|
controller.isLoading.value
|
||||||
? Constant.loader()
|
? Constant.loader()
|
||||||
: controller.allNearestRestaurant.isEmpty
|
: controller.allNearestRestaurant.isEmpty
|
||||||
? Constant.showEmptyView(message: "No Restaurant found".tr)
|
? Constant.showEmptyView(message: "No Restaurant found".tr())
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -87,7 +88,7 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
style: TextStyle(fontSize: 14, color: AppThemeData.success600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
style: TextStyle(fontSize: 14, color: AppThemeData.success600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/themes/app_them_data.dart';
|
|||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
import 'package:dotted_border/dotted_border.dart';
|
import 'package:dotted_border/dotted_border.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -77,7 +78,7 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".toUpperCase().tr : " off".toUpperCase().tr}",
|
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".toUpperCase().tr() : " off".toUpperCase().tr()}",
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(overflow: TextOverflow.ellipsis, fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),
|
style: TextStyle(overflow: TextOverflow.ellipsis, fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import 'package:customer/utils/preferences.dart';
|
|||||||
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
||||||
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
||||||
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@@ -92,7 +93,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(
|
Text(
|
||||||
"No Store Found in Your Area".tr,
|
"No Store Found in Your Area".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
isDark
|
isDark
|
||||||
@@ -105,7 +106,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"Currently, there are no available store in your zone. Try changing your location to find nearby options."
|
"Currently, there are no available store in your zone. Try changing your location to find nearby options."
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
@@ -118,7 +119,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Change Zone".tr,
|
title: "Change Zone".tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
@@ -229,7 +230,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader(
|
ShowToastDialog.showLoader(
|
||||||
"Please wait..."
|
"Please wait..."
|
||||||
.tr,
|
.tr(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// ✅ declare it once here!
|
// ✅ declare it once here!
|
||||||
@@ -516,7 +517,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
true
|
true
|
||||||
? 'Искать что угодно'
|
? 'Искать что угодно'
|
||||||
: 'Search the store, item and more...'
|
: 'Search the store, item and more...'
|
||||||
.tr,
|
.tr(),
|
||||||
controller: null,
|
controller: null,
|
||||||
enable: false,
|
enable: false,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
@@ -704,7 +705,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"New Arrivals".tr,
|
"New Arrivals".tr(),
|
||||||
textAlign:
|
textAlign:
|
||||||
TextAlign
|
TextAlign
|
||||||
.start,
|
.start,
|
||||||
@@ -739,7 +740,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View all".tr,
|
"View all".tr(),
|
||||||
textAlign:
|
textAlign:
|
||||||
TextAlign
|
TextAlign
|
||||||
.center,
|
.center,
|
||||||
@@ -821,7 +822,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Highlights for you"
|
"Highlights for you"
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign:
|
textAlign:
|
||||||
TextAlign
|
TextAlign
|
||||||
.start,
|
.start,
|
||||||
@@ -851,7 +852,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View all"
|
"View all"
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign:
|
textAlign:
|
||||||
TextAlign
|
TextAlign
|
||||||
.center,
|
.center,
|
||||||
@@ -967,7 +968,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Popular Stores"
|
"Popular Stores"
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign:
|
textAlign:
|
||||||
TextAlign
|
TextAlign
|
||||||
.center,
|
.center,
|
||||||
@@ -1020,7 +1021,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
vertical: 10,
|
vertical: 10,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
"All Stores".tr,
|
"All Stores".tr(),
|
||||||
textAlign:
|
textAlign:
|
||||||
TextAlign
|
TextAlign
|
||||||
.center,
|
.center,
|
||||||
@@ -1208,16 +1209,16 @@ class HomeScreen extends StatelessWidget {
|
|||||||
isDark
|
isDark
|
||||||
? AppThemeData.greyDark100
|
? AppThemeData.greyDark100
|
||||||
: AppThemeData.grey100,
|
: AppThemeData.grey100,
|
||||||
value: controller.selectedOrderTypeValue.value.tr,
|
value: controller.selectedOrderTypeValue.value.tr(),
|
||||||
icon: const Icon(Icons.keyboard_arrow_down),
|
icon: const Icon(Icons.keyboard_arrow_down),
|
||||||
items:
|
items:
|
||||||
<String>['Delivery'.tr, 'TakeAway'.tr].map((
|
<String>['Delivery'.tr(), 'TakeAway'.tr()].map((
|
||||||
String value,
|
String value,
|
||||||
) {
|
) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: value,
|
value: value,
|
||||||
child: Text(
|
child: Text(
|
||||||
value.tr,
|
value.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -1242,12 +1243,12 @@ class HomeScreen extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return CustomDialogBox(
|
return CustomDialogBox(
|
||||||
title: "Alert".tr,
|
title: "Alert".tr(),
|
||||||
descriptions:
|
descriptions:
|
||||||
"Do you really want to change the delivery option? Your cart will be empty."
|
"Do you really want to change the delivery option? Your cart will be empty."
|
||||||
.tr,
|
.tr(),
|
||||||
positiveString: "Ok".tr,
|
positiveString: "Ok".tr(),
|
||||||
negativeString: "Cancel".tr,
|
negativeString: "Cancel".tr(),
|
||||||
positiveClick: () async {
|
positiveClick: () async {
|
||||||
await Preferences.setString(
|
await Preferences.setString(
|
||||||
Preferences.foodDeliveryType,
|
Preferences.foodDeliveryType,
|
||||||
@@ -1287,7 +1288,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
name.tr,
|
name.tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.bold,
|
fontFamily: AppThemeData.bold,
|
||||||
@@ -1300,7 +1301,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
onPress!();
|
onPress!();
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View all".tr,
|
"View all".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.regular,
|
fontFamily: AppThemeData.regular,
|
||||||
@@ -1474,7 +1475,7 @@ class PopularRestaurant extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: AppThemeData.carRent600,
|
color: AppThemeData.carRent600,
|
||||||
@@ -1779,7 +1780,7 @@ class AllRestaurant extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: AppThemeData.carRent600,
|
color: AppThemeData.carRent600,
|
||||||
@@ -2076,7 +2077,7 @@ class NewArrival extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -2186,7 +2187,7 @@ class AdvertisementHomeCard extends StatelessWidget {
|
|||||||
final isDark = themeController.isDark.value;
|
final isDark = themeController.isDark.value;
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(
|
||||||
model.vendorId!,
|
model.vendorId!,
|
||||||
);
|
);
|
||||||
@@ -2499,7 +2500,7 @@ class OfferView extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Upto".tr,
|
"Upto".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -2514,7 +2515,7 @@ class OfferView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".tr : "off".tr}",
|
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".tr() : "off".tr()}",
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -2563,7 +2564,7 @@ class OfferView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -2649,7 +2650,7 @@ class BannerView extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (bannerModel.redirect_type == "store") {
|
if (bannerModel.redirect_type == "store") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel =
|
VendorModel? vendorModel =
|
||||||
await FireStoreUtils.getVendorById(
|
await FireStoreUtils.getVendorById(
|
||||||
bannerModel.redirect_id.toString(),
|
bannerModel.redirect_id.toString(),
|
||||||
@@ -2661,7 +2662,7 @@ class BannerView extends StatelessWidget {
|
|||||||
arguments: {"vendorModel": vendorModel},
|
arguments: {"vendorModel": vendorModel},
|
||||||
);
|
);
|
||||||
} else if (bannerModel.redirect_type == "product") {
|
} else if (bannerModel.redirect_type == "product") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
ProductModel? productModel =
|
ProductModel? productModel =
|
||||||
await FireStoreUtils.getProductById(
|
await FireStoreUtils.getProductById(
|
||||||
bannerModel.redirect_id.toString(),
|
bannerModel.redirect_id.toString(),
|
||||||
@@ -2681,7 +2682,7 @@ class BannerView extends StatelessWidget {
|
|||||||
if (await canLaunchUrl(uri)) {
|
if (await canLaunchUrl(uri)) {
|
||||||
await launchUrl(uri);
|
await launchUrl(uri);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Could not launch".tr);
|
ShowToastDialog.showToast("Could not launch".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2755,7 +2756,7 @@ class BannerBottomView extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (bannerModel.redirect_type == "store") {
|
if (bannerModel.redirect_type == "store") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel =
|
VendorModel? vendorModel =
|
||||||
await FireStoreUtils.getVendorById(
|
await FireStoreUtils.getVendorById(
|
||||||
bannerModel.redirect_id.toString(),
|
bannerModel.redirect_id.toString(),
|
||||||
@@ -2767,7 +2768,7 @@ class BannerBottomView extends StatelessWidget {
|
|||||||
arguments: {"vendorModel": vendorModel},
|
arguments: {"vendorModel": vendorModel},
|
||||||
);
|
);
|
||||||
} else if (bannerModel.redirect_type == "product") {
|
} else if (bannerModel.redirect_type == "product") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
ProductModel? productModel =
|
ProductModel? productModel =
|
||||||
await FireStoreUtils.getProductById(
|
await FireStoreUtils.getProductById(
|
||||||
bannerModel.redirect_id.toString(),
|
bannerModel.redirect_id.toString(),
|
||||||
@@ -2787,7 +2788,7 @@ class BannerBottomView extends StatelessWidget {
|
|||||||
if (await canLaunchUrl(uri)) {
|
if (await canLaunchUrl(uri)) {
|
||||||
await launchUrl(uri);
|
await launchUrl(uri);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Could not launch".tr);
|
ShowToastDialog.showToast("Could not launch".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2971,7 +2972,7 @@ class StoryView extends StatelessWidget {
|
|||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${"Error".tr}: ${snapshot.error}',
|
'${"Error".tr()}: ${snapshot.error}',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (snapshot.data == null) {
|
} else if (snapshot.data == null) {
|
||||||
@@ -3399,7 +3400,7 @@ class MapView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery"
|
"Free Delivery"
|
||||||
.tr,
|
.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize:
|
fontSize:
|
||||||
14,
|
14,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import 'package:customer/utils/preferences.dart';
|
|||||||
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
||||||
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
||||||
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:geocoding/geocoding.dart';
|
import 'package:geocoding/geocoding.dart';
|
||||||
@@ -69,16 +70,16 @@ class HomeScreenTwo extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Image.asset("assets/images/location.gif", height: 120),
|
Image.asset("assets/images/location.gif", height: 120),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text("No Store Found in Your Area".tr, style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
Text("No Store Found in Your Area".tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"Currently, there are no available store in your zone. Try changing your location to find nearby options.".tr,
|
"Currently, there are no available store in your zone. Try changing your location to find nearby options.".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Change Zone".tr,
|
title: "Change Zone".tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
@@ -122,7 +123,7 @@ class HomeScreenTwo extends StatelessWidget {
|
|||||||
Get.offAll(const LoginScreen());
|
Get.offAll(const LoginScreen());
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Login".tr,
|
"Login".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 12),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 12),
|
||||||
),
|
),
|
||||||
@@ -145,7 +146,7 @@ class HomeScreenTwo extends StatelessWidget {
|
|||||||
} else {
|
} else {
|
||||||
Constant.checkPermission(
|
Constant.checkPermission(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
// ✅ declare once for whole method
|
// ✅ declare once for whole method
|
||||||
ShippingAddress shippingAddress = ShippingAddress();
|
ShippingAddress shippingAddress = ShippingAddress();
|
||||||
@@ -255,8 +256,8 @@ class HomeScreenTwo extends StatelessWidget {
|
|||||||
child: TextFieldWidget(
|
child: TextFieldWidget(
|
||||||
hintText:
|
hintText:
|
||||||
Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true
|
Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true
|
||||||
? 'Search the dish, foo and more...'.tr
|
? 'Search the dish, foo and more...'.tr()
|
||||||
: 'Search the store, item and more...'.tr,
|
: 'Search the store, item and more...'.tr(),
|
||||||
controller: null,
|
controller: null,
|
||||||
enable: false,
|
enable: false,
|
||||||
prefix: Padding(padding: const EdgeInsets.symmetric(horizontal: 16), child: SvgPicture.asset("assets/icons/ic_search.svg")),
|
prefix: Padding(padding: const EdgeInsets.symmetric(horizontal: 16), child: SvgPicture.asset("assets/icons/ic_search.svg")),
|
||||||
@@ -299,7 +300,7 @@ class HomeScreenTwo extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Highlights for you".tr,
|
"Highlights for you".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -311,7 +312,7 @@ class HomeScreenTwo extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"See all".tr,
|
"See all".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||||
),
|
),
|
||||||
@@ -417,13 +418,13 @@ class HomeScreenTwo extends StatelessWidget {
|
|||||||
DropdownButton<String>(
|
DropdownButton<String>(
|
||||||
isDense: false,
|
isDense: false,
|
||||||
underline: const SizedBox(),
|
underline: const SizedBox(),
|
||||||
value: controller.selectedOrderTypeValue.value.tr,
|
value: controller.selectedOrderTypeValue.value.tr(),
|
||||||
icon: const Icon(Icons.keyboard_arrow_down),
|
icon: const Icon(Icons.keyboard_arrow_down),
|
||||||
items:
|
items:
|
||||||
<String>['Delivery'.tr, 'TakeAway'.tr].map((String value) {
|
<String>['Delivery'.tr(), 'TakeAway'.tr()].map((String value) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: value,
|
value: value,
|
||||||
child: Text(value.tr, style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
child: Text(value.tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
onChanged: (value) async {
|
onChanged: (value) async {
|
||||||
@@ -436,10 +437,10 @@ class HomeScreenTwo extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return CustomDialogBox(
|
return CustomDialogBox(
|
||||||
title: "Alert".tr,
|
title: "Alert".tr(),
|
||||||
descriptions: "Do you really want to change the delivery option? Your cart will be empty.".tr,
|
descriptions: "Do you really want to change the delivery option? Your cart will be empty.".tr(),
|
||||||
positiveString: "Ok".tr,
|
positiveString: "Ok".tr(),
|
||||||
negativeString: "Cancel".tr,
|
negativeString: "Cancel".tr(),
|
||||||
positiveClick: () async {
|
positiveClick: () async {
|
||||||
await Preferences.setString(Preferences.foodDeliveryType, value!);
|
await Preferences.setString(Preferences.foodDeliveryType, value!);
|
||||||
controller.selectedOrderTypeValue.value = value;
|
controller.selectedOrderTypeValue.value = value;
|
||||||
@@ -493,13 +494,13 @@ class CategoryView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text("Our Categories".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
Expanded(child: Text("Our Categories".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.to(const ViewAllCategoryScreen());
|
Get.to(const ViewAllCategoryScreen());
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"See all".tr,
|
"See all".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
||||||
),
|
),
|
||||||
@@ -507,7 +508,7 @@ class CategoryView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
GradientText(
|
GradientText(
|
||||||
'Best Servings Food'.tr,
|
'Best Servings Food'.tr(),
|
||||||
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
||||||
gradient: LinearGradient(colors: [Color(0xFF3961F1), Color(0xFF11D0EA)]),
|
gradient: LinearGradient(colors: [Color(0xFF3961F1), Color(0xFF11D0EA)]),
|
||||||
),
|
),
|
||||||
@@ -571,7 +572,7 @@ class OfferView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text("Large Discounts".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
Expanded(child: Text("Large Discounts".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.to(
|
Get.to(
|
||||||
@@ -580,7 +581,7 @@ class OfferView extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"See all".tr,
|
"See all".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
||||||
),
|
),
|
||||||
@@ -588,7 +589,7 @@ class OfferView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
GradientText(
|
GradientText(
|
||||||
'Save Upto 50% Off'.tr,
|
'Save Upto 50% Off'.tr(),
|
||||||
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
||||||
gradient: LinearGradient(colors: [Color(0xFF39F1C5), Color(0xFF97EA11)]),
|
gradient: LinearGradient(colors: [Color(0xFF39F1C5), Color(0xFF97EA11)]),
|
||||||
),
|
),
|
||||||
@@ -642,7 +643,7 @@ class OfferView extends StatelessWidget {
|
|||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title:
|
title:
|
||||||
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".tr : "off".tr}",
|
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".tr() : "off".tr()}",
|
||||||
color: Colors.primaries[Random().nextInt(Colors.primaries.length)],
|
color: Colors.primaries[Random().nextInt(Colors.primaries.length)],
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
width: 20,
|
width: 20,
|
||||||
@@ -694,13 +695,13 @@ class BannerView extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (bannerModel.redirect_type == "store") {
|
if (bannerModel.redirect_type == "store") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
|
||||||
|
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||||
} else if (bannerModel.redirect_type == "product") {
|
} else if (bannerModel.redirect_type == "product") {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
ProductModel? productModel = await FireStoreUtils.getProductById(bannerModel.redirect_id.toString());
|
ProductModel? productModel = await FireStoreUtils.getProductById(bannerModel.redirect_id.toString());
|
||||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
|
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
|
||||||
|
|
||||||
@@ -711,7 +712,7 @@ class BannerView extends StatelessWidget {
|
|||||||
if (await canLaunchUrl(uri)) {
|
if (await canLaunchUrl(uri)) {
|
||||||
await launchUrl(uri);
|
await launchUrl(uri);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Could not launch".tr);
|
ShowToastDialog.showToast("Could not launch".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -746,9 +747,9 @@ class StoryView extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(children: [Expanded(child: Text("Stories".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 18)))]),
|
Row(children: [Expanded(child: Text("Stories".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 18)))]),
|
||||||
GradientText(
|
GradientText(
|
||||||
'Best Food Stories Ever'.tr,
|
'Best Food Stories Ever'.tr(),
|
||||||
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
||||||
gradient: LinearGradient(colors: [Color(0xFFF1C839), Color(0xFFEA1111)]),
|
gradient: LinearGradient(colors: [Color(0xFFF1C839), Color(0xFFEA1111)]),
|
||||||
),
|
),
|
||||||
@@ -787,7 +788,7 @@ class StoryView extends StatelessWidget {
|
|||||||
return Constant.loader();
|
return Constant.loader();
|
||||||
} else {
|
} else {
|
||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
return Center(child: Text('${"Error".tr}: ${snapshot.error}'));
|
return Center(child: Text('${"Error".tr()}: ${snapshot.error}'));
|
||||||
} else if (snapshot.data == null) {
|
} else if (snapshot.data == null) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
} else {
|
} else {
|
||||||
@@ -814,7 +815,7 @@ class StoryView extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_star.svg"),
|
SvgPicture.asset("assets/icons/ic_star.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount.toString(), reviewSum: vendorModel.reviewsSum!.toStringAsFixed(0))} ${'reviews'.tr}",
|
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount.toString(), reviewSum: vendorModel.reviewsSum!.toStringAsFixed(0))} ${'reviews'.tr()}",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(color: AppThemeData.warning300, fontSize: 10, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700),
|
style: const TextStyle(color: AppThemeData.warning300, fontSize: 10, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700),
|
||||||
@@ -869,13 +870,13 @@ class RestaurantView extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text("Best Restaurants".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
Expanded(child: Text("Best Restaurants".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.to(const RestaurantListScreen(), arguments: {"vendorList": controller.allNearestRestaurant, "title": "Best Restaurants"});
|
Get.to(const RestaurantListScreen(), arguments: {"vendorList": controller.allNearestRestaurant, "title": "Best Restaurants"});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"See all".tr,
|
"See all".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
||||||
),
|
),
|
||||||
@@ -938,7 +939,7 @@ class RestaurantView extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Upto".tr,
|
"Upto".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -949,7 +950,7 @@ class RestaurantView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
discountAmountTempList.reduce(min).toString() + "% OFF".tr,
|
discountAmountTempList.reduce(min).toString() + "% OFF".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -1001,7 +1002,7 @@ class RestaurantView extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg", width: 18),
|
SvgPicture.asset("assets/icons/ic_free_delivery.svg", width: 18),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
fontFamily: AppThemeData.medium,
|
fontFamily: AppThemeData.medium,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:customer/models/favourite_model.dart';
|
|||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -122,7 +123,7 @@ class RestaurantListScreen extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
style: TextStyle(fontSize: 14, color: AppThemeData.carRent600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
style: TextStyle(fontSize: 14, color: AppThemeData.carRent600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:customer/themes/app_them_data.dart';
|
|||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
import 'package:customer/widget/story_view/controller/story_controller.dart';
|
import 'package:customer/widget/story_view/controller/story_controller.dart';
|
||||||
import 'package:customer/widget/story_view/utils.dart';
|
import 'package:customer/widget/story_view/utils.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -103,7 +104,7 @@ class MoreStoriesState extends State<MoreStories> {
|
|||||||
return SizedBox();
|
return SizedBox();
|
||||||
} else {
|
} else {
|
||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
return Center(child: Text('${"Error".tr}: ${snapshot.error}'));
|
return Center(child: Text('${"Error".tr()}: ${snapshot.error}'));
|
||||||
return Center(child: Text('Error: ${snapshot.error}'));
|
return Center(child: Text('Error: ${snapshot.error}'));
|
||||||
} else if (snapshot.data == null) {
|
} else if (snapshot.data == null) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
@@ -135,7 +136,7 @@ class MoreStoriesState extends State<MoreStories> {
|
|||||||
SvgPicture.asset("assets/icons/ic_star.svg"),
|
SvgPicture.asset("assets/icons/ic_star.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount.toString(), reviewSum: vendorModel.reviewsSum.toString())} ${'reviews'.tr}",
|
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount.toString(), reviewSum: vendorModel.reviewsSum.toString())} ${'reviews'.tr()}",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(color: AppThemeData.warning300, fontSize: 12, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700),
|
style: const TextStyle(color: AppThemeData.warning300, fontSize: 12, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:customer/controllers/view_all_category_controller.dart';
|
|||||||
import 'package:customer/models/vendor_category_model.dart';
|
import 'package:customer/models/vendor_category_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ class ViewAllCategoryScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Categories".tr, style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
title: Text("Categories".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||||
),
|
),
|
||||||
body:
|
body:
|
||||||
controller.isLoading.value
|
controller.isLoading.value
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/controllers/live_tracking_controller.dart';
|
import 'package:customer/controllers/live_tracking_controller.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -24,7 +25,7 @@ class LiveTrackingScreen extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, title: Text("Live Tracking".tr), centerTitle: false),
|
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, title: Text("Live Tracking".tr()), centerTitle: false),
|
||||||
body:
|
body:
|
||||||
Constant.selectedMapType == 'osm'
|
Constant.selectedMapType == 'osm'
|
||||||
? flutterMap.FlutterMap(
|
? flutterMap.FlutterMap(
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:customer/themes/app_them_data.dart';
|
|||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -37,7 +38,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Order Details".tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
title: Text("Order Details".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
body:
|
body:
|
||||||
controller.isLoading.value
|
controller.isLoading.value
|
||||||
@@ -56,7 +57,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${'Order'.tr} ${Constant.orderId(orderId: controller.orderModel.value.id.toString())}".tr,
|
"${'Order'.tr()} ${Constant.orderId(orderId: controller.orderModel.value.id.toString())}".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -64,7 +65,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: controller.orderModel.value.status.toString().tr,
|
title: controller.orderModel.value.status.toString().tr(),
|
||||||
color: Constant.statusColor(status: controller.orderModel.value.status.toString()),
|
color: Constant.statusColor(status: controller.orderModel.value.status.toString()),
|
||||||
width: 32,
|
width: 32,
|
||||||
height: 4.5,
|
height: 4.5,
|
||||||
@@ -125,7 +126,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: InkWell(
|
: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
|
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
|
||||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.vendor!.author.toString());
|
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.vendor!.author.toString());
|
||||||
@@ -236,7 +237,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: InkWell(
|
: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
|
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
|
||||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.vendor!.author.toString());
|
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.vendor!.author.toString());
|
||||||
@@ -314,7 +315,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Order Delivered.".tr,
|
"Order Delivered.".tr(),
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isDark ? AppThemeData.grey100 : AppThemeData.grey800,
|
color: isDark ? AppThemeData.grey100 : AppThemeData.grey800,
|
||||||
@@ -333,8 +334,8 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"${'Your Order has been Preparing and assign to the driver'.tr}\n${'Preparation Time'.tr} ${controller.orderModel.value.estimatedTimeToPrepare}"
|
"${'Your Order has been Preparing and assign to the driver'.tr()}\n${'Preparation Time'.tr()} ${controller.orderModel.value.estimatedTimeToPrepare}"
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isDark ? AppThemeData.warning400 : AppThemeData.warning400,
|
color: isDark ? AppThemeData.warning400 : AppThemeData.warning400,
|
||||||
@@ -404,7 +405,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
|
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
|
||||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.driverID.toString());
|
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.driverID.toString());
|
||||||
@@ -450,7 +451,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 14),
|
||||||
Text(
|
Text(
|
||||||
"Your Order".tr,
|
"Your Order".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -555,7 +556,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "Rate us".tr,
|
title: "Rate us".tr(),
|
||||||
height: 3.8,
|
height: 3.8,
|
||||||
width: 20,
|
width: 20,
|
||||||
color: isDark ? AppThemeData.warning300 : AppThemeData.warning300,
|
color: isDark ? AppThemeData.warning300 : AppThemeData.warning300,
|
||||||
@@ -578,7 +579,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Variants".tr,
|
"Variants".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -616,7 +617,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Addons".tr,
|
"Addons".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -670,7 +671,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// children: [
|
// children: [
|
||||||
// Text(
|
// Text(
|
||||||
// "Delivery Man".tr,
|
// "Delivery Man".tr(),
|
||||||
// textAlign: TextAlign.start,
|
// textAlign: TextAlign.start,
|
||||||
// style: TextStyle(
|
// style: TextStyle(
|
||||||
// fontFamily: AppThemeData.semiBold,
|
// fontFamily: AppThemeData.semiBold,
|
||||||
@@ -689,7 +690,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
// ],
|
// ],
|
||||||
// ),
|
// ),
|
||||||
Text(
|
Text(
|
||||||
"Bill Details".tr,
|
"Bill Details".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -706,7 +707,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Item totals".tr,
|
"Item totals".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -726,13 +727,13 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Delivery Fee".tr,
|
"Delivery Fee".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(controller.orderModel.value.vendor?.isSelfDelivery == true)
|
(controller.orderModel.value.vendor?.isSelfDelivery == true)
|
||||||
? Text('Free Delivery'.tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.regular, color: AppThemeData.success400, fontSize: 16))
|
? Text('Free Delivery'.tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.regular, color: AppThemeData.success400, fontSize: 16))
|
||||||
: Text(
|
: Text(
|
||||||
Constant.amountShow(
|
Constant.amountShow(
|
||||||
amount:
|
amount:
|
||||||
@@ -753,7 +754,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Coupon Discount".tr,
|
"Coupon Discount".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -774,7 +775,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Special Discount".tr,
|
"Special Discount".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -800,7 +801,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Delivery Tips".tr,
|
"Delivery Tips".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -860,7 +861,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"To Pay".tr,
|
"To Pay".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -878,7 +879,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 14),
|
||||||
Text(
|
Text(
|
||||||
"Order Details".tr,
|
"Order Details".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -895,17 +896,17 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Delivery type".tr,
|
"Delivery type".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
controller.orderModel.value.takeAway == true
|
controller.orderModel.value.takeAway == true
|
||||||
? "TakeAway".tr
|
? "TakeAway".tr()
|
||||||
: controller.orderModel.value.scheduleTime == null
|
: controller.orderModel.value.scheduleTime == null
|
||||||
? "Standard".tr
|
? "Standard".tr()
|
||||||
: "Schedule".tr,
|
: "Schedule".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.medium,
|
fontFamily: AppThemeData.medium,
|
||||||
@@ -926,7 +927,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Payment Method".tr,
|
"Payment Method".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -944,7 +945,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Date and Time".tr,
|
"Date and Time".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -965,7 +966,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Phone Number".tr,
|
"Phone Number".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -991,7 +992,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Remarks".tr,
|
"Remarks".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -1026,7 +1027,7 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
child:
|
child:
|
||||||
controller.orderModel.value.status == Constant.orderShipped || controller.orderModel.value.status == Constant.orderInTransit
|
controller.orderModel.value.status == Constant.orderShipped || controller.orderModel.value.status == Constant.orderInTransit
|
||||||
? RoundedButtonFill(
|
? RoundedButtonFill(
|
||||||
title: "Track Order".tr,
|
title: "Track Order".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.warning300,
|
color: AppThemeData.warning300,
|
||||||
textColor: AppThemeData.grey900,
|
textColor: AppThemeData.grey900,
|
||||||
@@ -1035,14 +1036,14 @@ class OrderDetailsScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
: RoundedButtonFill(
|
: RoundedButtonFill(
|
||||||
title: "Reorder".tr,
|
title: "Reorder".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
for (var element in controller.orderModel.value.products!) {
|
for (var element in controller.orderModel.value.products!) {
|
||||||
controller.addToCart(cartProductModel: element);
|
controller.addToCart(cartProductModel: element);
|
||||||
ShowToastDialog.showToast("Item Added In a cart".tr);
|
ShowToastDialog.showToast("Item Added In a cart".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/themes/app_them_data.dart';
|
|||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
@@ -40,16 +41,16 @@ class OrderScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Image.asset("assets/images/login.gif", height: 120),
|
Image.asset("assets/images/login.gif", height: 120),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text("Please Log In to Continue".tr, style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
Text("Please Log In to Continue".tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"You’re not logged in. Please sign in to access your account and explore all features.".tr,
|
"You’re not logged in. Please sign in to access your account and explore all features.".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Log in".tr,
|
title: "Log in".tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
@@ -74,11 +75,11 @@ class OrderScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"My Order".tr,
|
"My Order".tr(),
|
||||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Keep track your delivered, In Progress and Rejected item all in just one place.".tr,
|
"Keep track your delivered, In Progress and Rejected item all in just one place.".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -109,11 +110,11 @@ class OrderScreen extends StatelessWidget {
|
|||||||
dividerColor: Colors.transparent,
|
dividerColor: Colors.transparent,
|
||||||
indicatorSize: TabBarIndicatorSize.tab,
|
indicatorSize: TabBarIndicatorSize.tab,
|
||||||
tabs: [
|
tabs: [
|
||||||
Padding(padding: const EdgeInsets.symmetric(horizontal: 18), child: Tab(text: 'All'.tr)),
|
Padding(padding: const EdgeInsets.symmetric(horizontal: 18), child: Tab(text: 'All'.tr())),
|
||||||
Tab(text: 'In Progress'.tr),
|
Tab(text: 'In Progress'.tr()),
|
||||||
Tab(text: 'Delivered'.tr),
|
Tab(text: 'Delivered'.tr()),
|
||||||
Tab(text: 'Cancelled'.tr),
|
Tab(text: 'Cancelled'.tr()),
|
||||||
Tab(text: 'Rejected'.tr),
|
Tab(text: 'Rejected'.tr()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -122,7 +123,7 @@ class OrderScreen extends StatelessWidget {
|
|||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
children: [
|
children: [
|
||||||
controller.allList.isEmpty
|
controller.allList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Order Not Found".tr)
|
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||||
: RefreshIndicator(
|
: RefreshIndicator(
|
||||||
onRefresh: () => controller.getOrder(),
|
onRefresh: () => controller.getOrder(),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -136,7 +137,7 @@ class OrderScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller.inProgressList.isEmpty
|
controller.inProgressList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Order Not Found".tr)
|
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||||
: RefreshIndicator(
|
: RefreshIndicator(
|
||||||
onRefresh: () => controller.getOrder(),
|
onRefresh: () => controller.getOrder(),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -150,7 +151,7 @@ class OrderScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller.deliveredList.isEmpty
|
controller.deliveredList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Order Not Found".tr)
|
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||||
: RefreshIndicator(
|
: RefreshIndicator(
|
||||||
onRefresh: () => controller.getOrder(),
|
onRefresh: () => controller.getOrder(),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -164,7 +165,7 @@ class OrderScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller.cancelledList.isEmpty
|
controller.cancelledList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Order Not Found".tr)
|
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||||
: RefreshIndicator(
|
: RefreshIndicator(
|
||||||
onRefresh: () => controller.getOrder(),
|
onRefresh: () => controller.getOrder(),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -178,7 +179,7 @@ class OrderScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller.rejectedList.isEmpty
|
controller.rejectedList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Order Not Found".tr)
|
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||||
: RefreshIndicator(
|
: RefreshIndicator(
|
||||||
onRefresh: () => controller.getOrder(),
|
onRefresh: () => controller.getOrder(),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -296,11 +297,11 @@ class OrderScreen extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
for (var element in orderModel.products!) {
|
for (var element in orderModel.products!) {
|
||||||
controller.addToCart(cartProductModel: element);
|
controller.addToCart(cartProductModel: element);
|
||||||
ShowToastDialog.showToast("Item Added In a cart".tr);
|
ShowToastDialog.showToast("Item Added In a cart".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Reorder".tr,
|
"Reorder".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -313,7 +314,7 @@ class OrderScreen extends StatelessWidget {
|
|||||||
Get.to(const LiveTrackingScreen(), arguments: {"orderModel": orderModel});
|
Get.to(const LiveTrackingScreen(), arguments: {"orderModel": orderModel});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Track Order".tr,
|
"Track Order".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -327,7 +328,7 @@ class OrderScreen extends StatelessWidget {
|
|||||||
// Get.off(const OrderPlacingScreen(), arguments: {"orderModel": orderModel});
|
// Get.off(const OrderPlacingScreen(), arguments: {"orderModel": orderModel});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View Details".tr,
|
"View Details".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:customer/screen_ui/on_demand_service/worker_inbox_screen.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/custom_dialog_box.dart';
|
import 'package:customer/themes/custom_dialog_box.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:in_app_review/in_app_review.dart';
|
import 'package:in_app_review/in_app_review.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import '../../../service/fire_store_utils.dart';
|
import '../../../service/fire_store_utils.dart';
|
||||||
@@ -51,16 +52,16 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"My Profile".tr,
|
"My Profile".tr(),
|
||||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Manage your personal information, preferences, and settings all in one place.".tr,
|
"Manage your personal information, preferences, and settings all in one place.".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"General Information".tr,
|
"General Information".tr(),
|
||||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -73,18 +74,18 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Constant.userModel == null
|
Constant.userModel == null
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: cardDecoration(isDark, controller, "assets/images/ic_profile.svg", "Profile Information".tr, () {
|
: cardDecoration(isDark, controller, "assets/images/ic_profile.svg", "Profile Information".tr(), () {
|
||||||
Get.to(const EditProfileScreen());
|
Get.to(const EditProfileScreen());
|
||||||
}),
|
}),
|
||||||
if (Constant.sectionConstantModel!.dineInActive == true)
|
if (Constant.sectionConstantModel!.dineInActive == true)
|
||||||
cardDecoration(isDark, controller, "assets/images/ic_dinin.svg", "Dine-In".tr, () {
|
cardDecoration(isDark, controller, "assets/images/ic_dinin.svg", "Dine-In".tr(), () {
|
||||||
Get.to(const DineInScreen());
|
Get.to(const DineInScreen());
|
||||||
}),
|
}),
|
||||||
cardDecoration(isDark, controller, "assets/images/ic_gift.svg", "Gift Card".tr, () {
|
cardDecoration(isDark, controller, "assets/images/ic_gift.svg", "Gift Card".tr(), () {
|
||||||
Get.to(const GiftCardScreen());
|
Get.to(const GiftCardScreen());
|
||||||
}),
|
}),
|
||||||
if (Constant.isCashbackActive == true)
|
if (Constant.isCashbackActive == true)
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_cashback_Offer.svg", "Cashback Offers".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_cashback_Offer.svg", "Cashback Offers".tr(), () {
|
||||||
Get.to(const CashbackOffersListScreen());
|
Get.to(const CashbackOffersListScreen());
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@@ -97,7 +98,7 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Bookings Information".tr,
|
"Bookings Information".tr(),
|
||||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -108,7 +109,7 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_dinin_order.svg", "Dine-In Booking".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_dinin_order.svg", "Dine-In Booking".tr(), () {
|
||||||
Get.to(const DineInBookingScreen());
|
Get.to(const DineInBookingScreen());
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@@ -120,7 +121,7 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Preferences".tr,
|
"Preferences".tr(),
|
||||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -131,17 +132,17 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_change_language.svg", "Change Language".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_change_language.svg", "Change Language".tr(), () {
|
||||||
Get.to(const ChangeLanguageScreen());
|
Get.to(const ChangeLanguageScreen());
|
||||||
}),
|
}),
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_light_dark.svg", "Dark Mode".tr, () {}),
|
cardDecoration(isDark, controller, "assets/icons/ic_light_dark.svg", "Dark Mode".tr(), () {}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Social".tr,
|
"Social".tr(),
|
||||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -154,16 +155,16 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Constant.userModel == null
|
Constant.userModel == null
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: cardDecoration(isDark, controller, "assets/icons/ic_refer.svg", "Refer a Friend".tr, () {
|
: cardDecoration(isDark, controller, "assets/icons/ic_refer.svg", "Refer a Friend".tr(), () {
|
||||||
Get.to(const ReferFriendScreen());
|
Get.to(const ReferFriendScreen());
|
||||||
}),
|
}),
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_share.svg", "Share app".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_share.svg", "Share app".tr(), () {
|
||||||
Share.share(
|
Share.share(
|
||||||
'${'Check out Foodie, your ultimate food delivery application!'.tr} \n\n${'Google Play:'.tr} ${Constant.googlePlayLink} \n\n${'App Store:'.tr} ${Constant.appStoreLink}',
|
'${'Check out Foodie, your ultimate food delivery application!'.tr()} \n\n${'Google Play:'.tr()} ${Constant.googlePlayLink} \n\n${'App Store:'.tr()} ${Constant.appStoreLink}',
|
||||||
subject: 'Look what I made!'.tr,
|
subject: 'Look what I made!'.tr(),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_rate.svg", "Rate the app".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_rate.svg", "Rate the app".tr(), () {
|
||||||
final InAppReview inAppReview = InAppReview.instance;
|
final InAppReview inAppReview = InAppReview.instance;
|
||||||
inAppReview.requestReview();
|
inAppReview.requestReview();
|
||||||
}),
|
}),
|
||||||
@@ -178,7 +179,7 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Communication".tr,
|
"Communication".tr(),
|
||||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -189,16 +190,16 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_chat.svg", "Store Inbox".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_chat.svg", "Store Inbox".tr(), () {
|
||||||
Get.to(const RestaurantInboxScreen());
|
Get.to(const RestaurantInboxScreen());
|
||||||
}),
|
}),
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_driver.svg", "Driver Inbox".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_driver.svg", "Driver Inbox".tr(), () {
|
||||||
Get.to(const DriverInboxScreen());
|
Get.to(const DriverInboxScreen());
|
||||||
}),
|
}),
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_chat.svg", "Provider Inbox".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_chat.svg", "Provider Inbox".tr(), () {
|
||||||
Get.to(const ProviderInboxScreen());
|
Get.to(const ProviderInboxScreen());
|
||||||
}),
|
}),
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_driver.svg", "Worker Inbox".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_driver.svg", "Worker Inbox".tr(), () {
|
||||||
Get.to(const WorkerInboxScreen());
|
Get.to(const WorkerInboxScreen());
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@@ -208,7 +209,7 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text("Legal".tr, style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500)),
|
Text("Legal".tr(), style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500)),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Container(
|
Container(
|
||||||
width: Responsive.width(100, context),
|
width: Responsive.width(100, context),
|
||||||
@@ -217,10 +218,10 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_privacy_policy.svg", "Privacy Policy".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_privacy_policy.svg", "Privacy Policy".tr(), () {
|
||||||
Get.to(const TermsAndConditionScreen(type: "privacy"));
|
Get.to(const TermsAndConditionScreen(type: "privacy"));
|
||||||
}),
|
}),
|
||||||
cardDecoration(isDark, controller, "assets/icons/ic_tearm_condition.svg", "Terms and Conditions".tr, () {
|
cardDecoration(isDark, controller, "assets/icons/ic_tearm_condition.svg", "Terms and Conditions".tr(), () {
|
||||||
Get.to(const TermsAndConditionScreen(type: "termAndCondition"));
|
Get.to(const TermsAndConditionScreen(type: "termAndCondition"));
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@@ -237,18 +238,18 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Constant.userModel == null
|
Constant.userModel == null
|
||||||
? cardDecoration(isDark, controller, "assets/icons/ic_logout.svg", "Log In".tr, () {
|
? cardDecoration(isDark, controller, "assets/icons/ic_logout.svg", "Log In".tr(), () {
|
||||||
Get.offAll(const LoginScreen());
|
Get.offAll(const LoginScreen());
|
||||||
})
|
})
|
||||||
: cardDecoration(isDark, controller, "assets/icons/ic_logout.svg", "Log out".tr, () {
|
: cardDecoration(isDark, controller, "assets/icons/ic_logout.svg", "Log out".tr(), () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return CustomDialogBox(
|
return CustomDialogBox(
|
||||||
title: "Log out".tr,
|
title: "Log out".tr(),
|
||||||
descriptions: "Are you sure you want to log out? You will need to enter your credentials to log back in.".tr,
|
descriptions: "Are you sure you want to log out? You will need to enter your credentials to log back in.".tr(),
|
||||||
positiveString: "Log out".tr,
|
positiveString: "Log out".tr(),
|
||||||
negativeString: "Cancel".tr,
|
negativeString: "Cancel".tr(),
|
||||||
positiveClick: () async {
|
positiveClick: () async {
|
||||||
Constant.userModel!.fcmToken = "";
|
Constant.userModel!.fcmToken = "";
|
||||||
await FireStoreUtils.updateUser(Constant.userModel!);
|
await FireStoreUtils.updateUser(Constant.userModel!);
|
||||||
@@ -279,20 +280,20 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return CustomDialogBox(
|
return CustomDialogBox(
|
||||||
title: "Delete Account".tr,
|
title: "Delete Account".tr(),
|
||||||
descriptions: "Are you sure you want to delete your account? This action is irreversible and will permanently remove all your data.".tr,
|
descriptions: "Are you sure you want to delete your account? This action is irreversible and will permanently remove all your data.".tr(),
|
||||||
positiveString: "Delete".tr,
|
positiveString: "Delete".tr(),
|
||||||
negativeString: "Cancel".tr,
|
negativeString: "Cancel".tr(),
|
||||||
positiveClick: () async {
|
positiveClick: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
await controller.deleteUserFromServer();
|
await controller.deleteUserFromServer();
|
||||||
await FireStoreUtils.deleteUser().then((value) {
|
await FireStoreUtils.deleteUser().then((value) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
ShowToastDialog.showToast("Account deleted successfully".tr);
|
ShowToastDialog.showToast("Account deleted successfully".tr());
|
||||||
Get.offAll(const LoginScreen());
|
Get.offAll(const LoginScreen());
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Contact Administrator".tr);
|
ShowToastDialog.showToast("Contact Administrator".tr());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -311,7 +312,7 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_delete.svg"),
|
SvgPicture.asset("assets/icons/ic_delete.svg"),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"Delete Account".tr,
|
"Delete Account".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.danger300 : AppThemeData.danger300),
|
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.danger300 : AppThemeData.danger300),
|
||||||
),
|
),
|
||||||
@@ -347,25 +348,25 @@ class ProfileScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(image, colorFilter: title == "Log In".tr || title == "Cashbacks".tr ? const ColorFilter.mode(AppThemeData.success500, BlendMode.srcIn) : null, height: 24, width: 24),
|
SvgPicture.asset(image, colorFilter: title == "Log In".tr() || title == "Cashbacks".tr() ? const ColorFilter.mode(AppThemeData.success500, BlendMode.srcIn) : null, height: 24, width: 24),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
title.tr,
|
title.tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: AppThemeData.medium,
|
fontFamily: AppThemeData.medium,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color:
|
color:
|
||||||
title == "Log out".tr
|
title == "Log out".tr()
|
||||||
? AppThemeData.danger300
|
? AppThemeData.danger300
|
||||||
: title == "Log In".tr
|
: title == "Log In".tr()
|
||||||
? AppThemeData.success500
|
? AppThemeData.success500
|
||||||
: (isDark ? AppThemeData.grey100 : AppThemeData.grey800),
|
: (isDark ? AppThemeData.grey100 : AppThemeData.grey800),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
title == "Dark Mode".tr
|
title == "Dark Mode".tr()
|
||||||
? Transform.scale(
|
? Transform.scale(
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Obx(() => CupertinoSwitch(value: controller.isDarkModeSwitch.value, activeTrackColor: AppThemeData.primary300, onChanged: controller.toggleDarkMode)),
|
child: Obx(() => CupertinoSwitch(value: controller.isDarkModeSwitch.value, activeTrackColor: AppThemeData.primary300, onChanged: controller.toggleDarkMode)),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/themes/responsive.dart';
|
|||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
import 'package:dotted_border/dotted_border.dart';
|
import 'package:dotted_border/dotted_border.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -31,7 +32,7 @@ class RateProductScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Rate the item".tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
title: Text("Rate the item".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
body:
|
body:
|
||||||
controller.isLoading.value
|
controller.isLoading.value
|
||||||
@@ -49,9 +50,9 @@ class RateProductScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("Rate for".tr, style: TextStyle(color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.medium)),
|
Text("Rate for".tr(), style: TextStyle(color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.medium)),
|
||||||
Text(
|
Text(
|
||||||
"${controller.productModel.value.name}".tr,
|
"${controller.productModel.value.name}".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 18, fontFamily: AppThemeData.semiBold),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 18, fontFamily: AppThemeData.semiBold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -123,14 +124,14 @@ class RateProductScreen extends StatelessWidget {
|
|||||||
SvgPicture.asset('assets/icons/ic_folder.svg'),
|
SvgPicture.asset('assets/icons/ic_folder.svg'),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Choose a image and upload here".tr,
|
"Choose a image and upload here".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.medium, fontSize: 16),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.medium, fontSize: 16),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text("JPEG, PNG".tr, style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700, fontFamily: AppThemeData.regular)),
|
Text("JPEG, PNG".tr(), style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700, fontFamily: AppThemeData.regular)),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Brows Image".tr,
|
title: "Brows Image".tr(),
|
||||||
color: AppThemeData.primary50,
|
color: AppThemeData.primary50,
|
||||||
width: 30,
|
width: 30,
|
||||||
height: 5,
|
height: 5,
|
||||||
@@ -216,7 +217,7 @@ class RateProductScreen extends StatelessWidget {
|
|||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
errorBorder: InputBorder.none,
|
errorBorder: InputBorder.none,
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
hintText: "Type comment".tr,
|
hintText: "Type comment".tr(),
|
||||||
hintStyle: TextStyle(fontSize: 14, color: isDark ? AppThemeData.grey600 : AppThemeData.grey400, fontFamily: AppThemeData.regular),
|
hintStyle: TextStyle(fontSize: 14, color: isDark ? AppThemeData.grey600 : AppThemeData.grey400, fontFamily: AppThemeData.regular),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -235,7 +236,7 @@ class RateProductScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "Submit Review".tr,
|
title: "Submit Review".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
@@ -265,7 +266,7 @@ class RateProductScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 15),
|
padding: const EdgeInsets.only(top: 15),
|
||||||
child: Text("Please Select".tr, style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.bold, fontSize: 16)),
|
child: Text("Please Select".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.bold, fontSize: 16)),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@@ -277,7 +278,7 @@ class RateProductScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
IconButton(onPressed: () => controller.pickFile(source: ImageSource.camera), icon: const Icon(Icons.camera_alt, size: 32)),
|
IconButton(onPressed: () => controller.pickFile(source: ImageSource.camera), icon: const Icon(Icons.camera_alt, size: 32)),
|
||||||
Padding(padding: const EdgeInsets.only(top: 3), child: Text("Camera".tr)),
|
Padding(padding: const EdgeInsets.only(top: 3), child: Text("Camera".tr())),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -288,7 +289,7 @@ class RateProductScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
IconButton(onPressed: () => controller.pickFile(source: ImageSource.gallery), icon: const Icon(Icons.photo_library_sharp, size: 32)),
|
IconButton(onPressed: () => controller.pickFile(source: ImageSource.gallery), icon: const Icon(Icons.photo_library_sharp, size: 32)),
|
||||||
Padding(padding: const EdgeInsets.only(top: 3), child: Text("Gallery".tr)),
|
Padding(padding: const EdgeInsets.only(top: 3), child: Text("Gallery".tr())),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:customer/controllers/refer_friend_controller.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -51,17 +52,17 @@ class ReferFriendScreen extends StatelessWidget {
|
|||||||
Center(child: SvgPicture.asset("assets/images/referal_top.svg")),
|
Center(child: SvgPicture.asset("assets/images/referal_top.svg")),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Refer your friend and earn".tr,
|
"Refer your friend and earn".tr(),
|
||||||
style: TextStyle(fontSize: 22, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 22, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Text(
|
Text(
|
||||||
"${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount)} ${'Each🎉'.tr}",
|
"${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount)} ${'Each🎉'.tr()}",
|
||||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32),
|
const SizedBox(height: 32),
|
||||||
Text(
|
Text(
|
||||||
"Invite Friends & Businesses".tr,
|
"Invite Friends & Businesses".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
|
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
|
||||||
@@ -71,8 +72,8 @@ class ReferFriendScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Text(
|
Text(
|
||||||
"${'Invite your friends to sign up with Foodie using your code, and you’ll earn'.tr} ${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount)} ${'after their Success the first order! 💸🍔'.tr}"
|
"${'Invite your friends to sign up with Foodie using your code, and you’ll earn'.tr()} ${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount)} ${'after their Success the first order! 💸🍔'.tr()}"
|
||||||
.tr,
|
.tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
@@ -101,7 +102,7 @@ class ReferFriendScreen extends StatelessWidget {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: controller.referralModel.value.referralCode.toString()));
|
Clipboard.setData(ClipboardData(text: controller.referralModel.value.referralCode.toString()));
|
||||||
ShowToastDialog.showToast("Copied".tr);
|
ShowToastDialog.showToast("Copied".tr());
|
||||||
},
|
},
|
||||||
child: const Icon(Icons.copy, color: AppThemeData.ecommerce100),
|
child: const Icon(Icons.copy, color: AppThemeData.ecommerce100),
|
||||||
),
|
),
|
||||||
@@ -117,7 +118,7 @@ class ReferFriendScreen extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 30),
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 30),
|
||||||
child: Text(
|
child: Text(
|
||||||
"or".tr,
|
"or".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
|
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
|
||||||
@@ -132,13 +133,13 @@ class ReferFriendScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Share Code".tr,
|
title: "Share Code".tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
color: AppThemeData.ecommerce300,
|
color: AppThemeData.ecommerce300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
await Share.share(
|
await Share.share(
|
||||||
"${"Hey there, thanks for choosing Foodie. Hope you love our product. If you do, share it with your friends using code".tr} ${controller.referralModel.value.referralCode.toString()} ${"and get".tr}${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount.toString())} ${"when order completed".tr}",
|
"${"Hey there, thanks for choosing Foodie. Hope you love our product. If you do, share it with your friends using code".tr()} ${controller.referralModel.value.referralCode.toString()} ${"and get".tr()}${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount.toString())} ${"when order completed".tr()}",
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:customer/themes/responsive.dart';
|
|||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
import 'package:customer/utils/network_image_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/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
@@ -51,8 +52,8 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('${cartItem.length} ${"items".tr}', style: TextStyle(fontFamily: AppThemeData.medium, color: AppThemeData.grey50, fontSize: 16)),
|
Text('${cartItem.length} ${"items".tr()}', style: TextStyle(fontFamily: AppThemeData.medium, color: AppThemeData.grey50, fontSize: 16)),
|
||||||
Text('View Cart'.tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: AppThemeData.grey50, fontSize: 16, fontWeight: FontWeight.bold)),
|
Text('View Cart'.tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: AppThemeData.grey50, fontSize: 16, fontWeight: FontWeight.bold)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -89,7 +90,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text("Free Delivery".tr, style: TextStyle(fontSize: 14, color: AppThemeData.carRent600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600)),
|
Text("Free Delivery".tr(), style: TextStyle(fontSize: 14, color: AppThemeData.carRent600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -288,7 +289,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
Get.to(const ReviewListScreen(), arguments: {"vendorModel": controller.vendorModel.value});
|
Get.to(const ReviewListScreen(), arguments: {"vendorModel": controller.vendorModel.value});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"${controller.vendorModel.value.reviewsCount} ${'Ratings'.tr}",
|
"${controller.vendorModel.value.reviewsCount} ${'Ratings'.tr()}",
|
||||||
style: TextStyle(decoration: TextDecoration.underline, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700, fontFamily: AppThemeData.regular),
|
style: TextStyle(decoration: TextDecoration.underline, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700, fontFamily: AppThemeData.regular),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -301,7 +302,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
: Row(
|
: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
controller.isOpen.value ? "Open".tr : "Close".tr,
|
controller.isOpen.value ? "Open".tr() : "Close".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -316,13 +317,13 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (controller.vendorModel.value.workingHours!.isEmpty) {
|
if (controller.vendorModel.value.workingHours!.isEmpty) {
|
||||||
ShowToastDialog.showToast("Timing is not added by store".tr);
|
ShowToastDialog.showToast("Timing is not added by store".tr());
|
||||||
} else {
|
} else {
|
||||||
timeShowBottomSheet(context, controller);
|
timeShowBottomSheet(context, controller);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"View Timings".tr,
|
"View Timings".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -344,7 +345,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"Also applicable on table booking".tr,
|
"Also applicable on table booking".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -383,7 +384,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Table Booking".tr,
|
"Table Booking".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||||
@@ -392,7 +393,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Quick Conformations".tr,
|
"Quick Conformations".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
|
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
|
||||||
@@ -418,7 +419,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"Additional Offers".tr,
|
"Additional Offers".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -435,7 +436,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
"Menu".tr,
|
"Menu".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -449,7 +450,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
TextFieldWidget(
|
TextFieldWidget(
|
||||||
controller: controller.searchEditingController.value,
|
controller: controller.searchEditingController.value,
|
||||||
hintText: 'Search the item and more...'.tr,
|
hintText: 'Search the item and more...'.tr(),
|
||||||
onchange: (value) {
|
onchange: (value) {
|
||||||
controller.searchProduct(value);
|
controller.searchProduct(value);
|
||||||
},
|
},
|
||||||
@@ -492,7 +493,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_veg.svg", height: 20, width: 20),
|
SvgPicture.asset("assets/icons/ic_veg.svg", height: 20, width: 20),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
'Veg'.tr,
|
'Veg'.tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -532,7 +533,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_nonveg.svg", height: 20, width: 20),
|
SvgPicture.asset("assets/icons/ic_nonveg.svg", height: 20, width: 20),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
'Non Veg'.tr,
|
'Non Veg'.tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -805,7 +806,7 @@ class CouponListView extends StatelessWidget {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: offerModel.code.toString())).then((value) {
|
Clipboard.setData(ClipboardData(text: offerModel.code.toString())).then((value) {
|
||||||
ShowToastDialog.showToast("Copied".tr);
|
ShowToastDialog.showToast("Copied".tr());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -921,7 +922,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
productModel.nonveg == true ? SvgPicture.asset("assets/icons/ic_nonveg.svg") : SvgPicture.asset("assets/icons/ic_veg.svg"),
|
productModel.nonveg == true ? SvgPicture.asset("assets/icons/ic_nonveg.svg") : SvgPicture.asset("assets/icons/ic_veg.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
productModel.nonveg == true ? "Non Veg.".tr : "Pure veg.".tr,
|
productModel.nonveg == true ? "Non Veg.".tr() : "Pure veg.".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
|
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
@@ -995,7 +996,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
Icon(Icons.info, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, size: 18),
|
Icon(Icons.info, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, size: 18),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
"Info".tr,
|
"Info".tr(),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -1064,7 +1065,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
child:
|
child:
|
||||||
selectedVariants.isNotEmpty || (productModel.addOnsTitle != null && productModel.addOnsTitle!.isNotEmpty)
|
selectedVariants.isNotEmpty || (productModel.addOnsTitle != null && productModel.addOnsTitle!.isNotEmpty)
|
||||||
? RoundedButtonFill(
|
? RoundedButtonFill(
|
||||||
title: "Add".tr,
|
title: "Add".tr(),
|
||||||
width: 10,
|
width: 10,
|
||||||
height: 4,
|
height: 4,
|
||||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||||
@@ -1177,7 +1178,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
quantity: cartItem.where((p0) => p0.id == productModel.id).first.quantity! + 1,
|
quantity: cartItem.where((p0) => p0.id == productModel.id).first.quantity! + 1,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Out of stock".tr);
|
ShowToastDialog.showToast("Out of stock".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Icon(Icons.add, color: isDark ? AppThemeData.grey50 : AppThemeData.greyDark50),
|
child: Icon(Icons.add, color: isDark ? AppThemeData.grey50 : AppThemeData.greyDark50),
|
||||||
@@ -1186,7 +1187,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
: RoundedButtonFill(
|
: RoundedButtonFill(
|
||||||
title: "Add".tr,
|
title: "Add".tr(),
|
||||||
width: 10,
|
width: 10,
|
||||||
height: 4,
|
height: 4,
|
||||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||||
@@ -1195,7 +1196,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
if (1 <= (productModel.quantity ?? 0) || (productModel.quantity ?? 0) == -1) {
|
if (1 <= (productModel.quantity ?? 0) || (productModel.quantity ?? 0) == -1) {
|
||||||
controller.addToCart(productModel: productModel, price: price, discountPrice: disPrice, isIncrement: true, quantity: 1);
|
controller.addToCart(productModel: productModel, price: price, discountPrice: disPrice, isIncrement: true, quantity: 1);
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Out of stock".tr);
|
ShowToastDialog.showToast("Out of stock".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -1257,7 +1258,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Product Information's".tr,
|
"Product Information's".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.bold, fontWeight: FontWeight.w700, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.bold, fontWeight: FontWeight.w700, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -1278,7 +1279,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Gram".tr,
|
"Gram".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -1300,7 +1301,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Calories".tr,
|
"Calories".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -1322,7 +1323,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Proteins".tr,
|
"Proteins".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -1344,7 +1345,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Fats".tr,
|
"Fats".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -1365,7 +1366,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Specification".tr,
|
"Specification".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w700, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w700, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -1408,7 +1409,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Brand".tr,
|
"Brand".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontWeight: FontWeight.w700, fontFamily: AppThemeData.bold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
style: TextStyle(fontWeight: FontWeight.w700, fontFamily: AppThemeData.bold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||||
),
|
),
|
||||||
@@ -1424,7 +1425,7 @@ class ProductListView extends StatelessWidget {
|
|||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Back".tr,
|
title: "Back".tr(),
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
@@ -1588,7 +1589,7 @@ class ProductDetailsView extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Required • Select any 1 option".tr,
|
"Required • Select any 1 option".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -1700,7 +1701,7 @@ class ProductDetailsView extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Addons".tr,
|
"Addons".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -1830,7 +1831,7 @@ class ProductDetailsView extends StatelessWidget {
|
|||||||
controller.quantity.value += 1;
|
controller.quantity.value += 1;
|
||||||
controller.update();
|
controller.update();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Out of stock".tr);
|
ShowToastDialog.showToast("Out of stock".tr());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int totalQuantity = int.parse(
|
int totalQuantity = int.parse(
|
||||||
@@ -1840,7 +1841,7 @@ class ProductDetailsView extends StatelessWidget {
|
|||||||
controller.quantity.value += 1;
|
controller.quantity.value += 1;
|
||||||
controller.update();
|
controller.update();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Out of stock".tr);
|
ShowToastDialog.showToast("Out of stock".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1854,7 +1855,7 @@ class ProductDetailsView extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "${'Add item'.tr} ${Constant.amountShow(amount: controller.calculatePrice(productModel))}".tr,
|
title: "${'Add item'.tr()} ${Constant.amountShow(amount: controller.calculatePrice(productModel))}".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/models/rating_model.dart';
|
|||||||
import 'package:customer/models/review_attribute_model.dart';
|
import 'package:customer/models/review_attribute_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
@@ -31,13 +32,13 @@ class ReviewListScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Reviews".tr, textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
title: Text("Reviews".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
body:
|
body:
|
||||||
controller.isLoading.value
|
controller.isLoading.value
|
||||||
? Constant.loader()
|
? Constant.loader()
|
||||||
: controller.ratingList.isEmpty
|
: controller.ratingList.isEmpty
|
||||||
? Constant.showEmptyView(message: "No Review found".tr)
|
? Constant.showEmptyView(message: "No Review found".tr())
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -72,7 +73,7 @@ class ReviewListScreen extends StatelessWidget {
|
|||||||
} else if (snapshot.data != null) {
|
} else if (snapshot.data != null) {
|
||||||
ProductModel model = ProductModel.fromJson(snapshot.data!.data()!);
|
ProductModel model = ProductModel.fromJson(snapshot.data!.data()!);
|
||||||
return Text(
|
return Text(
|
||||||
'${'Rate for'.tr} - ${model.name ?? ''}',
|
'${'Rate for'.tr()} - ${model.name ?? ''}',
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.semiBold),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.semiBold),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:customer/controllers/scan_qr_code_controller.dart';
|
import 'package:customer/controllers/scan_qr_code_controller.dart';
|
||||||
import 'package:customer/models/vendor_model.dart';
|
import 'package:customer/models/vendor_model.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:qr_code_dart_scan/qr_code_dart_scan.dart';
|
import 'package:qr_code_dart_scan/qr_code_dart_scan.dart';
|
||||||
@@ -24,7 +25,7 @@ class ScanQrCodeScreen extends StatelessWidget {
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
title: Text("Scan QR Code".tr, style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
title: Text("Scan QR Code".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||||
),
|
),
|
||||||
body: QRCodeDartScanView(
|
body: QRCodeDartScanView(
|
||||||
// enable scan invert qr code ( default = false)
|
// enable scan invert qr code ( default = false)
|
||||||
@@ -32,11 +33,11 @@ class ScanQrCodeScreen extends StatelessWidget {
|
|||||||
// if TypeScan.takePicture will try decode when click to take a picture(default TypeScan.live)
|
// if TypeScan.takePicture will try decode when click to take a picture(default TypeScan.live)
|
||||||
onCapture: (Result result) {
|
onCapture: (Result result) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
if (controller.allNearestRestaurant.isNotEmpty) {
|
if (controller.allNearestRestaurant.isNotEmpty) {
|
||||||
if (controller.allNearestRestaurant.where((vendor) => vendor.id == result.text).isEmpty) {
|
if (controller.allNearestRestaurant.where((vendor) => vendor.id == result.text).isEmpty) {
|
||||||
ShowToastDialog.closeLoader();
|
ShowToastDialog.closeLoader();
|
||||||
ShowToastDialog.showToast("Store is not available".tr);
|
ShowToastDialog.showToast("Store is not available".tr());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
VendorModel storeModel = controller.allNearestRestaurant.firstWhere((vendor) => vendor.id == result.text);
|
VendorModel storeModel = controller.allNearestRestaurant.firstWhere((vendor) => vendor.id == result.text);
|
||||||
@@ -45,7 +46,7 @@ class ScanQrCodeScreen extends StatelessWidget {
|
|||||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": storeModel});
|
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": storeModel});
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Store is not available".tr);
|
ShowToastDialog.showToast("Store is not available".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:customer/models/vendor_model.dart';
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/responsive.dart';
|
import 'package:customer/themes/responsive.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import 'package:customer/utils/network_image_widget.dart';
|
import 'package:customer/utils/network_image_widget.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -31,7 +32,7 @@ class SearchScreen extends StatelessWidget {
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text(
|
title: Text(
|
||||||
Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true ? "Find your favorite products and nearby stores" : "Search Item & Store".tr,
|
Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true ? "Find your favorite products and nearby stores" : "Search Item & Store".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -40,7 +41,7 @@ class SearchScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: TextFieldWidget(
|
child: TextFieldWidget(
|
||||||
hintText: Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true ? 'Find your favorite products and nearby stores'.tr : 'Search the store and item'.tr,
|
hintText: Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true ? 'Find your favorite products and nearby stores'.tr() : 'Search the store and item'.tr(),
|
||||||
prefix: Padding(padding: const EdgeInsets.symmetric(horizontal: 16), child: SvgPicture.asset("assets/icons/ic_search.svg")),
|
prefix: Padding(padding: const EdgeInsets.symmetric(horizontal: 16), child: SvgPicture.asset("assets/icons/ic_search.svg")),
|
||||||
controller: null,
|
controller: null,
|
||||||
onchange: (value) {
|
onchange: (value) {
|
||||||
@@ -65,7 +66,7 @@ class SearchScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Store".tr,
|
"Store".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -131,7 +132,7 @@ class SearchScreen extends StatelessWidget {
|
|||||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"Free Delivery".tr,
|
"Free Delivery".tr(),
|
||||||
style: TextStyle(fontSize: 14, color: AppThemeData.success300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
style: TextStyle(fontSize: 14, color: AppThemeData.success300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -236,7 +237,7 @@ class SearchScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Items".tr,
|
"Items".tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -290,7 +291,7 @@ class SearchScreen extends StatelessWidget {
|
|||||||
productModel.nonveg == true ? SvgPicture.asset("assets/icons/ic_nonveg.svg") : SvgPicture.asset("assets/icons/ic_veg.svg"),
|
productModel.nonveg == true ? SvgPicture.asset("assets/icons/ic_nonveg.svg") : SvgPicture.asset("assets/icons/ic_veg.svg"),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
productModel.nonveg == true ? "Non Veg.".tr : "Pure veg.".tr,
|
productModel.nonveg == true ? "Non Veg.".tr() : "Pure veg.".tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
|
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
|
||||||
fontFamily: AppThemeData.semiBold,
|
fontFamily: AppThemeData.semiBold,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:flutter_html/flutter_html.dart';
|
import 'package:flutter_html/flutter_html.dart';
|
||||||
@@ -28,7 +29,7 @@ class TermsAndConditionScreen extends StatelessWidget {
|
|||||||
child: Icon(Icons.chevron_left_outlined, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
child: Icon(Icons.chevron_left_outlined, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
type == "privacy" ? "Privacy Policy".tr : "Terms & Conditions".tr,
|
type == "privacy" ? "Privacy Policy".tr() : "Terms & Conditions".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.bold, fontSize: 18),
|
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.bold, fontSize: 18),
|
||||||
),
|
),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_scr
|
|||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/text_field_widget.dart';
|
import 'package:customer/themes/text_field_widget.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -27,7 +28,7 @@ class PaymentListScreen extends StatelessWidget {
|
|||||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: Text("Top up Wallet".tr, style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
title: Text("Top up Wallet".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -36,8 +37,8 @@ class PaymentListScreen extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: TextFieldWidget(
|
child: TextFieldWidget(
|
||||||
title: 'Amount'.tr,
|
title: 'Amount'.tr(),
|
||||||
hintText: 'Enter Amount'.tr,
|
hintText: 'Enter Amount'.tr(),
|
||||||
controller: controller.topUpAmountController.value,
|
controller: controller.topUpAmountController.value,
|
||||||
textInputType: const TextInputType.numberWithOptions(decimal: true, signed: true),
|
textInputType: const TextInputType.numberWithOptions(decimal: true, signed: true),
|
||||||
prefix: Padding(padding: const EdgeInsets.all(12.0), child: Text(Constant.currencyModel!.symbol.toString(), style: const TextStyle(fontSize: 20, color: AppThemeData.grey800))),
|
prefix: Padding(padding: const EdgeInsets.all(12.0), child: Text(Constant.currencyModel!.symbol.toString(), style: const TextStyle(fontSize: 20, color: AppThemeData.grey800))),
|
||||||
@@ -47,7 +48,7 @@ class PaymentListScreen extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child: Text(
|
child: Text(
|
||||||
"Select Top up Options".tr,
|
"Select Top up Options".tr(),
|
||||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -86,14 +87,14 @@ class PaymentListScreen extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "Top-up".tr,
|
title: "Top-up".tr(),
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
fontSizes: 16,
|
fontSizes: 16,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
if (controller.topUpAmountController.value.text.isEmpty) {
|
if (controller.topUpAmountController.value.text.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please Enter Amount".tr);
|
ShowToastDialog.showToast("Please Enter Amount".tr());
|
||||||
} else {
|
} else {
|
||||||
if (double.parse(controller.topUpAmountController.value.text) >= double.parse(Constant.minimumAmountToDeposit.toString())) {
|
if (double.parse(controller.topUpAmountController.value.text) >= double.parse(Constant.minimumAmountToDeposit.toString())) {
|
||||||
if (controller.selectedPaymentMethod.value == PaymentGateway.stripe.name) {
|
if (controller.selectedPaymentMethod.value == PaymentGateway.stripe.name) {
|
||||||
@@ -118,17 +119,17 @@ class PaymentListScreen extends StatelessWidget {
|
|||||||
RazorPayController().createOrderRazorPay(amount: double.parse(controller.topUpAmountController.value.text), razorpayModel: controller.razorPayModel.value).then((value) {
|
RazorPayController().createOrderRazorPay(amount: double.parse(controller.topUpAmountController.value.text), razorpayModel: controller.razorPayModel.value).then((value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||||
} else {
|
} else {
|
||||||
CreateRazorPayOrderModel result = value;
|
CreateRazorPayOrderModel result = value;
|
||||||
controller.openCheckout(amount: controller.topUpAmountController.value.text, orderId: result.id);
|
controller.openCheckout(amount: controller.topUpAmountController.value.text, orderId: result.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Please select payment method".tr);
|
ShowToastDialog.showToast("Please select payment method".tr());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("${'Please Enter minimum amount of'.tr} ${Constant.amountShow(amount: Constant.minimumAmountToDeposit)}");
|
ShowToastDialog.showToast("${'Please Enter minimum amount of'.tr()} ${Constant.amountShow(amount: Constant.minimumAmountToDeposit)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:customer/models/wallet_transaction_model.dart';
|
|||||||
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/payment_list_screen.dart';
|
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/payment_list_screen.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import '../../../constant/collection_name.dart';
|
import '../../../constant/collection_name.dart';
|
||||||
import '../../../controllers/theme_controller.dart';
|
import '../../../controllers/theme_controller.dart';
|
||||||
import '../../../models/cab_order_model.dart';
|
import '../../../models/cab_order_model.dart';
|
||||||
@@ -48,16 +49,16 @@ class WalletScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Image.asset("assets/images/login.gif", height: 120),
|
Image.asset("assets/images/login.gif", height: 120),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text("Please Log In to Continue".tr, style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
Text("Please Log In to Continue".tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"You’re not logged in. Please sign in to access your account and explore all features.".tr,
|
"You’re not logged in. Please sign in to access your account and explore all features.".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Log in".tr,
|
title: "Log in".tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
@@ -86,11 +87,11 @@ class WalletScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"My Wallet".tr,
|
"My Wallet".tr(),
|
||||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Keep track of your balance, transactions, and payment methods all in one place.".tr,
|
"Keep track of your balance, transactions, and payment methods all in one place.".tr(),
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -112,7 +113,7 @@ class WalletScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"My Wallet".tr,
|
"My Wallet".tr(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isDark ? AppThemeData.primary100 : AppThemeData.primary100,
|
color: isDark ? AppThemeData.primary100 : AppThemeData.primary100,
|
||||||
@@ -130,7 +131,7 @@ class WalletScreen extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 80),
|
padding: const EdgeInsets.symmetric(horizontal: 80),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "Top up".tr,
|
title: "Top up".tr(),
|
||||||
color: AppThemeData.warning300,
|
color: AppThemeData.warning300,
|
||||||
textColor: AppThemeData.grey900,
|
textColor: AppThemeData.grey900,
|
||||||
onPress: () {
|
onPress: () {
|
||||||
@@ -148,7 +149,7 @@ class WalletScreen extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child:
|
child:
|
||||||
controller.walletTransactionList.isEmpty
|
controller.walletTransactionList.isEmpty
|
||||||
? Constant.showEmptyView(message: "Transaction not found".tr)
|
? Constant.showEmptyView(message: "Transaction not found".tr())
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -197,7 +198,7 @@ class WalletScreen extends StatelessWidget {
|
|||||||
Get.to(const OrderDetailsScreen(), arguments: {"orderModel": OrderModel.fromJson(orderData)});
|
Get.to(const OrderDetailsScreen(), arguments: {"orderModel": OrderModel.fromJson(orderData)});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ShowToastDialog.showToast("Order details not available".tr);
|
ShowToastDialog.showToast("Order details not available".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:customer/constant/assets.dart';
|
import 'package:customer/constant/assets.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../controllers/on_boarding_controller.dart';
|
import '../../controllers/on_boarding_controller.dart';
|
||||||
@@ -65,7 +66,7 @@ class OnboardingScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
controller.currentPage.value == pageCount - 1
|
controller.currentPage.value == pageCount - 1
|
||||||
? RoundedButtonFill(
|
? RoundedButtonFill(
|
||||||
title: "Let’s Get Started".tr,
|
title: "Let’s Get Started".tr(),
|
||||||
onPress: () {
|
onPress: () {
|
||||||
_finish();
|
_finish();
|
||||||
},
|
},
|
||||||
@@ -73,11 +74,11 @@ class OnboardingScreen extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: Row(
|
: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: RoundedButtonFill(title: "Skip".tr, onPress: () => _finish(), color: AppThemeData.grey50, textColor: AppThemeData.grey900)),
|
Expanded(child: RoundedButtonFill(title: "Skip".tr(), onPress: () => _finish(), color: AppThemeData.grey50, textColor: AppThemeData.grey900)),
|
||||||
const SizedBox(width: 20),
|
const SizedBox(width: 20),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "Next".tr,
|
title: "Next".tr(),
|
||||||
onPress: () {
|
onPress: () {
|
||||||
controller.nextPage();
|
controller.nextPage();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import 'package:customer/screen_ui/on_demand_service/on_demand_details_screen.da
|
|||||||
import 'package:customer/service/fire_store_utils.dart';
|
import 'package:customer/service/fire_store_utils.dart';
|
||||||
import 'package:customer/themes/app_them_data.dart';
|
import 'package:customer/themes/app_them_data.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ class FavouriteOndemandScreen extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text("Favourite Services".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey900 : AppThemeData.grey900, fontSize: 20)),
|
Text("Favourite Services".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey900 : AppThemeData.grey900, fontSize: 20)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -49,16 +50,16 @@ class FavouriteOndemandScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Image.asset("assets/images/login.gif", height: 120),
|
Image.asset("assets/images/login.gif", height: 120),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text("Please Log In to Continue".tr, style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
Text("Please Log In to Continue".tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"You’re not logged in. Please sign in to access your account and explore all features.".tr,
|
"You’re not logged in. Please sign in to access your account and explore all features.".tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
title: "Log in".tr,
|
title: "Log in".tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
@@ -74,7 +75,7 @@ class FavouriteOndemandScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
child:
|
child:
|
||||||
controller.lstFav.isEmpty
|
controller.lstFav.isEmpty
|
||||||
? Constant.showEmptyView(message: "Favourite Service not found.".tr)
|
? Constant.showEmptyView(message: "Favourite Service not found.".tr())
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@@ -271,19 +272,19 @@ class FavouriteOndemandScreen extends StatelessWidget {
|
|||||||
Widget _buildPrice(ProviderServiceModel provider, {bool isDark = false}) {
|
Widget _buildPrice(ProviderServiceModel provider, {bool isDark = false}) {
|
||||||
if (provider.disPrice == "" || provider.disPrice == "0") {
|
if (provider.disPrice == "" || provider.disPrice == "0") {
|
||||||
return Text(
|
return Text(
|
||||||
provider.priceUnit == 'Fixed' ? Constant.amountShow(amount: provider.price) : '${Constant.amountShow(amount: provider.price ?? "0")}/${'hr'.tr}',
|
provider.priceUnit == 'Fixed' ? Constant.amountShow(amount: provider.price) : '${Constant.amountShow(amount: provider.price ?? "0")}/${'hr'.tr()}',
|
||||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: isDark ? Colors.white : AppThemeData.primary300),
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: isDark ? Colors.white : AppThemeData.primary300),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
provider.priceUnit == 'Fixed' ? Constant.amountShow(amount: provider.disPrice ?? '0') : '${Constant.amountShow(amount: provider.disPrice)}/${'hr'.tr}',
|
provider.priceUnit == 'Fixed' ? Constant.amountShow(amount: provider.disPrice ?? '0') : '${Constant.amountShow(amount: provider.disPrice)}/${'hr'.tr()}',
|
||||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: isDark ? Colors.white : AppThemeData.primary300),
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: isDark ? Colors.white : AppThemeData.primary300),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
provider.priceUnit == 'Fixed' ? Constant.amountShow(amount: provider.price) : '${Constant.amountShow(amount: provider.price ?? "0")}/${'hr'.tr}',
|
provider.priceUnit == 'Fixed' ? Constant.amountShow(amount: provider.price) : '${Constant.amountShow(amount: provider.price ?? "0")}/${'hr'.tr()}',
|
||||||
style: const TextStyle(fontSize: 12, color: Colors.grey, decoration: TextDecoration.lineThrough),
|
style: const TextStyle(fontSize: 12, color: Colors.grey, decoration: TextDecoration.lineThrough),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
@@ -29,7 +30,7 @@ class MyBookingOnDemandScreen extends StatelessWidget {
|
|||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
backgroundColor: AppThemeData.primary300,
|
backgroundColor: AppThemeData.primary300,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
title: Padding(padding: const EdgeInsets.only(bottom: 10), child: Text("Booking History".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900))),
|
title: Padding(padding: const EdgeInsets.only(bottom: 10), child: Text("Booking History".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900))),
|
||||||
bottom: PreferredSize(
|
bottom: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(48),
|
preferredSize: const Size.fromHeight(48),
|
||||||
child: TabBar(
|
child: TabBar(
|
||||||
@@ -54,7 +55,7 @@ class MyBookingOnDemandScreen extends StatelessWidget {
|
|||||||
final orders = controller.getOrdersForTab(title);
|
final orders = controller.getOrdersForTab(title);
|
||||||
|
|
||||||
if (orders.isEmpty) {
|
if (orders.isEmpty) {
|
||||||
return Center(child: Text("No ride found".tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)));
|
return Center(child: Text("No ride found".tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
@@ -124,7 +125,7 @@ class MyBookingOnDemandScreen extends StatelessWidget {
|
|||||||
onProviderOrder.otp != null &&
|
onProviderOrder.otp != null &&
|
||||||
onProviderOrder.otp!.isNotEmpty)
|
onProviderOrder.otp!.isNotEmpty)
|
||||||
Text(
|
Text(
|
||||||
"${'OTP :'.tr} ${onProviderOrder.otp}",
|
"${'OTP :'.tr()} ${onProviderOrder.otp}",
|
||||||
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -155,7 +156,7 @@ class MyBookingOnDemandScreen extends StatelessWidget {
|
|||||||
final price = hasDiscount ? order.provider.disPrice.toString() : order.provider.price.toString();
|
final price = hasDiscount ? order.provider.disPrice.toString() : order.provider.price.toString();
|
||||||
|
|
||||||
return Text(
|
return Text(
|
||||||
order.provider.priceUnit == 'Fixed' ? Constant.amountShow(amount: price) : "${Constant.amountShow(amount: price)}/${'hr'.tr}",
|
order.provider.priceUnit == 'Fixed' ? Constant.amountShow(amount: price) : "${Constant.amountShow(amount: price)}/${'hr'.tr()}",
|
||||||
style: AppThemeData.mediumTextStyle(fontSize: 16, color: AppThemeData.primary300),
|
style: AppThemeData.mediumTextStyle(fontSize: 16, color: AppThemeData.primary300),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -194,8 +195,8 @@ class MyBookingOnDemandScreen extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(label.tr, style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text(label.tr(), style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
Text(value.tr, style: AppThemeData.regularTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text(value.tr(), style: AppThemeData.regularTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:bottom_picker/bottom_picker.dart';
|
import 'package:bottom_picker/bottom_picker.dart';
|
||||||
import 'package:dotted_border/dotted_border.dart';
|
import 'package:dotted_border/dotted_border.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geocoding/geocoding.dart';
|
import 'package:geocoding/geocoding.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
@@ -46,7 +47,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text("Book Service".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
|
Text("Book Service".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -57,7 +58,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Services Section
|
// Services Section
|
||||||
Text("Services".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text("Services".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -118,7 +119,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("Address".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text("Address".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
SizedBox(height: 5),
|
SizedBox(height: 5),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
@@ -130,14 +131,14 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
controller.selectedAddress.value = shippingAddress;
|
controller.selectedAddress.value = shippingAddress;
|
||||||
controller.calculatePrice();
|
controller.calculatePrice();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Service not available in this area".tr);
|
ShowToastDialog.showToast("Service not available in this area".tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Constant.checkPermission(
|
Constant.checkPermission(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ShowToastDialog.showLoader("Please wait...".tr);
|
ShowToastDialog.showLoader("Please wait...".tr());
|
||||||
|
|
||||||
ShippingAddress shippingAddress = ShippingAddress();
|
ShippingAddress shippingAddress = ShippingAddress();
|
||||||
|
|
||||||
@@ -205,7 +206,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
TextFieldWidget(title: "Description".tr, hintText: "Enter Description".tr, controller: controller.descriptionController.value, maxLine: 5),
|
TextFieldWidget(title: "Description".tr(), hintText: "Enter Description".tr(), controller: controller.descriptionController.value, maxLine: 5),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -225,7 +226,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
closeIconColor: isDark ? Colors.white : Colors.black,
|
closeIconColor: isDark ? Colors.white : Colors.black,
|
||||||
).show(context);
|
).show(context);
|
||||||
},
|
},
|
||||||
child: TextFieldWidget(title: "Booking Date & Slot".tr, hintText: "Choose Date and Time".tr, controller: controller.dateTimeController.value, enable: false),
|
child: TextFieldWidget(title: "Booking Date & Slot".tr(), hintText: "Choose Date and Time".tr(), controller: controller.dateTimeController.value, enable: false),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
controller.provider.value?.priceUnit == "Fixed"
|
controller.provider.value?.priceUnit == "Fixed"
|
||||||
@@ -248,7 +249,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
buildPromoCode(controller, isDark),
|
buildPromoCode(controller, isDark),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 10),
|
padding: EdgeInsets.symmetric(vertical: 10),
|
||||||
child: Text("Price Detail".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
child: Text("Price Detail".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
priceTotalRow(controller, isDark),
|
priceTotalRow(controller, isDark),
|
||||||
],
|
],
|
||||||
@@ -259,7 +260,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
bottomNavigationBar: Padding(
|
bottomNavigationBar: Padding(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: RoundedButtonFill(title: "Confirm".tr, color: AppThemeData.primary300, textColor: AppThemeData.grey50, onPress: () => controller.confirmBooking(context)),
|
child: RoundedButtonFill(title: "Confirm".tr(), color: AppThemeData.primary300, textColor: AppThemeData.grey50, onPress: () => controller.confirmBooking(context)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -288,7 +289,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(top: 3),
|
margin: const EdgeInsets.only(top: 3),
|
||||||
child: Text(
|
child: Text(
|
||||||
coupon.discountType == "Fix Price" ? "${Constant.amountShow(amount: coupon.discount.toString())} ${'OFF'.tr}" : "${coupon.discount} ${'% Off'.tr}",
|
coupon.discountType == "Fix Price" ? "${Constant.amountShow(amount: coupon.discount.toString())} ${'OFF'.tr()}" : "${coupon.discount} ${'% Off'.tr()}",
|
||||||
style: TextStyle(fontWeight: FontWeight.bold, letterSpacing: 0.7, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
style: TextStyle(fontWeight: FontWeight.bold, letterSpacing: 0.7, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -301,7 +302,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
Text(coupon.code ?? '', style: const TextStyle(fontSize: 16, fontWeight: FontWeight.normal, letterSpacing: 0.5, color: Colors.orange)),
|
Text(coupon.code ?? '', style: const TextStyle(fontSize: 16, fontWeight: FontWeight.normal, letterSpacing: 0.5, color: Colors.orange)),
|
||||||
Container(margin: const EdgeInsets.only(left: 15, right: 15, top: 3), width: 1, color: AppThemeData.grey50),
|
Container(margin: const EdgeInsets.only(left: 15, right: 15, top: 3), width: 1, color: AppThemeData.grey50),
|
||||||
Text(
|
Text(
|
||||||
"valid till ".tr + controller.getDate(coupon.expiresAt!.toDate().toString()),
|
"valid till ".tr() + controller.getDate(coupon.expiresAt!.toDate().toString()),
|
||||||
style: TextStyle(letterSpacing: 0.5, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
style: TextStyle(letterSpacing: 0.5, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -337,10 +338,10 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("Promo Code".tr, style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900), overflow: TextOverflow.ellipsis),
|
Text("Promo Code".tr(), style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900), overflow: TextOverflow.ellipsis),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"Apply promo code".tr,
|
"Apply promo code".tr(),
|
||||||
style: AppThemeData.mediumTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
style: AppThemeData.mediumTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
@@ -402,12 +403,12 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
Container(padding: const EdgeInsets.only(top: 30), child: const Image(image: AssetImage('assets/images/redeem_coupon.png'), width: 100)),
|
Container(padding: const EdgeInsets.only(top: 30), child: const Image(image: AssetImage('assets/images/redeem_coupon.png'), width: 100)),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.only(top: 20),
|
padding: const EdgeInsets.only(top: 20),
|
||||||
child: Text('Redeem Your Coupons'.tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16)),
|
child: Text('Redeem Your Coupons'.tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16)),
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.only(top: 10, left: 22, right: 22),
|
padding: const EdgeInsets.only(top: 10, left: 22, right: 22),
|
||||||
child: Text("Voucher or Coupon code".tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
child: Text("Voucher or Coupon code".tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
@@ -426,7 +427,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
controller: controller.couponTextController.value,
|
controller: controller.couponTextController.value,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
hintText: "Write Coupon Code".tr,
|
hintText: "Write Coupon Code".tr(),
|
||||||
hintStyle: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark400 : AppThemeData.grey400),
|
hintStyle: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark400 : AppThemeData.grey400),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -437,7 +438,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 30, bottom: 30, left: 15, right: 15),
|
padding: const EdgeInsets.only(top: 30, bottom: 30, left: 15, right: 15),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
title: "REDEEM NOW".tr,
|
title: "REDEEM NOW".tr(),
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey50,
|
textColor: AppThemeData.grey50,
|
||||||
onPress: () {
|
onPress: () {
|
||||||
@@ -449,7 +450,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
controller.applyCoupon(matchingCoupon);
|
controller.applyCoupon(matchingCoupon);
|
||||||
Get.back();
|
Get.back();
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Applied coupon not valid.".tr);
|
ShowToastDialog.showToast("Applied coupon not valid.".tr());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -475,7 +476,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
rowText("Price".tr, Constant.amountShow(amount: controller.price.value.toString()), isDark),
|
rowText("Price".tr(), Constant.amountShow(amount: controller.price.value.toString()), isDark),
|
||||||
controller.discountAmount.value != 0 ? const Divider() : const SizedBox(),
|
controller.discountAmount.value != 0 ? const Divider() : const SizedBox(),
|
||||||
controller.discountAmount.value != 0
|
controller.discountAmount.value != 0
|
||||||
? Padding(
|
? Padding(
|
||||||
@@ -488,7 +489,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${"Discount".tr} ${controller.discountType.value == 'Percentage' || controller.discountType.value == 'Percent' ? "(${controller.discountLabel.value}%)" : "(${Constant.amountShow(amount: controller.discountLabel.value)})"}",
|
"${"Discount".tr()} ${controller.discountType.value == 'Percentage' || controller.discountType.value == 'Percent' ? "(${controller.discountLabel.value}%)" : "(${Constant.amountShow(amount: controller.discountLabel.value)})"}",
|
||||||
style: TextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
style: TextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
Text(controller.offerCode.value, style: TextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text(controller.offerCode.value, style: TextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
@@ -501,7 +502,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
rowText("SubTotal".tr, Constant.amountShow(amount: controller.subTotal.value.toString()), isDark),
|
rowText("SubTotal".tr(), Constant.amountShow(amount: controller.subTotal.value.toString()), isDark),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
itemCount: Constant.taxList.length,
|
itemCount: Constant.taxList.length,
|
||||||
@@ -534,7 +535,7 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
rowText("Total Amount".tr, Constant.amountShow(amount: controller.totalAmount.value.toString()), isDark),
|
rowText("Total Amount".tr(), Constant.amountShow(amount: controller.totalAmount.value.toString()), isDark),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -548,8 +549,8 @@ class OnDemandBookingScreen extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(title.tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text(title.tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
Text(value.tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text(value.tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user