BASE: Initialize Localization.

This commit is contained in:
2025-12-03 18:21:19 +05:00
parent cf58d069ab
commit b04050384d
141 changed files with 1577 additions and 1419 deletions

View File

View File

View File

@@ -80,5 +80,11 @@
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>ru</string>
<string>uz</string>
</array>
</dict>
</plist>

View File

@@ -102,25 +102,25 @@ class ConstTexts {
static String plsLoginToAcc = "plsLoginToAcc";
static String youAreNotLoggedIn = "youAreNotLoggedIn";
static String noOrderfound = "noOrderfound";
static String yourSosrequestAlreadySubmitted = "yourSosrequestAlreadySubmitted";
static String payNow = "payNow";
static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
static String somethingWentWrong = "somethingWentWrong";
static String cash = "cash";
static String coupon = "coupon";
static String couponNotFound = "couponNotFound";
static String tapToApply = "tapToApply";
static String home = "home";
static String myBookings = "myBookings";
static String profile = "profile";
static String wallet = "wallet";
static String cabServiceType = "cabServiceType";
static String everyRideVerified = "everyRideVerified";
static String allDriversIDCheck = "allDriversIDCheck";
static String intercity = "intercity";
static String aroundTheCity = "aroundTheCity";
static String rideDetails = "rideDetails";
static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
static String somethingWentWrong = "somethingWentWrong";
static String cash = "cash";
// static String yourSosrequestAlreadySubmitted = "yourSosrequestAlreadySubmitted";
// static String payNow = "payNow";
// static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
// static String somethingWentWrong = "somethingWentWrong";
// static String cash = "cash";
// static String coupon = "coupon";
// static String couponNotFound = "couponNotFound";
// static String tapToApply = "tapToApply";
// static String home = "home";
// static String myBookings = "myBookings";
// static String profile = "profile";
// static String wallet = "wallet";
// static String cabServiceType = "cabServiceType";
// static String everyRideVerified = "everyRideVerified";
// static String allDriversIDCheck = "allDriversIDCheck";
// static String intercity = "intercity";
// static String aroundTheCity = "aroundTheCity";
// static String rideDetails = "rideDetails";
// static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
// static String somethingWentWrong = "somethingWentWrong";
// static String cash = "cash";
}

View File

@@ -1,5 +1,6 @@
import 'dart:convert';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
import '../../models/onprovider_order_model.dart';
@@ -72,7 +73,7 @@ class OnDemandPaymentController extends GetxController {
Future<void> placeOrder() async {
if (!isExtra) {
// Normal Order
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
onDemandOrderModel.value?.payment_method = selectedPaymentMethod.value;
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);
}
ShowToastDialog.showToast("OnDemand Service successfully booked".tr);
ShowToastDialog.showToast("OnDemand Service successfully booked".tr());
}
if (selectedPaymentMethod.value == PaymentGateway.wallet.name) {
WalletTransactionModel transactionModel = WalletTransactionModel(
@@ -102,8 +103,8 @@ class OnDemandPaymentController extends GetxController {
userId: FireStoreUtils.getCurrentUid(),
isTopup: false,
orderId: onDemandOrderModel.value!.id,
note: "Booking Amount debited".tr,
paymentStatus: "success".tr,
note: "Booking Amount debited".tr(),
paymentStatus: "success".tr(),
);
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
@@ -133,7 +134,7 @@ class OnDemandPaymentController extends GetxController {
isTopup: false,
orderId: onDemandOrderModel.value!.id,
note: "Booking Extra charge debited",
paymentStatus: "success".tr,
paymentStatus: "success".tr(),
);
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
@@ -156,7 +157,7 @@ class OnDemandPaymentController extends GetxController {
isTopup: true,
orderId: onDemandOrderModel.value?.id,
note: 'Extra Charge Amount Credited',
paymentStatus: "success".tr,
paymentStatus: "success".tr(),
);
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
@@ -252,7 +253,7 @@ class OnDemandPaymentController extends GetxController {
log("stripe Responce====>$paymentIntentData");
if (paymentIntentData!.containsKey("error")) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
@@ -276,7 +277,7 @@ class OnDemandPaymentController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
placeOrder();
});
} on StripeException catch (e) {
@@ -342,10 +343,10 @@ class OnDemandPaymentController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -377,15 +378,15 @@ class OnDemandPaymentController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
placeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
),
),
@@ -412,14 +413,14 @@ class OnDemandPaymentController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -476,11 +477,11 @@ class OnDemandPaymentController extends GetxController {
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
placeOrder();
} else {
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);
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
Get.back();
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
}
return GetPaymentTxtTokenModel.fromJson(data);
}
@@ -618,18 +619,18 @@ class OnDemandPaymentController extends GetxController {
void handlePaymentSuccess(PaymentSuccessResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
@@ -644,10 +645,10 @@ class OnDemandPaymentController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -672,7 +673,7 @@ class OnDemandPaymentController extends GetxController {
final responseData = jsonDecode(response.body);
return responseData['payment_url'];
} else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
return '';
}
}
@@ -702,12 +703,12 @@ class OnDemandPaymentController extends GetxController {
if (paymentURL.toString().isNotEmpty) {
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
}
@@ -726,13 +727,13 @@ class OnDemandPaymentController extends GetxController {
accessToken = responseData['access_token'] ?? '';
if (accessToken.isEmpty) {
ShowToastDialog.showToast("Failed to get access token".tr);
ShowToastDialog.showToast("Failed to get access token".tr());
return '';
}
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -773,7 +774,7 @@ class OnDemandPaymentController extends GetxController {
return '';
}
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -800,13 +801,13 @@ class OnDemandPaymentController extends GetxController {
// () => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken),
// )!.then((value) {
// if (value == true) {
// ShowToastDialog.showToast("Payment Successful!!".tr);
// ShowToastDialog.showToast("Payment Successful!!".tr());
// placeOrder();
// ();
// }
// });
// } else {
// ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
// ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
// }
// }
//
@@ -829,7 +830,7 @@ class OnDemandPaymentController extends GetxController {
// // ignore: use_build_context_synchronously
// return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
// } else {
// ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
// ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
// return '';
// }
// }
@@ -870,7 +871,7 @@ class OnDemandPaymentController extends GetxController {
// return '';
// }
// } else {
// ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
// ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
// return '';
// }
// }
@@ -889,11 +890,11 @@ class OnDemandPaymentController extends GetxController {
if (model.id != null) {
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -42,6 +42,7 @@ import 'package:customer/payment/xenditScreen.dart';
import 'package:customer/service/fire_store_utils.dart';
import 'package:customer/themes/show_toast_dialog.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart' as flutterMap;
import 'package:flutter_paypal/flutter_paypal.dart';
@@ -313,20 +314,20 @@ class IntercityHomeController extends GetxController {
Marker(
markerId: const MarkerId("pickup"),
position: LatLng(pickupLat, pickupLng),
infoWindow: InfoWindow(title: "Pickup Location".tr),
infoWindow: InfoWindow(title: "Pickup Location".tr()),
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) {
markers.addAll([
Marker(
markerId: const MarkerId("destination"),
position: LatLng(destLat, destLng),
infoWindow: InfoWindow(title: "Destination Location".tr),
infoWindow: InfoWindow(title: "Destination Location".tr()),
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) {
currentOrder.value.paymentMethod = selectedPaymentMethod.value;
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
ShowToastDialog.showToast("Payment method changed".tr);
ShowToastDialog.showToast("Payment method changed".tr());
Get.back();
Get.back();
});
@@ -433,8 +434,8 @@ class IntercityHomeController extends GetxController {
userId: FireStoreUtils.getCurrentUid(),
isTopup: false,
orderId: currentOrder.value.id,
note: "Cab Amount debited".tr,
paymentStatus: "success".tr,
note: "Cab Amount debited".tr(),
paymentStatus: "success".tr(),
serviceType: Constant.parcelServiceType,
);
@@ -446,7 +447,7 @@ class IntercityHomeController extends GetxController {
}
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
Get.back();
});
}
@@ -572,7 +573,7 @@ class IntercityHomeController extends GetxController {
final LatLng pos = LatLng(lat, lng);
final markerId = MarkerId(isDeparture ? 'Departure' : 'Destination');
final icon = isDeparture ? departureIcon! : destinationIcon!;
final title = isDeparture ? 'Departure'.tr : 'Destination'.tr;
final title = isDeparture ? 'Departure'.tr() : 'Destination'.tr();
if (isDeparture) {
departureLatLong.value = pos;
@@ -1031,7 +1032,7 @@ class IntercityHomeController extends GetxController {
log("stripe Responce====>$paymentIntentData");
if (paymentIntentData!.containsKey("error")) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
@@ -1055,7 +1056,7 @@ class IntercityHomeController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
completeOrder();
});
} on StripeException catch (e) {
@@ -1121,10 +1122,10 @@ class IntercityHomeController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -1156,15 +1157,15 @@ class IntercityHomeController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
completeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
),
),
@@ -1188,14 +1189,14 @@ class IntercityHomeController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -1256,11 +1257,11 @@ class IntercityHomeController extends GetxController {
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
completeOrder();
} else {
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);
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
Get.back();
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
}
return GetPaymentTxtTokenModel.fromJson(data);
}
@@ -1398,18 +1399,18 @@ class IntercityHomeController extends GetxController {
void handlePaymentSuccess(PaymentSuccessResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
@@ -1424,10 +1425,10 @@ class IntercityHomeController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -1452,7 +1453,7 @@ class IntercityHomeController extends GetxController {
final responseData = jsonDecode(response.body);
return responseData['payment_url'];
} else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
return '';
}
}
@@ -1477,13 +1478,13 @@ class IntercityHomeController extends GetxController {
if (paymentURL.toString() != '') {
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
}
@@ -1506,7 +1507,7 @@ class IntercityHomeController extends GetxController {
// ignore: use_build_context_synchronously
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -1543,7 +1544,7 @@ class IntercityHomeController extends GetxController {
return '';
}
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -1562,11 +1563,11 @@ class IntercityHomeController extends GetxController {
if (model.id != null) {
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -3,6 +3,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/widget/geoflutterfire/src/geoflutterfire.dart';
import 'package:dropdown_textfield/dropdown_textfield.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';
@@ -101,10 +102,10 @@ class BookParcelController extends GetxController {
void onCameraClick(BuildContext context) {
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>[
CupertinoActionSheetAction(
child: Text('Choose image from gallery'.tr),
child: Text('Choose image from gallery'.tr()),
onPressed: () async {
Navigator.pop(context);
final imageList = await _picker.pickMultiImage();
@@ -114,7 +115,7 @@ class BookParcelController extends GetxController {
},
),
CupertinoActionSheetAction(
child: Text('Take a picture'.tr),
child: Text('Take a picture'.tr()),
onPressed: () async {
Navigator.pop(context);
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);
}
@@ -147,38 +148,38 @@ class BookParcelController extends GetxController {
bool validateFields() {
if (senderNameController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter sender name".tr);
ShowToastDialog.showToast("Please enter sender name".tr());
return false;
} else if (senderMobileController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter sender mobile".tr);
ShowToastDialog.showToast("Please enter sender mobile".tr());
return false;
} else if (senderLocationController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter sender address".tr);
ShowToastDialog.showToast("Please enter sender address".tr());
return false;
} else if (receiverNameController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter receiver name".tr);
ShowToastDialog.showToast("Please enter receiver name".tr());
return false;
} else if (receiverMobileController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter receiver mobile".tr);
ShowToastDialog.showToast("Please enter receiver mobile".tr());
return false;
} else if (receiverLocationController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter receiver address".tr);
ShowToastDialog.showToast("Please enter receiver address".tr());
return false;
} else if (isScheduled.value) {
if (scheduledDate.value.isEmpty) {
ShowToastDialog.showToast("Please select scheduled date".tr);
ShowToastDialog.showToast("Please select scheduled date".tr());
return false;
} else if (scheduledTime.value.isEmpty) {
ShowToastDialog.showToast("Please select scheduled time".tr);
ShowToastDialog.showToast("Please select scheduled time".tr());
return false;
}
}
if (selectedWeight == null) {
ShowToastDialog.showToast("Please select parcel weight".tr);
ShowToastDialog.showToast("Please select parcel weight".tr());
return false;
} 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 true;
@@ -203,14 +204,14 @@ class BookParcelController extends GetxController {
}
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;
}
subTotal.value = (distance.value * double.parse(selectedWeight!.deliveryCharge.toString()));
goToCart();
} catch (e) {
ShowToastDialog.showToast("Something went wrong while booking.".tr);
ShowToastDialog.showToast("Something went wrong while booking.".tr());
debugPrint("bookNow error: $e");
}
}

View File

@@ -40,6 +40,7 @@ import 'package:customer/payment/xenditScreen.dart';
import 'package:customer/service/fire_store_utils.dart';
import 'package:customer/themes/show_toast_dialog.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart' as flutterMap;
import 'package:flutter_paypal/flutter_paypal.dart';
@@ -304,20 +305,20 @@ class CabBookingController extends GetxController {
Marker(
markerId: const MarkerId("pickup"),
position: LatLng(pickupLat, pickupLng),
infoWindow: InfoWindow(title: "Pickup Location".tr),
infoWindow: InfoWindow(title: "Pickup Location".tr()),
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) {
markers.addAll([
Marker(
markerId: const MarkerId("destination"),
position: LatLng(destLat, destLng),
infoWindow: InfoWindow(title: "Destination Location".tr),
infoWindow: InfoWindow(title: "Destination Location".tr()),
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) {
currentOrder.value.paymentMethod = selectedPaymentMethod.value;
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
ShowToastDialog.showToast("Payment method changed".tr);
ShowToastDialog.showToast("Payment method changed".tr());
Get.back();
Get.back();
});
@@ -437,7 +438,7 @@ class CabBookingController extends GetxController {
}
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
Get.back();
});
}
@@ -539,7 +540,7 @@ class CabBookingController extends GetxController {
final markerId = MarkerId('Stop $index');
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();
}
@@ -563,7 +564,7 @@ class CabBookingController extends GetxController {
final LatLng pos = LatLng(lat, lng);
final markerId = MarkerId(isDeparture ? 'Departure' : 'Destination');
final icon = isDeparture ? departureIcon! : destinationIcon!;
final title = isDeparture ? 'Departure'.tr : 'Destination'.tr;
final title = isDeparture ? 'Departure'.tr() : 'Destination'.tr();
if (isDeparture) {
departureLatLong.value = pos;
@@ -1022,7 +1023,7 @@ class CabBookingController extends GetxController {
log("stripe Responce====>$paymentIntentData");
if (paymentIntentData!.containsKey("error")) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
@@ -1046,7 +1047,7 @@ class CabBookingController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
completeOrder();
});
} on StripeException catch (e) {
@@ -1112,10 +1113,10 @@ class CabBookingController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -1147,15 +1148,15 @@ class CabBookingController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
completeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
),
),
@@ -1179,14 +1180,14 @@ class CabBookingController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -1247,11 +1248,11 @@ class CabBookingController extends GetxController {
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
completeOrder();
} else {
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);
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
Get.back();
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
}
return GetPaymentTxtTokenModel.fromJson(data);
}
@@ -1389,18 +1390,18 @@ class CabBookingController extends GetxController {
void handlePaymentSuccess(PaymentSuccessResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
@@ -1415,10 +1416,10 @@ class CabBookingController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -1443,7 +1444,7 @@ class CabBookingController extends GetxController {
final responseData = jsonDecode(response.body);
return responseData['payment_url'];
} else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
return '';
}
}
@@ -1468,13 +1469,13 @@ class CabBookingController extends GetxController {
if (paymentURL.toString() != '') {
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
}
@@ -1497,7 +1498,7 @@ class CabBookingController extends GetxController {
// ignore: use_build_context_synchronously
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -1534,7 +1535,7 @@ class CabBookingController extends GetxController {
return '';
}
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -1553,11 +1554,11 @@ class CabBookingController extends GetxController {
if (model.id != null) {
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -1,5 +1,6 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/models/cab_order_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../constant/collection_name.dart';
@@ -67,11 +68,11 @@ class CabReviewController extends GetxController {
/// Save / update review
Future<void> submitReview() async {
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;
}
ShowToastDialog.showLoader("Submit in...".tr);
ShowToastDialog.showLoader("Submit in...".tr());
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');

View File

@@ -13,6 +13,7 @@ import 'package:customer/models/user_model.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_paypal/flutter_paypal.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) {
setOrder();
} 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 {
setOrder();
@@ -335,13 +336,13 @@ class CartController extends GetxController {
}
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) {
await FireStoreUtils.getVendorById(vendorModel.value.id!).then((vender) async {
if (vender?.subscriptionTotalOrders == '0' || vender?.subscriptionTotalOrders == null) {
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;
}
});
@@ -402,8 +403,8 @@ class CartController extends GetxController {
userId: FireStoreUtils.getCurrentUid(),
isTopup: false,
orderId: orderModel.id,
note: "Order Amount debited".tr,
paymentStatus: "success".tr,
note: "Order Amount debited".tr(),
paymentStatus: "success".tr(),
);
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
@@ -540,7 +541,7 @@ class CartController extends GetxController {
log("stripe Responce====>$paymentIntentData");
if (paymentIntentData!.containsKey("error")) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
@@ -564,7 +565,7 @@ class CartController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
placeOrder();
});
} on StripeException catch (e) {
@@ -630,10 +631,10 @@ class CartController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -665,15 +666,15 @@ class CartController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
placeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
),
),
@@ -697,14 +698,14 @@ class CartController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -765,11 +766,11 @@ class CartController extends GetxController {
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
placeOrder();
} else {
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);
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
Get.back();
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
}
return GetPaymentTxtTokenModel.fromJson(data);
}
@@ -906,18 +907,18 @@ class CartController extends GetxController {
}
void handlePaymentSuccess(PaymentSuccessResponse response) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
@@ -932,10 +933,10 @@ class CartController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -960,7 +961,7 @@ class CartController extends GetxController {
final responseData = jsonDecode(response.body);
return responseData['payment_url'];
} else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
return '';
}
}
@@ -985,13 +986,13 @@ class CartController extends GetxController {
if (paymentURL.toString() != '') {
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
}
@@ -1014,7 +1015,7 @@ class CartController extends GetxController {
// ignore: use_build_context_synchronously
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -1051,7 +1052,7 @@ class CartController extends GetxController {
return '';
}
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -1070,11 +1071,11 @@ class CartController extends GetxController {
if (model.id != null) {
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -1,5 +1,6 @@
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:image_picker/image_picker.dart';
import '../models/conversation_model.dart';
@@ -93,11 +94,11 @@ class ChatController extends GetxController {
if (url != null) {
if (url.mime.contains('image')) {
conversationModel.message = "sent a message".tr;
conversationModel.message = "sent a message".tr();
} else if (url.mime.contains('video')) {
conversationModel.message = "Sent a video".tr;
conversationModel.message = "Sent a video".tr();
} 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');
// Get.back();
// } on PlatformException catch (e) {
// ShowToastDialog.showToast("${"failed_to_pick".tr} : \n $e");
// ShowToastDialog.showToast("${"failed_to_pick".tr()} : \n $e");
// }
// }
}

View File

@@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../models/cab_order_model.dart';
@@ -21,7 +22,7 @@ class ComplainController extends GetxController {
order.value = args['order'] as CabOrderModel;
getComplain();
} else {
ShowToastDialog.showToast("Order data not found".tr);
ShowToastDialog.showToast("Order data not found".tr());
Get.back();
}
}
@@ -35,7 +36,7 @@ class ComplainController extends GetxController {
comment.value.text = data['description'] ?? '';
}
} catch (e) {
ShowToastDialog.showToast("Failed to load complaint".tr);
ShowToastDialog.showToast("Failed to load complaint".tr());
} finally {
isLoading.value = false;
}
@@ -44,12 +45,12 @@ class ComplainController extends GetxController {
Future<void> submitComplain() async {
// Validation
if (title.value.text.trim().isEmpty) {
ShowToastDialog.showToast("Please enter complaint title".tr);
ShowToastDialog.showToast("Please enter complaint title".tr());
return;
}
if (comment.value.text.trim().isEmpty) {
ShowToastDialog.showToast("Please enter complaint description".tr);
ShowToastDialog.showToast("Please enter complaint description".tr());
return;
}
@@ -72,15 +73,15 @@ class ComplainController extends GetxController {
);
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Your complaint has been submitted to admin".tr);
ShowToastDialog.showToast("Your complaint has been submitted to admin".tr());
Get.back();
} else {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Your complaint is already submitted".tr);
ShowToastDialog.showToast("Your complaint is already submitted".tr());
}
} catch (e) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Something went wrong, please try again".tr);
ShowToastDialog.showToast("Something went wrong, please try again".tr());
} finally {
isLoading.value = false;
}

View File

@@ -4,6 +4,7 @@ import 'package:customer/constant/constant.dart';
import 'package:customer/models/dine_in_booking_model.dart';
import 'package:customer/models/favourite_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 '../service/fire_store_utils.dart';
import 'package:flutter/material.dart';
@@ -34,9 +35,9 @@ class DineInRestaurantDetailsController extends GetxController {
String getLocalizedOccasion(String key) {
switch (key) {
case "Birthday":
return "Birthday".tr;
return "Birthday".tr();
case "Anniversary":
return "Anniversary".tr;
return "Anniversary".tr();
default:
return key;
}
@@ -61,7 +62,7 @@ class DineInRestaurantDetailsController extends GetxController {
}
Future<void> orderBook() async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
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()));
@@ -91,7 +92,7 @@ class DineInRestaurantDetailsController extends GetxController {
ShowToastDialog.closeLoader();
Get.back();
Get.to(const DineInBookingScreen());
ShowToastDialog.showToast('Dine-In Request submitted successfully.'.tr);
ShowToastDialog.showToast('Dine-In Request submitted successfully.'.tr());
}
void getRecord() {

View File

@@ -1,6 +1,7 @@
import 'dart:io';
import 'package:customer/constant/constant.dart';
import 'package:customer/models/user_model.dart';
import 'package:easy_localization/easy_localization.dart';
import '../service/fire_store_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -42,7 +43,7 @@ class EditProfileController extends GetxController {
}
Future<void> saveData() async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
if (Constant().hasValidUrl(profileImage.value) == false && profileImage.value.isNotEmpty) {
profileImage.value = await Constant.uploadUserImageToFireStorage(
File(profileImage.value),
@@ -71,7 +72,7 @@ class EditProfileController extends GetxController {
Get.back();
profileImage.value = image.path;
} on PlatformException catch (e) {
ShowToastDialog.showToast("${"failed_to_pick".tr} : \n $e");
ShowToastDialog.showToast("${"failed_to_pick".tr()} : \n $e");
}
}
}

View File

@@ -1,4 +1,5 @@
import 'package:customer/service/fire_store_utils.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -69,13 +70,13 @@ class EnterManuallyLocationController extends GetxController {
String getLocalizedSaveAs(String key) {
switch (key) {
case 'Home':
return 'Home'.tr;
return 'Home'.tr();
case 'Work':
return 'Work'.tr;
return 'Work'.tr();
case 'Hotel':
return 'Hotel'.tr;
return 'Hotel'.tr();
case 'Other':
return 'Other'.tr;
return 'Other'.tr();
default:
return key;
}

View File

@@ -9,6 +9,7 @@ import 'package:customer/models/favourite_model.dart';
import 'package:customer/models/vendor_category_model.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
@@ -32,7 +33,7 @@ class FoodHomeController extends GetxController {
RxBool isLoading = true.obs;
RxBool isListView = 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> pageBottomController = PageController(viewportFraction: 0.877).obs;

View File

@@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -11,17 +12,17 @@ class ForgotPasswordController extends GetxController {
final email = emailEditingController.value.text.trim();
if (email.isEmpty) {
ShowToastDialog.showToast("Please enter your email address.".tr);
ShowToastDialog.showToast("Please enter your email address.".tr());
return;
}
if (!GetUtils.isEmail(email)) {
ShowToastDialog.showToast("Please enter a valid email address.".tr);
ShowToastDialog.showToast("Please enter a valid email address.".tr());
return;
}
try {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
await FirebaseAuth.instance.sendPasswordResetEmail(email: email);
ShowToastDialog.closeLoader();
ShowToastDialog.showToast(
@@ -31,9 +32,9 @@ class ForgotPasswordController extends GetxController {
} on FirebaseAuthException catch (e) {
ShowToastDialog.closeLoader();
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 {
ShowToastDialog.showToast(e.message?.tr ?? "something_went_wrong".tr);
ShowToastDialog.showToast(e.message?.tr() ?? "something_went_wrong".tr());
}
}
}

View File

@@ -6,6 +6,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/constant/constant.dart';
import 'package:customer/models/gift_cards_model.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_stripe/flutter_stripe.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)) {
setOrder();
} 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 {
setOrder();
@@ -103,7 +104,7 @@ class GiftCardController extends GetxController {
}
Future<void> setOrder() async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
GiftCardsOrderModel giftCardsOrderModel = GiftCardsOrderModel();
giftCardsOrderModel.id = const Uuid().v4();
giftCardsOrderModel.giftId = selectedGiftCard.value.id.toString();
@@ -129,8 +130,8 @@ class GiftCardController extends GetxController {
userId: FireStoreUtils.getCurrentUid(),
isTopup: false,
orderId: giftCardsOrderModel.id,
note: "Gift card purchase amount debited".tr,
paymentStatus: "success".tr);
note: "Gift card purchase amount debited".tr(),
paymentStatus: "success".tr());
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
if (value == true) {
@@ -141,7 +142,7 @@ class GiftCardController extends GetxController {
await FireStoreUtils.placeGiftCardOrder(giftCardsOrderModel);
ShowToastDialog.closeLoader();
Get.off(const HistoryGiftCard());
ShowToastDialog.showToast("Gift card Purchases successfully".tr);
ShowToastDialog.showToast("Gift card Purchases successfully".tr());
}
String generateGiftCode() {
@@ -328,7 +329,7 @@ class GiftCardController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
placeOrder();
});
} on StripeException catch (e) {
@@ -401,10 +402,10 @@ class GiftCardController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -429,14 +430,14 @@ class GiftCardController extends GetxController {
))!
.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -503,11 +504,11 @@ class GiftCardController extends GetxController {
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
placeOrder();
} else {
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.",
onSuccess: (Map params) async {
placeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
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);
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
Get.back();
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
}
return GetPaymentTxtTokenModel.fromJson(data);
}
@@ -690,18 +691,18 @@ class GiftCardController extends GetxController {
void handlePaymentSuccess(PaymentSuccessResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
//Midtrans payment
@@ -714,10 +715,10 @@ class GiftCardController extends GetxController {
))!
.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -749,7 +750,7 @@ class GiftCardController extends GetxController {
final responseData = jsonDecode(response.body);
return responseData['payment_url'];
} else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
return '';
}
}
@@ -782,13 +783,13 @@ class GiftCardController extends GetxController {
))!
.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
}
@@ -815,7 +816,7 @@ class GiftCardController extends GetxController {
// ignore: use_build_context_synchronously
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -853,7 +854,7 @@ class GiftCardController extends GetxController {
return '';
}
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -877,11 +878,11 @@ class GiftCardController extends GetxController {
))!
.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -1,6 +1,7 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/constant/constant.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 '../service/fire_store_utils.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 {
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",
);
}
}

View File

@@ -1,5 +1,6 @@
import 'dart:convert';
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:flutter/material.dart';
import 'package:get/get.dart';
@@ -32,18 +33,18 @@ class LoginController extends GetxController {
final email = emailController.value.text.trim();
final password = passwordController.value.text.trim();
if (email.isEmpty || !email.contains('@')) {
ShowToastDialog.showToast("Please enter a valid email address".tr);
ShowToastDialog.showToast("Please enter a valid email address".tr());
return;
}
if (password.isEmpty) {
ShowToastDialog.showToast("Please enter your password".tr);
ShowToastDialog.showToast("Please enter your password".tr());
return;
}
try {
isLoading.value = true;
ShowToastDialog.showLoader("Logging in...".tr);
ShowToastDialog.showLoader("Logging in...".tr());
final credential = await FirebaseAuth.instance.signInWithEmailAndPassword(email: email, password: password);
@@ -68,23 +69,23 @@ class LoginController extends GetxController {
}
} else {
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());
}
} else {
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());
}
} on FirebaseAuthException catch (e) {
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') {
ShowToastDialog.showToast("Wrong password provided.".tr);
ShowToastDialog.showToast("Wrong password provided.".tr());
} else if (e.code == 'invalid-email') {
ShowToastDialog.showToast("Invalid email.".tr);
ShowToastDialog.showToast("Invalid email.".tr());
} else {
ShowToastDialog.showToast(e.message?.tr ?? "Login failed. Please try again.".tr);
ShowToastDialog.showToast(e.message?.tr() ?? "Login failed. Please try again.".tr());
}
} finally {
isLoading.value = false;
@@ -93,7 +94,7 @@ class LoginController extends GetxController {
}
Future<void> loginWithGoogle() async {
ShowToastDialog.showLoader("please wait...".tr);
ShowToastDialog.showLoader("please wait...".tr());
await signInWithGoogle().then((value) async {
ShowToastDialog.closeLoader();
if (value != null) {
@@ -131,12 +132,12 @@ class LoginController extends GetxController {
}
} else {
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());
}
} else {
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());
}
} else {
@@ -156,7 +157,7 @@ class LoginController extends GetxController {
}
Future<void> loginWithApple() async {
ShowToastDialog.showLoader("please wait...".tr);
ShowToastDialog.showLoader("please wait...".tr());
await signInWithApple().then((value) async {
ShowToastDialog.closeLoader();
if (value != null) {
@@ -197,12 +198,12 @@ class LoginController extends GetxController {
}
} else {
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());
}
} else {
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());
}
} else {

View File

@@ -1,4 +1,5 @@
import 'package:customer/themes/show_toast_dialog.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -18,12 +19,12 @@ class MobileLoginController extends GetxController {
final countryCode = countryCodeController.value.text.trim();
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;
}
try {
ShowToastDialog.showLoader("Sending OTP...".tr);
ShowToastDialog.showLoader("Sending OTP...".tr());
await _auth.verifyPhoneNumber(
phoneNumber: '$countryCode$mobile',
@@ -33,9 +34,9 @@ class MobileLoginController extends GetxController {
verificationFailed: (FirebaseAuthException e) {
ShowToastDialog.closeLoader();
if (e.code == 'invalid-phone-number') {
ShowToastDialog.showToast("Invalid phone number".tr);
ShowToastDialog.showToast("Invalid phone number".tr());
} else {
ShowToastDialog.showToast(e.message ?? "OTP verification failed".tr);
ShowToastDialog.showToast(e.message ?? "OTP verification failed".tr());
}
},
codeSent: (String verificationId, int? resendToken) {
@@ -44,13 +45,13 @@ class MobileLoginController extends GetxController {
},
codeAutoRetrievalTimeout: (String verificationId) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("OTP timed out. Please try again.".tr);
ShowToastDialog.showToast("OTP timed out. Please try again.".tr());
// Optional: Handle timeout
},
);
} catch (e) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Something went wrong. Please try again.".tr);
ShowToastDialog.showToast("Something went wrong. Please try again.".tr());
}
}

View File

@@ -34,6 +34,7 @@ import 'package:customer/payment/xenditScreen.dart';
import 'package:customer/service/fire_store_utils.dart';
import 'package:customer/themes/show_toast_dialog.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_paypal/flutter_paypal.dart';
@@ -112,13 +113,13 @@ class MyCabBookingController extends GetxController {
String getLocalizedTabTitle(String tabKey) {
switch (tabKey) {
case "New":
return "New".tr;
return "New".tr();
case "On Going":
return "On Going".tr;
return "On Going".tr();
case "Completed":
return "Completed".tr;
return "Completed".tr();
case "Cancelled":
return "Cancelled".tr;
return "Cancelled".tr();
default:
return tabKey;
}
@@ -185,7 +186,7 @@ class MyCabBookingController extends GetxController {
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
selectedOrder.value.paymentMethod = selectedPaymentMethod.value;
await FireStoreUtils.cabOrderPlace(selectedOrder.value).then((value) {
ShowToastDialog.showToast("Payment method changed".tr);
ShowToastDialog.showToast("Payment method changed".tr());
Get.back();
});
} else {
@@ -203,8 +204,8 @@ class MyCabBookingController extends GetxController {
userId: FireStoreUtils.getCurrentUid(),
isTopup: false,
orderId: selectedOrder.value.id,
note: "Cab Amount debited".tr,
paymentStatus: "success".tr,
note: "Cab Amount debited".tr(),
paymentStatus: "success".tr(),
serviceType: Constant.parcelServiceType,
);
@@ -214,7 +215,7 @@ class MyCabBookingController extends GetxController {
}
selectedOrder.value.paymentStatus = true;
await FireStoreUtils.cabOrderPlace(selectedOrder.value).then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
Get.back();
});
}
@@ -280,7 +281,7 @@ class MyCabBookingController extends GetxController {
log("stripe Responce====>$paymentIntentData");
if (paymentIntentData!.containsKey("error")) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
@@ -304,7 +305,7 @@ class MyCabBookingController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
completeOrder();
});
} on StripeException catch (e) {
@@ -374,10 +375,10 @@ class MyCabBookingController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -409,15 +410,15 @@ class MyCabBookingController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
completeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
),
),
@@ -444,14 +445,14 @@ class MyCabBookingController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -514,11 +515,11 @@ class MyCabBookingController extends GetxController {
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
completeOrder();
} else {
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);
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
Get.back();
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
}
return GetPaymentTxtTokenModel.fromJson(data);
}
@@ -668,18 +669,18 @@ class MyCabBookingController extends GetxController {
void handlePaymentSuccess(PaymentSuccessResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
@@ -694,10 +695,10 @@ class MyCabBookingController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -728,7 +729,7 @@ class MyCabBookingController extends GetxController {
final responseData = jsonDecode(response.body);
return responseData['payment_url'];
} else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
return '';
}
}
@@ -762,13 +763,13 @@ class MyCabBookingController extends GetxController {
),
)!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
}
@@ -795,7 +796,7 @@ class MyCabBookingController extends GetxController {
// ignore: use_build_context_synchronously
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -840,7 +841,7 @@ class MyCabBookingController extends GetxController {
return '';
}
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -861,11 +862,11 @@ class MyCabBookingController extends GetxController {
() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()),
)!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -4,6 +4,7 @@ import 'package:customer/constant/constant.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/themes/show_toast_dialog.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:get/get.dart';
import '../models/rental_order_model.dart';
import '../models/tax_model.dart';
@@ -111,7 +112,7 @@ class MyRentalBookingController extends GetxController {
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
selectedOrder.value.paymentMethod = selectedPaymentMethod.value;
await FireStoreUtils.rentalOrderPlace(selectedOrder.value).then((value) {
ShowToastDialog.showToast("Payment method changed".tr);
ShowToastDialog.showToast("Payment method changed".tr());
Get.back();
Get.back();
});
@@ -128,8 +129,8 @@ class MyRentalBookingController extends GetxController {
userId: FireStoreUtils.getCurrentUid(),
isTopup: false,
orderId: selectedOrder.value.id,
note: "Rental Amount debited".tr,
paymentStatus: "success".tr,
note: "Rental Amount debited".tr(),
paymentStatus: "success".tr(),
serviceType: Constant.parcelServiceType,
);
@@ -141,7 +142,7 @@ class MyRentalBookingController extends GetxController {
}
await FireStoreUtils.rentalOrderPlace(selectedOrder.value).then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
Get.back();
Get.back();
});
@@ -204,17 +205,17 @@ class MyRentalBookingController extends GetxController {
isTopup: true,
// refund
orderId: order.id,
note: "Refund for cancelled booking".tr,
paymentStatus: "success".tr,
note: "Refund for cancelled booking".tr(),
paymentStatus: "success".tr(),
serviceType: Constant.parcelServiceType,
);
await FireStoreUtils.setWalletTransaction(walletTransaction);
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
}
ShowToastDialog.showToast("Booking cancelled successfully".tr);
ShowToastDialog.showToast("Booking cancelled successfully".tr());
} catch (e) {
ShowToastDialog.showToast("Failed to cancel booking: $e".tr);
ShowToastDialog.showToast("Failed to cancel booking: $e".tr());
} finally {
isLoading.value = false;
}

View File

@@ -2,6 +2,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/constant/constant.dart';
import 'package:customer/models/coupon_model.dart';
import 'package:customer/models/user_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
@@ -132,9 +133,9 @@ class OnDemandBookingController extends GetxController {
Future<void> confirmBooking(BuildContext context) async {
if (selectedAddress.value.getFullAddress().isEmpty) {
ShowToastDialog.showToast("Please enter address".tr);
ShowToastDialog.showToast("Please enter address".tr());
} else if (dateTimeController.value.text.isEmpty) {
ShowToastDialog.showToast("Please select time slot.".tr);
ShowToastDialog.showToast("Please select time slot.".tr());
} else {
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});
} else {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
OnProviderOrderModel onDemandOrder = OnProviderOrderModel(
otp: Constant.getReferralCode(),
authorID: FireStoreUtils.getCurrentUid(),
@@ -207,7 +208,7 @@ class OnDemandBookingController extends GetxController {
Get.offAll(const OnDemandDashboardScreen());
OnDemandDashboardController controller = Get.put(OnDemandDashboardController());
controller.selectedIndex.value = 2;
ShowToastDialog.showToast("OnDemand Service successfully booked".tr);
ShowToastDialog.showToast("OnDemand Service successfully booked".tr());
}
}
}

View File

@@ -2,6 +2,7 @@ import 'dart:developer';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/models/coupon_model.dart';
import 'package:customer/models/user_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import '../constant/constant.dart';
@@ -144,7 +145,7 @@ class OnDemandOrderDetailsController extends GetxController {
final order = onProviderOrder.value;
if (order == null) return;
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
try {
double total = 0.0;
@@ -186,7 +187,7 @@ class OnDemandOrderDetailsController extends GetxController {
isTopup: true,
orderId: order.id,
note: 'Booking Amount Refund',
paymentStatus: "success".tr,
paymentStatus: "success".tr(),
),
);
@@ -204,7 +205,7 @@ class OnDemandOrderDetailsController extends GetxController {
isTopup: false,
orderId: order.id,
note: 'Booking Amount Refund',
paymentStatus: "success".tr,
paymentStatus: "success".tr(),
),
);
}
@@ -224,7 +225,7 @@ class OnDemandOrderDetailsController extends GetxController {
isTopup: true,
orderId: order.id,
note: 'Admin commission refund',
paymentStatus: "success".tr,
paymentStatus: "success".tr(),
),
);
}
@@ -244,11 +245,11 @@ class OnDemandOrderDetailsController extends GetxController {
ShowToastDialog.closeLoader();
Get.back();
ShowToastDialog.showToast("Booking cancelled successfully".tr);
ShowToastDialog.showToast("Booking cancelled successfully".tr());
} catch (e, st) {
log("Cancel error: $e\n$st");
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Something went wrong".tr);
ShowToastDialog.showToast("Something went wrong".tr());
}
}
}

View File

@@ -1,4 +1,5 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../constant/collection_name.dart';
@@ -111,7 +112,7 @@ class OnDemandReviewController extends GetxController {
}
Future<void> _providerReviewSubmit() async {
ShowToastDialog.showLoader("Submit in...".tr);
ShowToastDialog.showLoader("Submit in...".tr());
providerServiceModel.value!.reviewsCount = serviceReviewCount.value + 1;
providerServiceModel.value!.reviewsSum = serviceReviewSum.value + ratings.value;
@@ -142,7 +143,7 @@ class OnDemandReviewController extends GetxController {
}
Future<void> _workerReviewSubmit() async {
ShowToastDialog.showLoader("Submit in...".tr);
ShowToastDialog.showLoader("Submit in...".tr());
workerModel.value!.reviewsCount = workerReviewCount.value + 1;
workerModel.value!.reviewsSum = workerReviewSum.value + ratings.value;

View File

@@ -1,5 +1,6 @@
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.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:flutter/material.dart';
import 'package:get/get.dart';
@@ -42,7 +43,7 @@ class OtpVerifyController extends GetxController {
codeSent: (String verificationId0, int? resendToken0) async {
verificationId.value = verificationId0;
resendToken.value = resendToken0!;
ShowToastDialog.showToast("OTP sent".tr);
ShowToastDialog.showToast("OTP sent".tr());
},
timeout: const Duration(seconds: 25),
forceResendingToken: resendToken.value,
@@ -55,12 +56,12 @@ class OtpVerifyController extends GetxController {
void verifyOtp() async {
if (otpController.value.text.length != 6) {
ShowToastDialog.showToast("Enter valid 6-digit OTP".tr);
ShowToastDialog.showToast("Enter valid 6-digit OTP".tr());
return;
}
try {
ShowToastDialog.showLoader("Verifying OTP...".tr);
ShowToastDialog.showLoader("Verifying OTP...".tr());
final credential = PhoneAuthProvider.credential(verificationId: verificationId.value, smsCode: otpController.value.text.trim());
@@ -91,7 +92,7 @@ class OtpVerifyController extends GetxController {
}
if (userModel.active == false) {
ShowToastDialog.showToast("This user is disabled".tr);
ShowToastDialog.showToast("This user is disabled".tr());
await _auth.signOut();
Get.offAll(() => const LoginScreen());
return;
@@ -110,7 +111,7 @@ class OtpVerifyController extends GetxController {
}
} catch (e) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Invalid OTP or Verification Failed".tr);
ShowToastDialog.showToast("Invalid OTP or Verification Failed".tr());
}
}

View File

@@ -1,5 +1,6 @@
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import '../constant/constant.dart';
@@ -81,7 +82,7 @@ class ParcelMyBookingController extends GetxController {
isLoading.value = true;
if (order.status != Constant.orderPlaced) {
ShowToastDialog.showToast("You can only cancel before pickup.".tr);
ShowToastDialog.showToast("You can only cancel before pickup.".tr());
return;
}
@@ -124,9 +125,9 @@ class ParcelMyBookingController extends GetxController {
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
}
ShowToastDialog.showToast("Order cancelled successfully".tr);
ShowToastDialog.showToast("Order cancelled successfully".tr());
} catch (e) {
ShowToastDialog.showToast("${'Failed to cancel order:'.tr} $e".tr);
ShowToastDialog.showToast("${'Failed to cancel order:'.tr()} $e".tr());
} finally {
isLoading.value = false;
}

View File

@@ -5,6 +5,7 @@ import 'dart:math' as maths;
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/models/coupon_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_paypal/flutter_paypal.dart';
import 'package:flutter_stripe/flutter_stripe.dart';
@@ -135,7 +136,7 @@ class ParcelOrderConfirmationController extends GetxController {
}
Future<void> placeOrder() async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
try {
List<String> parcelImages = [];
@@ -206,7 +207,7 @@ class ParcelOrderConfirmationController extends GetxController {
value,
) async {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Order placed successfully".tr);
ShowToastDialog.showToast("Order placed successfully".tr());
Get.offAll(
() => OrderSuccessfullyPlaced(),
arguments: {'parcelOrder': parcelOrder.value},
@@ -215,7 +216,7 @@ class ParcelOrderConfirmationController extends GetxController {
});
} catch (e) {
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")) {
Get.back();
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr,
"Something went wrong, please contact admin.".tr(),
);
} else {
await Stripe.instance.initPaymentSheet(
@@ -356,7 +357,7 @@ class ParcelOrderConfirmationController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
placeOrder();
});
} on StripeException catch (e) {
@@ -439,10 +440,10 @@ class ParcelOrderConfirmationController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -479,17 +480,17 @@ class ParcelOrderConfirmationController extends GetxController {
onSuccess: (Map params) async {
debugPrint("✅ PayPal Payment Success: $params");
placeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
debugPrint("❌ PayPal Payment Error: $error");
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
debugPrint("⚠️ PayPal Payment Canceled: $params");
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.",
// onSuccess: (Map params) async {
// placeOrder();
// ShowToastDialog.showToast("Payment Successful!!".tr);
// ShowToastDialog.showToast("Payment Successful!!".tr());
// },
// onError: (error) {
// Get.back();
// ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
// ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
// },
// onCancel: (params) {
// Get.back();
// ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
// ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
// },
// ),
// ),
@@ -558,15 +559,15 @@ class ParcelOrderConfirmationController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
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!);
if (isVerified) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
Get.back();
}
});
@@ -675,11 +676,11 @@ class ParcelOrderConfirmationController extends GetxController {
);
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
placeOrder();
} else {
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) {
Get.back();
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);
// if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
// Get.back();
// ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
// ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
// }
// return GetPaymentTxtTokenModel.fromJson(data);
// }
@@ -901,18 +902,18 @@ class ParcelOrderConfirmationController extends GetxController {
void handlePaymentSuccess(PaymentSuccessResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
@@ -930,10 +931,10 @@ class ParcelOrderConfirmationController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -974,7 +975,7 @@ class ParcelOrderConfirmationController extends GetxController {
return responseData['payment_url'];
} else {
ShowToastDialog.showToast(
"something went wrong, please contact admin.".tr,
"something went wrong, please contact admin.".tr(),
);
return '';
}
@@ -1001,7 +1002,7 @@ class ParcelOrderConfirmationController extends GetxController {
debugPrint('🟩 Starting OrangePay Payment...');
debugPrint('💰 Amount: $amount | 🆔 Order ID: $id');
ShowToastDialog.showLoader("Initializing payment...".tr);
ShowToastDialog.showLoader("Initializing payment...".tr());
var paymentURL = await fetchToken(
context: context,
@@ -1026,20 +1027,20 @@ class ParcelOrderConfirmationController extends GetxController {
),
)?.then((value) async {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
debugPrint('🎉 Payment Successful for Order ID: $orderId');
if (Get.isBottomSheetOpen ?? false) Get.back();
await placeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
debugPrint('⚠️ Payment flow closed without success.');
if (Get.isBottomSheetOpen ?? false) Get.back();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
if (Get.isBottomSheetOpen ?? false) Get.back();
}
}
@@ -1085,7 +1086,7 @@ class ParcelOrderConfirmationController extends GetxController {
} else {
debugPrint('❌ Failed to fetch access token.');
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr,
"Something went wrong, please contact admin.".tr(),
);
return '';
}
@@ -1151,7 +1152,7 @@ class ParcelOrderConfirmationController extends GetxController {
} else {
debugPrint('❌ Payment request failed.');
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr,
"Something went wrong, please contact admin.".tr(),
);
return '';
}
@@ -1178,11 +1179,11 @@ class ParcelOrderConfirmationController extends GetxController {
),
)!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
placeOrder();
();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -3,6 +3,7 @@ import 'package:customer/models/rating_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/themes/show_toast_dialog.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import '../constant/constant.dart';
@@ -87,7 +88,7 @@ class ParcelOrderDetailsController extends GetxController {
}
Future<void> cancelParcelOrder() async {
ShowToastDialog.showLoader("Cancelling order...".tr);
ShowToastDialog.showLoader("Cancelling order...".tr());
parcelOrder.value.status = Constant.orderCancelled;
if (parcelOrder.value.paymentMethod?.toLowerCase() != "cod") {
WalletTransactionModel walletTransaction = WalletTransactionModel(
@@ -113,7 +114,7 @@ class ParcelOrderDetailsController extends GetxController {
await FireStoreUtils.parcelOrderPlace(parcelOrder.value);
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Order cancelled successfully".tr);
ShowToastDialog.showToast("Order cancelled successfully".tr());
Get.back(result: true);
}

View File

@@ -1,5 +1,6 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/models/parcel_order_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../models/rating_model.dart';
@@ -70,11 +71,11 @@ class ParcelReviewController extends GetxController {
/// Save / update review
Future<void> submitReview() async {
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;
}
ShowToastDialog.showLoader("Submit in...".tr);
ShowToastDialog.showLoader("Submit in...".tr());
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');

View File

@@ -6,6 +6,7 @@ import 'package:customer/models/order_model.dart';
import 'package:customer/models/product_model.dart';
import 'package:customer/models/vendor_category_model.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:easy_localization/easy_localization.dart';
import '../models/rating_model.dart';
import '../models/review_attribute_model.dart';
import '../service/fire_store_utils.dart';
@@ -118,7 +119,7 @@ class RateProductController extends GetxController {
Future<void> saveRating() async {
if (ratings.value != 0.0) {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
productModel.value.reviewsCount = productReviewCount.value + 1;
productModel.value.reviewsSum = productReviewSum.value + ratings.value;
productModel.value.reviewAttributes = reviewProductAttributes;
@@ -171,10 +172,10 @@ class RateProductController extends GetxController {
await FireStoreUtils.updateVendor(vendorModel.value);
await FireStoreUtils.setProduct(productModel.value);
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Rating saved successfully.".tr);
ShowToastDialog.showToast("Rating saved successfully.".tr());
Get.back();
} else {
ShowToastDialog.showToast("Please add rate for food item.".tr);
ShowToastDialog.showToast("Please add rate for food item.".tr());
}
}

View File

@@ -5,6 +5,7 @@ import 'package:customer/models/coupon_model.dart';
import 'package:customer/models/rental_order_model.dart';
import 'package:customer/service/fire_store_utils.dart';
import 'package:customer/themes/show_toast_dialog.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -71,7 +72,7 @@ class RentalConformationController extends GetxController {
}
Future<void> placeOrder() async {
ShowToastDialog.showLoader("Placing booking...".tr);
ShowToastDialog.showLoader("Placing booking...".tr());
rentalOrderModel.value.discount = discount.value.toString();
rentalOrderModel.value.couponCode = selectedCouponModel.value.code;
rentalOrderModel.value.couponId = selectedCouponModel.value.id;
@@ -79,7 +80,7 @@ class RentalConformationController extends GetxController {
rentalOrderModel.value.otpCode = (maths.Random().nextInt(9000) + 1000).toString();
await FireStoreUtils.rentalOrderPlace(rentalOrderModel.value).then((value) async {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Order placed successfully".tr);
ShowToastDialog.showToast("Order placed successfully".tr());
Get.offAll(const RentalDashboardScreen());
CabRentalDashboardControllers controller = Get.put(CabRentalDashboardControllers());
controller.selectedIndex.value = 1;

View File

@@ -7,6 +7,7 @@ import 'package:customer/models/user_model.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/screen_ui/rental_service/rental_conformation_screen.dart';
import 'package:customer/widget/geoflutterfire/src/geoflutterfire.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:get/get.dart';
@@ -81,7 +82,7 @@ class RentalHomeController extends GetxController {
sourceTextEditController.value.text = address;
}
} catch (e) {
ShowToastDialog.showToast("Unable to fetch current location".tr);
ShowToastDialog.showToast("Unable to fetch current location".tr());
}
}

View File

@@ -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/show_toast_dialog.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_paypal/flutter_paypal.dart';
import 'package:flutter_stripe/flutter_stripe.dart';
@@ -163,7 +164,7 @@ class RentalOrderDetailsController extends GetxController {
totalAmount.value = (subTotal.value - discount.value) + taxAmount.value;
} 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) {
order.value.paymentMethod = selectedPaymentMethod.value;
await FireStoreUtils.rentalOrderPlace(order.value).then((value) {
ShowToastDialog.showToast("Payment method changed".tr);
ShowToastDialog.showToast("Payment method changed".tr());
Get.back();
Get.back();
});
@@ -201,7 +202,7 @@ class RentalOrderDetailsController extends GetxController {
}
await FireStoreUtils.rentalOrderPlace(order.value).then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
Get.back();
Get.back();
});
@@ -245,10 +246,10 @@ class RentalOrderDetailsController extends GetxController {
await FireStoreUtils.setWalletTransaction(walletTransaction);
await FireStoreUtils.updateUserWallet(amount: refundAmount.toString(), userId: FireStoreUtils.getCurrentUid());
}
ShowToastDialog.showToast("Booking cancelled successfully".tr);
ShowToastDialog.showToast("Booking cancelled successfully".tr());
Get.back();
} catch (e) {
ShowToastDialog.showToast("${'Failed to cancel booking:'.tr} $e".tr);
ShowToastDialog.showToast("${'Failed to cancel booking:'.tr()} $e".tr());
} finally {
isLoading.value = false;
}
@@ -329,7 +330,7 @@ class RentalOrderDetailsController extends GetxController {
log("stripe Responce====>$paymentIntentData");
if (paymentIntentData!.containsKey("error")) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
@@ -353,7 +354,7 @@ class RentalOrderDetailsController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
completeOrder();
});
} on StripeException catch (e) {
@@ -419,10 +420,10 @@ class RentalOrderDetailsController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -454,15 +455,15 @@ class RentalOrderDetailsController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
completeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
),
),
@@ -489,14 +490,14 @@ class RentalOrderDetailsController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -557,11 +558,11 @@ class RentalOrderDetailsController extends GetxController {
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
completeOrder();
} else {
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);
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) {
Get.back();
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
}
return GetPaymentTxtTokenModel.fromJson(data);
}
@@ -699,18 +700,18 @@ class RentalOrderDetailsController extends GetxController {
void handlePaymentSuccess(PaymentSuccessResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
@@ -725,10 +726,10 @@ class RentalOrderDetailsController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -753,7 +754,7 @@ class RentalOrderDetailsController extends GetxController {
final responseData = jsonDecode(response.body);
return responseData['payment_url'];
} else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
return '';
}
}
@@ -778,13 +779,13 @@ class RentalOrderDetailsController extends GetxController {
if (paymentURL.toString() != '') {
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
}
@@ -807,7 +808,7 @@ class RentalOrderDetailsController extends GetxController {
// ignore: use_build_context_synchronously
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -844,7 +845,7 @@ class RentalOrderDetailsController extends GetxController {
return '';
}
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -862,10 +863,10 @@ class RentalOrderDetailsController extends GetxController {
if (model.id != null) {
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
completeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -1,4 +1,5 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../constant/collection_name.dart';
@@ -71,11 +72,11 @@ class RentalReviewController extends GetxController {
/// Save / update review
Future<void> submitReview() async {
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;
}
ShowToastDialog.showLoader("Submit in...".tr);
ShowToastDialog.showLoader("Submit in...".tr());
final user = await FireStoreUtils.getUserProfile(order.value?.driverId ?? '');

View File

@@ -12,6 +12,7 @@ import 'package:customer/models/currency_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/round_button_fill.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:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -75,7 +76,7 @@ class ServiceListController extends GetxController {
SectionModel sectionModel,
) async {
try {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
Constant.sectionConstantModel = sectionModel;
AppThemeData.primary300 = Color(
int.tryParse(sectionModel.color?.replaceFirst("#", "0xff") ?? '') ??
@@ -160,7 +161,7 @@ class ServiceListController extends GetxController {
children: [
Text(
"If you select this Section/Service, your previously added items will be removed from the cart."
.tr,
.tr(),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
@@ -170,7 +171,7 @@ class ServiceListController extends GetxController {
child: RoundedButtonFill(
borderRadius: 10.r,
height: 5.5,
title: "Cancel".tr,
title: "Cancel".tr(),
onPress: () {
Get.back();
},
@@ -182,7 +183,7 @@ class ServiceListController extends GetxController {
Expanded(
child: RoundedButtonFill(
borderRadius: 10.r,
title: "OK".tr,
title: "OK".tr(),
height: 5.5,
onPress: () async {
DatabaseHelper.instance.deleteAllCartProducts();

View File

@@ -1,6 +1,7 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/models/user_model.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:get/get.dart';
import 'package:firebase_auth/firebase_auth.dart' as auth;
@@ -65,7 +66,7 @@ class SignUpController extends GetxController {
try {
if (!_validateInputs()) return;
ShowToastDialog.showLoader("Creating account...".tr);
ShowToastDialog.showLoader("Creating account...".tr());
if (type.value == "mobileNumber") {
await _signUpWithMobile();
@@ -77,29 +78,29 @@ class SignUpController extends GetxController {
} catch (e, st) {
ShowToastDialog.closeLoader();
debugPrint("SIGNUP OUTER EXCEPTION: $e\n$st");
ShowToastDialog.showToast("${'signup_failed'.tr}: $e");
ShowToastDialog.showToast("${'signup_failed'.tr()}: $e");
}
}
/// Validation Logic
bool _validateInputs() {
if (firstNameController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter first name".tr);
ShowToastDialog.showToast("Please enter first name".tr());
return false;
} else if (lastNameController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter last name".tr);
ShowToastDialog.showToast("Please enter last name".tr());
return false;
} 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;
} 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;
} 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;
} 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 true;
@@ -120,17 +121,17 @@ class SignUpController extends GetxController {
} on auth.FirebaseAuthException catch (e) {
debugPrint("FirebaseAuthException caught: code=${e.code}, message=${e.message}");
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') {
ShowToastDialog.showToast("Password is too weak".tr);
ShowToastDialog.showToast("Password is too weak".tr());
} else if (e.code == 'invalid-email') {
ShowToastDialog.showToast("Invalid email address".tr);
ShowToastDialog.showToast("Invalid email address".tr());
} else {
ShowToastDialog.showToast(e.message ?? "signup_failed".tr);
ShowToastDialog.showToast(e.message ?? "signup_failed".tr());
}
} catch (e) {
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);
} catch (e) {
ShowToastDialog.showToast("${'signup_failed'.tr}: $e");
ShowToastDialog.showToast("${'signup_failed'.tr()}: $e");
}
}

View File

@@ -17,6 +17,7 @@ import 'package:customer/models/payment_model/xendit.dart';
import 'package:customer/models/user_model.dart';
import 'package:customer/models/wallet_transaction_model.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_stripe/flutter_stripe.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
@@ -142,7 +143,7 @@ class WalletController extends GetxController {
log("stripe Responce====>$paymentIntentData");
if (paymentIntentData!.containsKey("error")) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
@@ -166,7 +167,7 @@ class WalletController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
walletTopUp();
});
} on StripeException catch (e) {
@@ -231,14 +232,14 @@ class WalletController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
walletTopUp();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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}');
return null;
}
@@ -266,15 +267,15 @@ class WalletController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
walletTopUp();
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
onCancel: (params) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
},
),
),
@@ -298,14 +299,14 @@ class WalletController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
walletTopUp();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} 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);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
walletTopUp();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
}
});
} else {
@@ -366,11 +367,11 @@ class WalletController extends GetxController {
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr);
ShowToastDialog.showToast("Payment successfully".tr());
walletTopUp();
} else {
Get.back();
ShowToastDialog.showToast("Payment Failed".tr);
ShowToastDialog.showToast("Payment Failed".tr());
}
});
}
@@ -402,18 +403,18 @@ class WalletController extends GetxController {
}
void handlePaymentSuccess(PaymentSuccessResponse response) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
walletTopUp();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr);
ShowToastDialog.showToast("Payment Processing!! via".tr());
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr);
ShowToastDialog.showToast("Payment Failed!!".tr());
}
//Midtrans payment
@@ -423,10 +424,10 @@ class WalletController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
walletTopUp();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}
@@ -451,7 +452,7 @@ class WalletController extends GetxController {
final responseData = jsonDecode(response.body);
return responseData['payment_url'];
} else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
return '';
}
}
@@ -476,12 +477,12 @@ class WalletController extends GetxController {
if (paymentURL.toString() != '') {
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
walletTopUp();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
}
@@ -501,7 +502,7 @@ class WalletController extends GetxController {
accessToken = responseData['access_token'];
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -540,7 +541,7 @@ class WalletController extends GetxController {
return '';
}
} else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
return '';
}
}
@@ -559,10 +560,10 @@ class WalletController extends GetxController {
if (model.id != null) {
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr);
ShowToastDialog.showToast("Payment Successful!!".tr());
walletTopUp();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
}
});
}

View File

@@ -3,6 +3,7 @@ import 'package:customer/service/localization_service.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/easy_loading_config.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
@@ -14,6 +15,7 @@ import 'firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
await Firebase.initializeApp(
name: 'default',
options: DefaultFirebaseOptions.currentPlatform,
@@ -24,7 +26,18 @@ void main() async {
Get.put(ThemeController());
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 {
@@ -41,6 +54,9 @@ class MyApp extends StatelessWidget {
minTextAdapt: true,
splitScreenMode: true,
child: GetMaterialApp(
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
debugShowCheckedModeBanner: false,
builder: (context, child) {
return SafeArea(
@@ -50,7 +66,6 @@ class MyApp extends StatelessWidget {
);
},
translations: LocalizationService(),
locale: LocalizationService.locale,
fallbackLocale: LocalizationService.locale,
themeMode: themeController.themeMode,
theme: ThemeData(

View File

@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:customer/constant/constant.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:webview_flutter/webview_flutter.dart';
@@ -57,7 +58,7 @@ class _MercadoPagoScreenState extends State<MercadoPagoScreen> {
},
child: Scaffold(
appBar: AppBar(
title: Text("Payment".tr),
title: Text("Payment".tr()),
centerTitle: false,
leading: GestureDetector(
onTap: () {
@@ -77,18 +78,18 @@ class _MercadoPagoScreenState extends State<MercadoPagoScreen> {
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: Text('Cancel Payment'.tr),
content: SingleChildScrollView(child: Text("Cancel Payment?".tr)),
title: Text('Cancel Payment'.tr()),
content: SingleChildScrollView(child: Text("Cancel Payment?".tr())),
actions: <Widget>[
TextButton(
child: Text('Cancel'.tr, style: const TextStyle(color: Colors.red)),
child: Text('Cancel'.tr(), style: const TextStyle(color: Colors.red)),
onPressed: () {
Navigator.of(context).pop();
Get.back(result: false);
},
),
TextButton(
child: Text('Continue'.tr, style: const TextStyle(color: Colors.green)),
child: Text('Continue'.tr(), style: const TextStyle(color: Colors.green)),
onPressed: () {
Navigator.of(context).pop();
},

View File

@@ -3,6 +3,7 @@
import 'dart:developer';
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/material.dart';
import 'package:get/get.dart';
@@ -84,17 +85,17 @@ class _PayFastScreenState extends State<PayFastScreen> {
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Cancel Payment'),
content: SingleChildScrollView(child: Text("Cancel Payment?".tr)),
content: SingleChildScrollView(child: Text("Cancel Payment?".tr())),
actions: <Widget>[
TextButton(
child: Text('Exit'.tr, style: TextStyle(color: Colors.red)),
child: Text('Exit'.tr(), style: TextStyle(color: Colors.red)),
onPressed: () {
Get.back();
Get.back(result: false);
},
),
TextButton(
child: Text('Continue Payment'.tr, style: TextStyle(color: Colors.green)),
child: Text('Continue Payment'.tr(), style: TextStyle(color: Colors.green)),
onPressed: () {
Get.back();
},

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:developer';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:webview_flutter/webview_flutter.dart';
@@ -91,18 +92,18 @@ class _MidtransScreenState extends State<MidtransScreen> {
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: Text('Cancel Payment'.tr),
content: SingleChildScrollView(child: Text("Cancel Payment?".tr)),
title: Text('Cancel Payment'.tr()),
content: SingleChildScrollView(child: Text("Cancel Payment?".tr())),
actions: <Widget>[
TextButton(
child: Text('Cancel'.tr, style: const TextStyle(color: Colors.red)),
child: Text('Cancel'.tr(), style: const TextStyle(color: Colors.red)),
onPressed: () {
Get.back(result: false);
Get.back(result: false);
},
),
TextButton(
child: Text('Continue'.tr, style: const TextStyle(color: Colors.green)),
child: Text('Continue'.tr(), style: const TextStyle(color: Colors.green)),
onPressed: () {
Get.back(result: false);
},

View File

@@ -3,6 +3,7 @@
import 'dart:async';
import 'dart:convert';
import 'package:customer/models/payment_model/orange_money.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
@@ -107,7 +108,7 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
appBar: AppBar(
backgroundColor: Colors.black,
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),
),
@@ -120,12 +121,12 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
title: Text('Cancel Payment'.tr),
content: Text('Are you sure you want to cancel this payment?'.tr),
title: Text('Cancel Payment'.tr()),
content: Text('Are you sure you want to cancel this payment?'.tr()),
actions: [
TextButton(child: Text('No', style: TextStyle(color: Colors.green)), onPressed: () => Get.back()),
TextButton(
child: Text('Yes'.tr, style: TextStyle(color: Colors.red)),
child: Text('Yes'.tr(), style: TextStyle(color: Colors.red)),
onPressed: () {
timer?.cancel();
Get.back(); // close dialog
@@ -298,14 +299,14 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
// barrierDismissible: true, // user must tap button!
// builder: (BuildContext context) {
// return AlertDialog(
// title: Text('Cancel Payment'.tr),
// title: Text('Cancel Payment'.tr()),
// content: SingleChildScrollView(
// child: Text("cancelPayment?".tr),
// child: Text("cancelPayment?".tr()),
// ),
// actions: <Widget>[
// TextButton(
// child: Text(
// 'Cancel'.tr,
// 'Cancel'.tr(),
// style: const TextStyle(color: Colors.red),
// ),
// onPressed: () {
@@ -315,7 +316,7 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
// ),
// TextButton(
// child: Text(
// 'Continue'.tr,
// 'Continue'.tr(),
// style: const TextStyle(color: Colors.green),
// ),
// onPressed: () {

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:customer/payment/paystack/paystack_url_genrater.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:webview_flutter/webview_flutter.dart';
@@ -72,7 +73,7 @@ class _PayStackScreenState extends State<PayStackScreen> {
child: Scaffold(
appBar: AppBar(
backgroundColor: AppThemeData.grey50,
title: Text("Payment".tr),
title: Text("Payment".tr()),
centerTitle: false,
leading: GestureDetector(
onTap: () {

View File

@@ -3,6 +3,7 @@ import 'dart:convert';
import 'dart:developer';
import 'package:customer/payment/xenditModel.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
@@ -112,18 +113,18 @@ class _XenditScreenState extends State<XenditScreen> {
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: Text('Cancel Payment'.tr),
content: SingleChildScrollView(child: Text("Cancel Payment?".tr)),
title: Text('Cancel Payment'.tr()),
content: SingleChildScrollView(child: Text("Cancel Payment?".tr())),
actions: <Widget>[
TextButton(
child: Text('Cancel'.tr, style: const TextStyle(color: Colors.red)),
child: Text('Cancel'.tr(), style: const TextStyle(color: Colors.red)),
onPressed: () {
Navigator.of(context).pop(false);
Navigator.of(context).pop(false);
},
),
TextButton(
child: Text('Continue'.tr, style: const TextStyle(color: Colors.green)),
child: Text('Continue'.tr(), style: const TextStyle(color: Colors.green)),
onPressed: () {
Navigator.of(context).pop(false);
},

View File

@@ -2,6 +2,7 @@ import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/dash_board_controller.dart';
import 'package:customer/controllers/dash_board_ecommarce_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -41,17 +42,17 @@ class DashBoardEcommerceScreen extends StatelessWidget {
items:
Constant.walletSetting == false
? [
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: 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: 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: 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: 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: 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: 4, 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: 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: 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),
],
),
);

View File

@@ -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/selected_location_model.dart';
import 'package:customer/widget/video_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:geocoding/geocoding.dart';
@@ -68,7 +69,7 @@ class HomeECommerceScreen extends StatelessWidget {
onTap: () {
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)),
InkWell(
@@ -84,7 +85,7 @@ class HomeECommerceScreen extends StatelessWidget {
} else {
Constant.checkPermission(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
// ✅ declare it once here!
ShippingAddress shippingAddress = ShippingAddress();
@@ -203,7 +204,7 @@ class HomeECommerceScreen extends StatelessWidget {
Get.to(const SearchScreen(), arguments: {"vendorList": controller.allNearestRestaurant});
},
child: TextFieldWidget(
hintText: 'Search the store, item and more...'.tr,
hintText: 'Search the store, item and more...'.tr(),
controller: null,
enable: false,
backgroundColor: AppThemeData.grey50,
@@ -233,7 +234,7 @@ class HomeECommerceScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Category".tr,
"Category".tr(),
textAlign: TextAlign.start,
style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16),
),
@@ -243,7 +244,7 @@ class HomeECommerceScreen extends StatelessWidget {
Get.to(const ViewAllCategoryScreen());
},
child: Text(
"View all".tr,
"View all".tr(),
textAlign: TextAlign.start,
style: AppThemeData.semiBoldTextStyle(
decoration: TextDecoration.underline,
@@ -312,7 +313,7 @@ class HomeECommerceScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Highlights for you".tr,
"Highlights for you".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -324,7 +325,7 @@ class HomeECommerceScreen extends StatelessWidget {
});
},
child: Text(
"View all".tr,
"View all".tr(),
textAlign: TextAlign.center,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
),
@@ -353,7 +354,7 @@ class HomeECommerceScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
"New Arrivals".tr,
"New Arrivals".tr(),
textAlign: TextAlign.start,
style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16),
),
@@ -382,9 +383,9 @@ class HomeECommerceScreen extends StatelessWidget {
radius: 10,
color: isDark ? AppThemeData.greyDark100 : AppThemeData.grey100,
borderColor: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200,
title: 'View All Arrivals'.tr,
title: 'View All Arrivals'.tr(),
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(
crossAxisAlignment: CrossAxisAlignment.start,
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),
GridView.builder(
padding: EdgeInsets.zero,
@@ -466,7 +467,7 @@ class HomeECommerceScreen extends StatelessWidget {
children: [
Text(item.title.toString(), textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(color: AppThemeData.grey900, fontSize: 18)),
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,
style: AppThemeData.regularTextStyle(color: AppThemeData.grey900, fontSize: 12),
),
@@ -630,7 +631,7 @@ class HomeECommerceScreen extends StatelessWidget {
// children: [
// Expanded(
// child: Text(
// "Highlights for you".tr,
// "Highlights for you".tr(),
// textAlign: TextAlign.start,
// style: TextStyle(
// fontFamily: AppThemeData.semiBold,
@@ -646,7 +647,7 @@ class HomeECommerceScreen extends StatelessWidget {
// });
// },
// child: Text(
// "View all".tr,
// "View all".tr(),
// textAlign: TextAlign.center,
// style: TextStyle(
// fontFamily: AppThemeData.regular,
@@ -686,7 +687,7 @@ class HomeECommerceScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
ListView.builder(
padding: EdgeInsets.zero,
@@ -754,7 +755,7 @@ class HomeECommerceScreen extends StatelessWidget {
radius: 10,
color: isDark ? AppThemeData.greyDark100 : AppThemeData.grey100,
borderColor: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200,
title: 'View All Stores'.tr,
title: 'View All Stores'.tr(),
onPress: () {
Get.to(const RestaurantListScreen(), arguments: {"vendorList": controller.allNearestRestaurant});
},
@@ -863,13 +864,13 @@ class BannerView extends StatelessWidget {
return InkWell(
onTap: () async {
if (bannerModel.redirect_type == "store") {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
ShowToastDialog.closeLoader();
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
} 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());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
@@ -880,7 +881,7 @@ class BannerView extends StatelessWidget {
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
ShowToastDialog.showToast("Could not launch".tr);
ShowToastDialog.showToast("Could not launch".tr());
}
}
},
@@ -942,13 +943,13 @@ class BannerBottomView extends StatelessWidget {
return InkWell(
onTap: () async {
if (bannerModel.redirect_type == "store") {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
ShowToastDialog.closeLoader();
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
} 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());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
@@ -959,7 +960,7 @@ class BannerBottomView extends StatelessWidget {
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} 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;
return InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(model.vendorId!);
ShowToastDialog.closeLoader();
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});

View File

@@ -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/themes/app_them_data.dart' show AppThemeData;
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -38,14 +39,14 @@ class AddressListScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
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),
Expanded(
child:
controller.shippingAddressList.isEmpty
? Constant.showEmptyView(message: "Address not found".tr)
? Constant.showEmptyView(message: "Address not found".tr())
: ListView.separated(
itemCount: controller.shippingAddressList.length,
itemBuilder: (context, index) {
@@ -80,7 +81,7 @@ class AddressListScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
child: Text(
"Default".tr,
"Default".tr(),
style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
),
),

View File

@@ -6,6 +6,7 @@ import 'package:customer/utils/utils.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/selected_location_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@@ -45,15 +46,15 @@ class EnterManuallyLocationScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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),
),
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),
Row(
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(
scale: 0.7, // Decrease the size (try 0.5, 0.6, etc.)
child: Switch(
@@ -97,8 +98,8 @@ class EnterManuallyLocationScreen extends StatelessWidget {
);
},
child: TextFieldWidget(
title: "Choose Location".tr,
hintText: "Choose Location".tr,
title: "Choose Location".tr(),
hintText: "Choose Location".tr(),
readOnly: true,
enable: false,
controller: null,
@@ -137,15 +138,15 @@ class EnterManuallyLocationScreen extends StatelessWidget {
),
),
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),
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),
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),
Container(height: 1, color: AppThemeData.grey200),
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),
Wrap(
spacing: 10,
@@ -175,18 +176,18 @@ class EnterManuallyLocationScreen extends StatelessWidget {
const SizedBox(height: 30),
RoundedButtonFill(
borderRadius: 10.r,
title: "Save Address".tr,
title: "Save Address".tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
onPress: () async {
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) {
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) {
ShowToastDialog.showToast("Please Enter Area / Sector / Locality".tr);
ShowToastDialog.showToast("Please Enter Area / Sector / Locality".tr());
} else {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
//Common values
controller.shippingModel.value.location = controller.location.value;

View File

@@ -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/place_picker/location_picker_screen.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_screenutil/flutter_screenutil.dart';
import 'package:geocoding/geocoding.dart';
@@ -39,7 +40,7 @@ class LocationPermissionScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
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),
textAlign: TextAlign.center,
),
@@ -48,7 +49,7 @@ class LocationPermissionScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 50),
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),
textAlign: TextAlign.center,
),
@@ -56,12 +57,12 @@ class LocationPermissionScreen extends StatelessWidget {
const SizedBox(height: 30),
RoundedButtonFill(
borderRadius: 10.r,
title: "Use current location".tr,
title: "Use current location".tr(),
onPress: () async {
Constant.checkPermission(
context: context,
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
ShippingAddress addressModel = ShippingAddress();
try {
await Geolocator.requestPermission();
@@ -107,12 +108,12 @@ class LocationPermissionScreen extends StatelessWidget {
const SizedBox(height: 10),
RoundedButtonFill(
borderRadius: 10.r,
title: "Set from map".tr,
title: "Set from map".tr(),
onPress: () async {
Constant.checkPermission(
context: context,
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
ShippingAddress addressModel = ShippingAddress();
try {
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)),
),
],
),

View File

@@ -1,4 +1,5 @@
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -15,12 +16,12 @@ class MaintenanceModeScreen extends StatelessWidget {
children: [
Center(child: Image.asset('assets/images/maintenance.png', height: 200, width: 200)),
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),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
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,
style: const TextStyle(fontSize: 16),
),

View File

@@ -6,6 +6,7 @@ import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
@@ -33,7 +34,7 @@ class AllAdvertisementScreen extends StatelessWidget {
centerTitle: false,
titleSpacing: 0,
title: Text(
"Highlights for you".tr,
"Highlights for you".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -42,7 +43,7 @@ class AllAdvertisementScreen extends StatelessWidget {
controller.isLoading.value
? Constant.loader()
: controller.advertisementList.isEmpty
? Constant.showEmptyView(message: "Highlights for you not found.".tr)
? Constant.showEmptyView(message: "Highlights for you not found.".tr())
: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: ListView.builder(
@@ -72,7 +73,7 @@ class AdvertisementCard extends StatelessWidget {
final isDark = themeController.isDark.value;
return InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(model.vendorId!);
ShowToastDialog.closeLoader();
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});

View File

@@ -14,6 +14,7 @@ import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -44,7 +45,7 @@ class CartScreen extends StatelessWidget {
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface),
body:
cartItem.isEmpty
? Constant.showEmptyView(message: "Item Not available".tr)
? Constant.showEmptyView(message: "Item Not available".tr())
: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -62,7 +63,7 @@ class CartScreen extends StatelessWidget {
controller.selectedAddress.value = shippingAddress;
controller.calculatePrice();
} 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) {
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
} else {
ShowToastDialog.showToast("Out of stock".tr);
ShowToastDialog.showToast("Out of stock".tr());
}
} else {
if ((productModel!.quantity ?? 0) > (cartProductModel.quantity ?? 0) || productModel!.quantity == -1) {
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
} else {
ShowToastDialog.showToast("Out of stock".tr);
ShowToastDialog.showToast("Out of stock".tr());
}
}
} else {
if ((productModel!.quantity ?? 0) > (cartProductModel.quantity ?? 0) || productModel!.quantity == -1) {
controller.addToCart(cartProductModel: cartProductModel, isIncrement: true, quantity: cartProductModel.quantity! + 1);
} else {
ShowToastDialog.showToast("Out of stock".tr);
ShowToastDialog.showToast("Out of stock".tr());
}
}
},
@@ -285,7 +286,7 @@ class CartScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Variants".tr,
"Variants".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -324,7 +325,7 @@ class CartScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Addons".tr,
"Addons".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -381,7 +382,7 @@ class CartScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${'Delivery Type'.tr} (${controller.selectedFoodType.value})".tr,
"${'Delivery Type'.tr()} (${controller.selectedFoodType.value})".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
),
@@ -400,13 +401,13 @@ class CartScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Instant Delivery".tr,
"Instant Delivery".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
),
const SizedBox(height: 5),
Text(
"Standard".tr,
"Standard".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
),
@@ -415,7 +416,7 @@ class CartScreen extends StatelessWidget {
),
Radio(
value: controller.deliveryType.value,
groupValue: "instant".tr,
groupValue: "instant".tr(),
activeColor: AppThemeData.primary300,
onChanged: (value) {
controller.deliveryType.value = "instant";
@@ -438,7 +439,7 @@ class CartScreen extends StatelessWidget {
},
minDateTime: DateTime.now(),
displaySubmitButton: true,
pickerTitle: Text('Schedule Time'.tr),
pickerTitle: Text('Schedule Time'.tr()),
buttonSingleColor: AppThemeData.primary300,
).show(context);
},
@@ -451,13 +452,13 @@ class CartScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Schedule Time".tr,
"Schedule Time".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
),
const SizedBox(height: 5),
Text(
"${'Your preferred time'.tr} ${controller.deliveryType.value == "schedule" ? Constant.timestampToDateTime(Timestamp.fromDate(controller.scheduleDateTime.value)) : ""}",
"${'Your preferred time'.tr()} ${controller.deliveryType.value == "schedule" ? Constant.timestampToDateTime(Timestamp.fromDate(controller.scheduleDateTime.value)) : ""}",
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
),
@@ -466,7 +467,7 @@ class CartScreen extends StatelessWidget {
),
Radio(
value: controller.deliveryType.value,
groupValue: "schedule".tr,
groupValue: "schedule".tr(),
activeColor: AppThemeData.primary300,
onChanged: (value) {
controller.deliveryType.value = "schedule";
@@ -477,7 +478,7 @@ class CartScreen extends StatelessWidget {
},
minDateTime: controller.scheduleDateTime.value,
displaySubmitButton: true,
pickerTitle: Text('Schedule Time'.tr),
pickerTitle: Text('Schedule Time'.tr()),
buttonSingleColor: AppThemeData.primary300,
).show(context);
},
@@ -497,7 +498,7 @@ class CartScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Offers & Benefits".tr,
"Offers & Benefits".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
),
@@ -520,7 +521,7 @@ class CartScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Apply Coupons".tr,
"Apply Coupons".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
),
@@ -542,7 +543,7 @@ class CartScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Bill Details".tr,
"Bill Details".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
),
@@ -563,7 +564,7 @@ class CartScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Item totals".tr,
"Item totals".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -583,14 +584,14 @@ class CartScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Delivery Fee".tr,
"Delivery Fee".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
),
(controller.vendorModel.value.isSelfDelivery == true && Constant.isSelfDeliveryFeature == true)
? Text(
'Free Delivery'.tr,
'Free Delivery'.tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: AppThemeData.success400, fontSize: 16),
)
@@ -609,7 +610,7 @@ class CartScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Coupon Discount".tr,
"Coupon Discount".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -630,7 +631,7 @@ class CartScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Special Discount".tr,
"Special Discount".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -656,7 +657,7 @@ class CartScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Delivery Tips".tr,
"Delivery Tips".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -668,7 +669,7 @@ class CartScreen extends StatelessWidget {
controller.calculatePrice();
},
child: Text(
"Remove".tr,
"Remove".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
),
@@ -728,7 +729,7 @@ class CartScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"To Pay".tr,
"To Pay".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -756,7 +757,7 @@ class CartScreen extends StatelessWidget {
children: [
const SizedBox(height: 20),
Text(
"Thanks with a tip!".tr,
"Thanks with a tip!".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
),
@@ -777,7 +778,7 @@ class CartScreen extends StatelessWidget {
children: [
Expanded(
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,
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),
child: Center(
child: Text(
'Other'.tr,
'Other'.tr(),
style: TextStyle(
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
fontSize: 14,
@@ -952,7 +953,7 @@ class CartScreen extends StatelessWidget {
const SizedBox(height: 20),
Padding(
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: [
Padding(
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(
"${"Cashback Name :".tr} ${controller.bestCashback.value.title ?? ''}",
"${"Cashback Name :".tr()} ${controller.bestCashback.value.title ?? ''}",
style: TextStyle(color: AppThemeData.success300, fontFamily: AppThemeData.semiBold, fontSize: 13),
),
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),
),
],
@@ -1034,7 +1035,7 @@ class CartScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Pay Via".tr,
"Pay Via".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontSize: 12),
),
@@ -1060,7 +1061,7 @@ class CartScreen extends StatelessWidget {
: isDark
? AppThemeData.grey800
: AppThemeData.grey100,
title: "Pay Now".tr,
title: "Pay Now".tr(),
height: 5,
color:
controller.selectedPaymentMethod.value != ''
@@ -1071,11 +1072,11 @@ class CartScreen extends StatelessWidget {
fontSizes: 16,
onPress: () async {
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;
}
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;
}
if (controller.isOrderPlaced.value == false) {
@@ -1109,7 +1110,7 @@ class CartScreen extends StatelessWidget {
) {
if (value == null) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
CreateRazorPayOrderModel result = value;
controller.openCheckout(amount: controller.totalAmount.value.toString(), orderId: result.id);
@@ -1117,7 +1118,7 @@ class CartScreen extends StatelessWidget {
});
} else {
controller.isOrderPlaced.value = false;
ShowToastDialog.showToast("Please select payment method".tr);
ShowToastDialog.showToast("Please select payment method".tr());
}
controller.isOrderPlaced.value = false;
}
@@ -1162,16 +1163,16 @@ class CartScreen extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
TextFieldWidget(
title: 'Tips Amount'.tr,
title: 'Tips Amount'.tr(),
controller: controller.tipsController.value,
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true),
textInputAction: TextInputAction.done,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
prefix: Padding(
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),
Row(
@@ -1179,7 +1180,7 @@ class CartScreen extends StatelessWidget {
Expanded(
child: RoundedButtonFill(
borderRadius: 10.r,
title: "Cancel".tr,
title: "Cancel".tr(),
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
textColor: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
onPress: () async {
@@ -1191,12 +1192,12 @@ class CartScreen extends StatelessWidget {
Expanded(
child: RoundedButtonFill(
borderRadius: 10.r,
title: "Add".tr,
title: "Add".tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
onPress: () async {
if (controller.tipsController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter tips Amount".tr);
ShowToastDialog.showToast("Please enter tips Amount".tr());
} else {
controller.deliveryTips.value = double.parse(controller.tipsController.value.text);
controller.calculatePrice();

View File

@@ -6,6 +6,7 @@ import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:customer/widget/my_separator.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controllers/theme_controller.dart';
@@ -27,20 +28,20 @@ class CouponListScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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(
preferredSize: const Size.fromHeight(55),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TextFieldWidget(
hintText: 'Enter coupon code'.tr,
hintText: 'Enter coupon code'.tr(),
controller: controller.couponCodeController.value,
suffix: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: InkWell(
onTap: () {
if (controller.couponCodeController.value.text.isEmpty) {
ShowToastDialog.showToast("Please enter coupon code".tr);
ShowToastDialog.showToast("Please enter coupon code".tr());
return;
}
CouponModel? matchedCoupon = controller.couponList.firstWhereOrNull((coupon) => coupon.code!.toLowerCase() == controller.couponCodeController.value.text.toLowerCase());
@@ -52,14 +53,14 @@ class CouponListScreen extends StatelessWidget {
controller.calculatePrice();
Get.back();
} else {
ShowToastDialog.showToast("Coupon code not applied".tr);
ShowToastDialog.showToast("Coupon code not applied".tr());
}
} else {
ShowToastDialog.showToast("Invalid Coupon".tr);
ShowToastDialog.showToast("Invalid Coupon".tr());
}
},
child: Text(
"Apply".tr,
"Apply".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
),
@@ -93,7 +94,7 @@ class CouponListScreen extends StatelessWidget {
child: RotatedBox(
quarterTurns: -1,
child: Text(
"${couponModel.discountType == "Fix Price" ? Constant.amountShow(amount: couponModel.discount) : "${couponModel.discount}%"} ${'Off'.tr}",
"${couponModel.discountType == "Fix Price" ? Constant.amountShow(amount: couponModel.discount) : "${couponModel.discount}%"} ${'Off'.tr()}",
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),
),
@@ -132,11 +133,11 @@ class CouponListScreen extends StatelessWidget {
controller.calculatePrice();
Get.back();
} else {
ShowToastDialog.showToast("Coupon code not applied".tr);
ShowToastDialog.showToast("Coupon code not applied".tr());
}
},
child: Text(
"Tap To Apply".tr,
"Tap To Apply".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
),

View File

@@ -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/themes/app_them_data.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -38,12 +39,12 @@ class OrderPlacingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Order Placed".tr,
"Order Placed".tr(),
textAlign: TextAlign.start,
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 34, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
),
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,
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),
Expanded(
child: Text(
"Order ID".tr,
"Order ID".tr(),
textAlign: TextAlign.start,
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)),
const SizedBox(height: 20),
Text(
"Placing your order".tr,
"Placing your order".tr(),
textAlign: TextAlign.start,
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 34, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
),
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,
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),
Expanded(
child: Text(
"Delivery Address".tr,
"Delivery Address".tr(),
textAlign: TextAlign.start,
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),
Expanded(
child: Text(
"Order Summary".tr,
"Order Summary".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
),
@@ -167,12 +168,12 @@ class OrderPlacingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${cartProductModel.quantity} x".tr,
"${cartProductModel.quantity} x".tr(),
textAlign: TextAlign.start,
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
),
Text(
"${cartProductModel.name}".tr,
"${cartProductModel.name}".tr(),
textAlign: TextAlign.start,
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
? RoundedButtonFill(
borderRadius: 10.r,
title: "Track Order".tr,
title: "Track Order".tr(),
height: 5.5,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
@@ -215,7 +216,7 @@ class OrderPlacingScreen extends StatelessWidget {
)
: RoundedButtonFill(
borderRadius: 10.r,
title: "Track Order".tr,
title: "Track Order".tr(),
height: 5.5,
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
textColor: isDark ? AppThemeData.grey900 : AppThemeData.grey50,

View File

@@ -2,6 +2,7 @@ import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/cart_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@@ -26,7 +27,7 @@ class SelectPaymentScreen extends StatelessWidget {
centerTitle: false,
titleSpacing: 0,
title: Text(
"Payment Option".tr,
"Payment Option".tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: AppThemeData.medium,
@@ -42,7 +43,7 @@ class SelectPaymentScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Preferred Payment".tr,
"Preferred Payment".tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
@@ -92,7 +93,7 @@ class SelectPaymentScreen extends StatelessWidget {
height: 10,
),
Text(
"Other Payment Options".tr,
"Other Payment Options".tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
@@ -180,7 +181,7 @@ class SelectPaymentScreen extends StatelessWidget {
padding: const EdgeInsets.only(bottom: 20),
child: RoundedButtonFill(
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,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,

View File

@@ -1,6 +1,7 @@
import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/cashback_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -20,7 +21,7 @@ class CashbackOffersListScreen extends StatelessWidget {
appBar: AppBar(
centerTitle: false,
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,
),
body:
@@ -59,11 +60,11 @@ class CashbackOffersListScreen extends StatelessWidget {
),
const SizedBox(height: 6),
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),
),
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),
),
],

View File

@@ -4,6 +4,7 @@ import 'package:customer/controllers/change_language_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controllers/theme_controller.dart';
@@ -30,11 +31,11 @@ class ChangeLanguageScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Change Language".tr,
"Change Language".tr(),
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
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),
),
const SizedBox(height: 20),

View File

@@ -5,6 +5,7 @@ import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/chat_controller.dart';
import 'package:customer/models/conversation_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import '../../../controllers/theme_controller.dart';
import 'package:customer/utils/network_image_widget.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>);
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
query: FirebaseFirestore.instance
.collection(
@@ -103,7 +104,7 @@ class ChatScreen extends StatelessWidget {
contentPadding: const EdgeInsets.only(top: 3, left: 10),
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: 'Type message here....'.tr,
hintText: 'Type message here....'.tr(),
),
onSubmitted: (value) async {
if (controller.messageController.value.text.isNotEmpty) {
@@ -245,7 +246,7 @@ class ChatScreen extends StatelessWidget {
void onCameraClick(BuildContext context, ChatController controller) {
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>[
CupertinoActionSheetAction(
isDefaultAction: false,
@@ -257,7 +258,7 @@ class ChatScreen extends StatelessWidget {
controller.sendMessage('', url, '', 'image');
}
},
child: Text("Choose image from gallery".tr),
child: Text("Choose image from gallery".tr()),
),
CupertinoActionSheetAction(
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(
isDestructiveAction: false,
@@ -283,7 +284,7 @@ class ChatScreen extends StatelessWidget {
controller.sendMessage('', url, '', 'image');
}
},
child: Text("Take a picture".tr),
child: Text("Take a picture".tr()),
),
// CupertinoActionSheetAction(
// isDestructiveAction: false,
@@ -295,11 +296,11 @@ class ChatScreen extends StatelessWidget {
// controller.sendMessage('', videoContainer.videoUrl, videoContainer.thumbnailUrl, 'video');
// }
// },
// child: Text("Record video".tr),
// child: Text("Record video".tr()),
// )
],
cancelButton: CupertinoActionSheetAction(
child: Text('Cancel'.tr),
child: Text('Cancel'.tr()),
onPressed: () {
Get.back();
},

View File

@@ -5,6 +5,7 @@ import 'package:customer/models/user_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -27,7 +28,7 @@ class DriverInboxScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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(
//item builder type is compulsory.
@@ -37,7 +38,7 @@ class DriverInboxScreen extends StatelessWidget {
InboxModel inboxModel = InboxModel.fromJson(data!);
return InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
UserModel? customer = await FireStoreUtils.getUserProfile(inboxModel.customerId.toString());
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(inboxModel.restaurantId.toString());
@@ -113,7 +114,7 @@ class DriverInboxScreen extends StatelessWidget {
);
},
shrinkWrap: true,
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr),
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr()),
// orderBy is compulsory to enable pagination
query: FirebaseFirestore.instance.collection('chat_driver').where("customerId", isEqualTo: FireStoreUtils.getCurrentUid()).orderBy('createdAt', descending: true),
//Change types customerId

View File

@@ -8,6 +8,7 @@ import 'package:customer/themes/responsive.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/models/view_type.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -28,7 +29,7 @@ class RestaurantInboxScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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(
//item builder type is compulsory.
@@ -38,7 +39,7 @@ class RestaurantInboxScreen extends StatelessWidget {
InboxModel inboxModel = InboxModel.fromJson(data!);
return InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
UserModel? customer = await FireStoreUtils.getUserProfile(inboxModel.customerId.toString());
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(inboxModel.restaurantId.toString());
@@ -115,7 +116,7 @@ class RestaurantInboxScreen extends StatelessWidget {
);
},
shrinkWrap: true,
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr),
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr()),
// orderBy is compulsory to enable pagination
query: FirebaseFirestore.instance.collection('chat_store').where("customerId", isEqualTo: FireStoreUtils.getCurrentUid()).orderBy('createdAt', descending: true),
//Change types customerId

View File

@@ -1,6 +1,7 @@
import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/dash_board_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -40,17 +41,17 @@ class DashBoardScreen extends StatelessWidget {
items:
Constant.walletSetting == false
? [
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: 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: 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: 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: 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: 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: 4, 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: 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: 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),
],
),
);

View File

@@ -1,6 +1,7 @@
import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/dine_in_booking_details_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -24,7 +25,7 @@ class DineInBookingDetails extends StatelessWidget {
titleSpacing: 0,
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
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),
),
),
@@ -43,11 +44,11 @@ class DineInBookingDetails extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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),
),
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),
),
],
@@ -113,7 +114,7 @@ class DineInBookingDetails extends StatelessWidget {
);
},
child: Text(
"View in Map".tr,
"View in Map".tr(),
style: TextStyle(
fontSize: 16,
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
@@ -133,7 +134,7 @@ class DineInBookingDetails extends StatelessWidget {
}
},
child: Text(
"Call Now".tr,
"Call Now".tr(),
style: TextStyle(
fontSize: 16,
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
@@ -153,7 +154,7 @@ class DineInBookingDetails extends StatelessWidget {
),
const SizedBox(height: 20),
Text(
"Booking Details".tr,
"Booking Details".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
),
@@ -169,7 +170,7 @@ class DineInBookingDetails extends StatelessWidget {
children: [
Expanded(
child: Text(
"Name".tr,
"Name".tr(),
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
),
),
@@ -188,7 +189,7 @@ class DineInBookingDetails extends StatelessWidget {
children: [
Expanded(
child: Text(
"Phone number".tr,
"Phone number".tr(),
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
),
),
@@ -207,7 +208,7 @@ class DineInBookingDetails extends StatelessWidget {
children: [
Expanded(
child: Text(
"Date and Time".tr,
"Date and Time".tr(),
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
),
),
@@ -226,7 +227,7 @@ class DineInBookingDetails extends StatelessWidget {
children: [
Expanded(
child: Text(
"Guest".tr,
"Guest".tr(),
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
),
),
@@ -245,7 +246,7 @@ class DineInBookingDetails extends StatelessWidget {
children: [
Expanded(
child: Text(
"Discount".tr,
"Discount".tr(),
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
),
),

View File

@@ -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/themes/responsive.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -27,7 +28,7 @@ class DineInBookingScreen extends StatelessWidget {
titleSpacing: 0,
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
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),
),
),
@@ -57,7 +58,7 @@ class DineInBookingScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: Text(
"Upcoming".tr,
"Upcoming".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
@@ -88,7 +89,7 @@ class DineInBookingScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: Text(
"History".tr,
"History".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
@@ -118,7 +119,7 @@ class DineInBookingScreen extends StatelessWidget {
child:
controller.isFeature.value
? controller.featureList.isEmpty
? Constant.showEmptyView(message: "Upcoming Booking not found.".tr)
? Constant.showEmptyView(message: "Upcoming Booking not found.".tr())
: ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.zero,
@@ -130,7 +131,7 @@ class DineInBookingScreen extends StatelessWidget {
},
)
: controller.historyList.isEmpty
? Constant.showEmptyView(message: "History not found.".tr)
? Constant.showEmptyView(message: "History not found.".tr())
: ListView.builder(
itemCount: controller.historyList.length,
shrinkWrap: true,
@@ -208,7 +209,7 @@ class DineInBookingScreen extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
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(
child: Text(
"${orderModel.guestFirstName} ${orderModel.guestLastName}",
@@ -223,7 +224,7 @@ class DineInBookingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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(
child: Text(

View File

@@ -5,6 +5,7 @@ import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@@ -27,7 +28,7 @@ class BookTableScreen extends StatelessWidget {
centerTitle: false,
titleSpacing: 0,
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(
padding: const EdgeInsets.symmetric(horizontal: 16),
@@ -43,7 +44,7 @@ class BookTableScreen extends StatelessWidget {
children: [
Expanded(
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),
),
),
@@ -105,7 +106,7 @@ class BookTableScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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),
),
SizedBox(
@@ -151,9 +152,9 @@ class BookTableScreen extends StatelessWidget {
children: [
Text(
Constant.calculateDifference(controller.dateList[index].date.toDate()) == 0
? "Today".tr
? "Today".tr()
: Constant.calculateDifference(controller.dateList[index].date.toDate()) == 1
? "Tomorrow".tr
? "Tomorrow".tr()
: DateFormat('EEE').format(controller.dateList[index].date.toDate()),
style: TextStyle(
fontSize: 12,
@@ -185,7 +186,7 @@ class BookTableScreen extends StatelessWidget {
child: Center(
child: RoundedButtonFill(
borderRadius: 10.r,
title: "${controller.dateList[index].discountPer}%".tr,
title: "${controller.dateList[index].discountPer}%".tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
width: 12,
@@ -201,7 +202,7 @@ class BookTableScreen extends StatelessWidget {
),
const SizedBox(height: 10),
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),
),
const SizedBox(height: 10),
@@ -256,7 +257,7 @@ class BookTableScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Special Occasion".tr,
"Special Occasion".tr(),
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: () {
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),
dense: true,
title: Text(
//'${controller.occasionList[i]}'.tr,
//'${controller.occasionList[i]}'.tr(),
controller.getLocalizedOccasion(controller.occasionList[i]),
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),
dense: true,
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),
),
leading: Checkbox(
@@ -319,7 +320,7 @@ class BookTableScreen extends StatelessWidget {
),
const SizedBox(height: 10),
Text(
"Personal Details".tr,
"Personal Details".tr(),
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
const SizedBox(height: 10),
@@ -358,11 +359,11 @@ class BookTableScreen extends StatelessWidget {
),
const SizedBox(height: 10),
Text(
"Additional Requests".tr,
"Additional Requests".tr(),
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
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),
],
),
@@ -375,7 +376,7 @@ class BookTableScreen extends StatelessWidget {
padding: const EdgeInsets.only(bottom: 20),
child: RoundedButtonFill(
borderRadius: 10.r,
title: "Book Now".tr,
title: "Book Now".tr(),
height: 5.5,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,

View File

@@ -4,6 +4,7 @@ import 'package:customer/models/favourite_model.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:easy_localization/easy_localization.dart';
import '../../../controllers/theme_controller.dart';
import '../../../service/fire_store_utils.dart';
import '../../../themes/show_toast_dialog.dart';
@@ -215,7 +216,7 @@ class DineInDetailsScreen extends StatelessWidget {
Get.to(const ReviewListScreen(), arguments: {"vendorModel": controller.vendorModel.value});
},
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),
),
),
@@ -226,7 +227,7 @@ class DineInDetailsScreen extends StatelessWidget {
Row(
children: [
Text(
controller.isOpen.value ? "Open".tr : "Close".tr,
controller.isOpen.value ? "Open".tr() : "Close".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -243,7 +244,7 @@ class DineInDetailsScreen extends StatelessWidget {
timeShowBottomSheet(context, controller);
},
child: Text(
"View Timings".tr,
"View Timings".tr(),
textAlign: TextAlign.start,
maxLines: 1,
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)),
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,
maxLines: 1,
style: TextStyle(
@@ -277,7 +278,7 @@ class DineInDetailsScreen extends StatelessWidget {
children: [
const SizedBox(height: 20),
Text(
"Also applicable on food delivery".tr,
"Also applicable on food delivery".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -292,7 +293,7 @@ class DineInDetailsScreen extends StatelessWidget {
InkWell(
onTap: () {
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 {
Get.to(const BookTableScreen(), arguments: {"vendorModel": controller.vendorModel.value});
}
@@ -326,7 +327,7 @@ class DineInDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Table Booking".tr,
"Table Booking".tr(),
style: TextStyle(
fontSize: 16,
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
@@ -335,7 +336,7 @@ class DineInDetailsScreen extends StatelessWidget {
),
),
Text(
"Quick Conformations".tr,
"Quick Conformations".tr(),
style: TextStyle(
fontSize: 12,
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
@@ -386,7 +387,7 @@ class DineInDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Available food delivery".tr,
"Available food delivery".tr(),
style: TextStyle(
fontSize: 16,
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
@@ -395,7 +396,7 @@ class DineInDetailsScreen extends StatelessWidget {
),
),
Text(
"in 30-45 mins.".tr,
"in 30-45 mins.".tr(),
style: TextStyle(
fontSize: 12,
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
@@ -421,7 +422,7 @@ class DineInDetailsScreen extends StatelessWidget {
children: [
const SizedBox(height: 20),
Text(
"Menu".tr,
"Menu".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -466,7 +467,7 @@ class DineInDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Location, Timing & Costs".tr,
"Location, Timing & Costs".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -508,7 +509,7 @@ class DineInDetailsScreen extends StatelessWidget {
);
},
child: Text(
"View on Map".tr,
"View on Map".tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 16,
@@ -533,7 +534,7 @@ class DineInDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Timing".tr,
"Timing".tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 16,
@@ -545,7 +546,7 @@ class DineInDetailsScreen extends StatelessWidget {
InkWell(
onTap: () {},
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,
style: TextStyle(
fontSize: 16,
@@ -573,7 +574,7 @@ class DineInDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Cost for Two".tr,
"Cost for Two".tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 16,
@@ -583,7 +584,7 @@ class DineInDetailsScreen extends StatelessWidget {
),
),
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,
style: TextStyle(
fontSize: 16,
@@ -603,7 +604,7 @@ class DineInDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Cuisines".tr,
"Cuisines".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(

View File

@@ -10,6 +10,7 @@ import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -80,7 +81,7 @@ class DineInScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"Dine-In Reservations".tr,
"Dine-In Reservations".tr(),
style: TextStyle(
fontSize: 24,
fontFamily: AppThemeData.semiBold,
@@ -93,7 +94,7 @@ class DineInScreen extends StatelessWidget {
),
Text(
"Book a table at your favorite restaurant and enjoy a delightful dining experience."
.tr,
.tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
@@ -131,7 +132,7 @@ class DineInScreen extends StatelessWidget {
),
const SizedBox(height: 12),
Text(
"No Store Found in Your Area".tr,
"No Store Found in Your Area".tr(),
style: TextStyle(
color:
isDark
@@ -144,7 +145,7 @@ class DineInScreen extends StatelessWidget {
const SizedBox(height: 5),
Text(
"Currently, there are no available store in your zone. Try changing your location to find nearby options."
.tr,
.tr(),
textAlign: TextAlign.center,
style: TextStyle(
color:
@@ -158,7 +159,7 @@ class DineInScreen extends StatelessWidget {
const SizedBox(height: 20),
RoundedButtonFill(
borderRadius: 10.r,
title: "Change Zone".tr,
title: "Change Zone".tr(),
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -182,7 +183,7 @@ class DineInScreen extends StatelessWidget {
const SizedBox(height: 10),
titleView(
isDark,
"Explore the Categories".tr,
"Explore the Categories".tr(),
() {
Get.to(const ViewAllCategoryDineInScreen());
},
@@ -218,7 +219,7 @@ class DineInScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"New Arrivals".tr,
"New Arrivals".tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily:
@@ -244,7 +245,7 @@ class DineInScreen extends StatelessWidget {
);
},
child: Text(
"View all".tr,
"View all".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
@@ -316,7 +317,7 @@ class DineInScreen extends StatelessWidget {
vertical: 10,
),
child: Text(
"Popular Stores".tr,
"Popular Stores".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
@@ -357,7 +358,7 @@ class DineInScreen extends StatelessWidget {
vertical: 10,
),
child: Text(
"All Stores".tr,
"All Stores".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
@@ -425,7 +426,7 @@ class DineInScreen extends StatelessWidget {
onPress!();
},
child: Text(
"View all".tr,
"View all".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.regular,
@@ -1292,7 +1293,7 @@ class BannerBottomView extends StatelessWidget {
return InkWell(
onTap: () async {
if (bannerModel.redirect_type == "store") {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel =
await FireStoreUtils.getVendorById(
bannerModel.redirect_id.toString(),
@@ -1304,7 +1305,7 @@ class BannerBottomView extends StatelessWidget {
arguments: {"vendorModel": vendorModel},
);
} 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(),
@@ -1324,7 +1325,7 @@ class BannerBottomView extends StatelessWidget {
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
ShowToastDialog.showToast("Could not launch".tr);
ShowToastDialog.showToast("Could not launch".tr());
}
}
},

View File

@@ -3,6 +3,7 @@ import 'package:customer/controllers/view_all_category_controller.dart';
import 'package:customer/models/vendor_category_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -25,7 +26,7 @@ class ViewAllCategoryDineInScreen extends StatelessWidget {
centerTitle: false,
titleSpacing: 0,
title: Text(
"Categories".tr,
"Categories".tr(),
style: TextStyle(
fontSize: 16,
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,

View File

@@ -6,6 +6,7 @@ import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -32,11 +33,11 @@ class EditProfileScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Profile Information".tr,
"Profile Information".tr(),
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
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),
),
const SizedBox(height: 20),
@@ -79,13 +80,13 @@ class EditProfileScreen extends StatelessWidget {
const SizedBox(height: 20),
Row(
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),
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: 'Phone Number'.tr, textInputType: TextInputType.emailAddress, controller: controller.phoneNumberController.value, hintText: 'Phone Number'.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),
],
),
),
@@ -97,7 +98,7 @@ class EditProfileScreen extends StatelessWidget {
padding: const EdgeInsets.only(bottom: 20),
child: RoundedButtonFill(
borderRadius: 10.r,
title: "Save Details".tr,
title: "Save Details".tr(),
height: 5.5,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
@@ -124,7 +125,7 @@ class EditProfileScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
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(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
@@ -135,7 +136,7 @@ class EditProfileScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
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,
children: [
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())),
],
),
),

View File

@@ -7,6 +7,7 @@ import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import '../../../controllers/theme_controller.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:flutter/material.dart';
@@ -43,7 +44,7 @@ class FavouriteScreen extends StatelessWidget {
children: [
Expanded(
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),
),
),
@@ -64,18 +65,18 @@ class FavouriteScreen extends StatelessWidget {
Image.asset("assets/images/login.gif", height: 120),
const SizedBox(height: 12),
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),
),
const SizedBox(height: 5),
Text(
"Youre not logged in. Please sign in to access your account and explore all features.".tr,
"Youre not logged in. Please sign in to access your account and explore all features.".tr(),
textAlign: TextAlign.center,
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
),
const SizedBox(height: 20),
RoundedButtonFill(
title: "Log in".tr,
title: "Log in".tr(),
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -113,7 +114,7 @@ class FavouriteScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: Text(
"Favourite Store".tr,
"Favourite Store".tr(),
textAlign: TextAlign.center,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
),
@@ -134,7 +135,7 @@ class FavouriteScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: Text(
"Favourite Item".tr,
"Favourite Item".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
@@ -164,7 +165,7 @@ class FavouriteScreen extends StatelessWidget {
child:
controller.favouriteRestaurant.value
? controller.favouriteVendorList.isEmpty
? Constant.showEmptyView(message: "Favourite Store not found.".tr)
? Constant.showEmptyView(message: "Favourite Store not found.".tr())
: ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.zero,
@@ -260,7 +261,7 @@ class FavouriteScreen extends StatelessWidget {
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
style: TextStyle(
fontSize: 14,
color: AppThemeData.success600,
@@ -370,7 +371,7 @@ class FavouriteScreen extends StatelessWidget {
},
)
: controller.favouriteFoodList.isEmpty
? Constant.showEmptyView(message: "Favourite Item not found.".tr)
? Constant.showEmptyView(message: "Favourite Item not found.".tr())
: ListView.builder(
itemCount: controller.favouriteFoodList.length,
shrinkWrap: true,
@@ -384,7 +385,7 @@ class FavouriteScreen extends StatelessWidget {
return Constant.loader();
} else {
if (snapshot.hasError) {
return Center(child: Text('${"error".tr}: ${snapshot.error}'));
return Center(child: Text('${"error".tr()}: ${snapshot.error}'));
} else if (snapshot.data == null) {
return const SizedBox();
} else {
@@ -427,7 +428,7 @@ class FavouriteScreen extends StatelessWidget {
: SvgPicture.asset("assets/icons/ic_veg.svg"),
const SizedBox(width: 5),
Text(
productModel.nonveg == true ? "Non Veg.".tr : "Pure veg.".tr,
productModel.nonveg == true ? "Non Veg.".tr() : "Pure veg.".tr(),
style: TextStyle(
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
fontFamily: AppThemeData.semiBold,

View File

@@ -2,6 +2,7 @@ import 'package:customer/controllers/forgot_password_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -26,13 +27,13 @@ class ForgotPasswordScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Forgot Password".tr, style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 22, fontFamily: AppThemeData.semiBold)),
Text("No worries!! Well send you reset instructions".tr, style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.regular)),
Text("Forgot Password".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 22, fontFamily: AppThemeData.semiBold)),
Text("No worries!! Well send you reset instructions".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.regular)),
const SizedBox(height: 32),
TextFieldWidget(
title: 'Email Address'.tr,
title: 'Email Address'.tr(),
controller: controller.emailEditingController.value,
hintText: 'Enter email address'.tr,
hintText: 'Enter email address'.tr(),
prefix: Padding(
padding: const EdgeInsets.all(12),
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),
RoundedButtonFill(
title: "Forgot Password".tr,
title: "Forgot Password".tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
onPress: () async {
if (controller.emailEditingController.value.text.trim().isEmpty) {
ShowToastDialog.showToast("Please enter valid email".tr);
ShowToastDialog.showToast("Please enter valid email".tr());
} else {
controller.forgotPassword();
}

View File

@@ -8,6 +8,7 @@ import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -32,7 +33,7 @@ class GiftCardScreen extends StatelessWidget {
centerTitle: false,
titleSpacing: 0,
title: Text(
"Customize Gift Card".tr,
"Customize Gift Card".tr(),
textAlign: TextAlign.start,
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),
TextFieldWidget(
title: 'Choose an amount'.tr,
title: 'Choose an amount'.tr(),
controller: controller.amountController.value,
hintText: 'Enter gift card amount'.tr,
hintText: 'Enter gift card amount'.tr(),
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true),
textInputAction: TextInputAction.done,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
prefix: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
child: Text(
Constant.currencyModel!.symbol.tr,
Constant.currencyModel!.symbol.tr(),
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),
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(
padding: const EdgeInsets.only(bottom: 20),
child: RoundedButtonFill(
title: "Continue".tr,
title: "Continue".tr(),
height: 5.5,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
@@ -178,12 +179,12 @@ class GiftCardScreen extends StatelessWidget {
onPress: () async {
if (controller.amountController.value.text.isNotEmpty) {
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 {
giftCardBottomSheet(context, controller);
}
} 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),
decoration: ShapeDecoration(color: AppThemeData.ecommerce50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
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),
),
),
@@ -238,7 +239,7 @@ class GiftCardScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Bill Details".tr,
"Bill Details".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
),
@@ -255,7 +256,7 @@ class GiftCardScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Sub Total".tr,
"Sub Total".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -273,7 +274,7 @@ class GiftCardScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Grand Total".tr,
"Grand Total".tr(),
textAlign: TextAlign.start,
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),
Center(
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,
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey500 : AppThemeData.grey400),
),
@@ -309,7 +310,7 @@ class GiftCardScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(bottom: 20),
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,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,

View File

@@ -2,6 +2,7 @@ import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/history_gift_card_controller.dart';
import 'package:customer/models/gift_cards_order_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controllers/theme_controller.dart';
@@ -26,7 +27,7 @@ class HistoryGiftCard extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16),
child:
controller.giftCardsOrderList.isEmpty
? Constant.showEmptyView(message: "Purchased Gift card not found".tr)
? Constant.showEmptyView(message: "Purchased Gift card not found".tr())
: ListView.builder(
itemCount: controller.giftCardsOrderList.length,
shrinkWrap: true,
@@ -71,7 +72,7 @@ class HistoryGiftCard extends StatelessWidget {
children: [
Expanded(
child: Text(
"Gift Code".tr,
"Gift Code".tr(),
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
),
@@ -91,7 +92,7 @@ class HistoryGiftCard extends StatelessWidget {
children: [
Expanded(
child: Text(
"Gift Pin".tr,
"Gift Pin".tr(),
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,
children: [
Text(
'Share'.tr,
'Share'.tr(),
style: TextStyle(
color: isDark ? AppThemeData.grey300 : AppThemeData.grey600,
fontSize: 14,
@@ -174,7 +175,7 @@ class HistoryGiftCard extends StatelessWidget {
),
const Expanded(child: SizedBox()),
Text(
giftCardOrderModel.redeem == true ? "Redeemed".tr : "Not Redeem".tr,
giftCardOrderModel.redeem == true ? "Redeemed".tr() : "Not Redeem".tr(),
style: TextStyle(
fontSize: 16,
color: giftCardOrderModel.redeem == true ? AppThemeData.success400 : AppThemeData.danger300,

View File

@@ -7,6 +7,7 @@ import 'package:customer/models/wallet_transaction_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import '../../../controllers/theme_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -38,25 +39,25 @@ class RedeemGiftCardScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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),
),
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),
),
const SizedBox(height: 20),
TextFieldWidget(
title: 'Gift Code'.tr,
title: 'Gift Code'.tr(),
controller: controller.giftCodeController.value,
hintText: 'Enter gift code'.tr,
hintText: 'Enter gift code'.tr(),
textInputType: TextInputType.number,
prefix: Padding(padding: const EdgeInsets.all(10), child: SvgPicture.asset("assets/icons/ic_gift_code.svg")),
),
TextFieldWidget(
title: 'Gift Pin'.tr,
title: 'Gift Pin'.tr(),
controller: controller.giftPinController.value,
hintText: 'Enter gift pin'.tr,
hintText: 'Enter gift pin'.tr(),
textInputType: TextInputType.number,
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(
padding: const EdgeInsets.only(bottom: 20),
child: RoundedButtonFill(
title: "Redeem".tr,
title: "Redeem".tr(),
height: 5.5,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
fontSizes: 16,
onPress: () async {
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) {
ShowToastDialog.showToast("Please Enter Gift Pin".tr);
ShowToastDialog.showToast("Please Enter Gift Pin".tr());
} else {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
await FireStoreUtils.checkRedeemCode(controller.giftCodeController.value.text.replaceAll(" ", "")).then((value) async {
if (value != null) {
GiftCardsOrderModel giftCodeModel = value;
if (giftCodeModel.redeem == true) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Gift voucher already redeemed".tr);
ShowToastDialog.showToast("Gift voucher already redeemed".tr());
} else if (giftCodeModel.giftPin != controller.giftPinController.value.text) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Gift Pin Invalid".tr);
ShowToastDialog.showToast("Gift Pin Invalid".tr());
} else if (giftCodeModel.expireDate!.toDate().isBefore(DateTime.now())) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Gift Voucher expire".tr);
ShowToastDialog.showToast("Gift Voucher expire".tr());
} else {
giftCodeModel.redeem = true;
@@ -120,7 +121,7 @@ class RedeemGiftCardScreen extends StatelessWidget {
DashBoardController controller = Get.put(DashBoardController());
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 {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Invalid Gift Code".tr);
ShowToastDialog.showToast("Invalid Gift Code".tr());
}
});
}

View File

@@ -4,6 +4,7 @@ import 'package:customer/payment/createRazorPayOrderModel.dart';
import 'package:customer/payment/rozorpayConroller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controllers/theme_controller.dart';
@@ -26,7 +27,7 @@ class SelectGiftPaymentScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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(
padding: const EdgeInsets.symmetric(horizontal: 16),
@@ -35,7 +36,7 @@ class SelectGiftPaymentScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Preferred Payment".tr,
"Preferred Payment".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -64,7 +65,7 @@ class SelectGiftPaymentScreen extends StatelessWidget {
),
const SizedBox(height: 10),
Text(
"Other Payment Options".tr,
"Other Payment Options".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -114,7 +115,7 @@ class SelectGiftPaymentScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(bottom: 20),
child: RoundedButtonFill(
title: "Pay Now".tr,
title: "Pay Now".tr(),
height: 5,
color: AppThemeData.primary300,
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) {
if (value == null) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
CreateRazorPayOrderModel result = value;
controller.openCheckout(amount: controller.amountController.value.text, orderId: result.id);
}
});
} else {
ShowToastDialog.showToast("Please select payment method".tr);
ShowToastDialog.showToast("Please select payment method".tr());
}
},
),

View File

@@ -3,6 +3,7 @@ import 'package:customer/controllers/category_restaurant_controller.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -26,7 +27,7 @@ class CategoryRestaurantScreen extends StatelessWidget {
controller.isLoading.value
? Constant.loader()
: controller.allNearestRestaurant.isEmpty
? Constant.showEmptyView(message: "No Restaurant found".tr)
? Constant.showEmptyView(message: "No Restaurant found".tr())
: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: ListView.builder(
@@ -87,7 +88,7 @@ class CategoryRestaurantScreen extends StatelessWidget {
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
style: TextStyle(fontSize: 14, color: AppThemeData.success600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
),
],

View File

@@ -6,6 +6,7 @@ import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -77,7 +78,7 @@ class DiscountRestaurantListScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
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,
maxLines: 1,
style: TextStyle(overflow: TextOverflow.ellipsis, fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),

View File

@@ -22,6 +22,7 @@ import 'package:customer/utils/preferences.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/selected_location_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart' as flutterMap;
import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -92,7 +93,7 @@ class HomeScreen extends StatelessWidget {
),
const SizedBox(height: 12),
Text(
"No Store Found in Your Area".tr,
"No Store Found in Your Area".tr(),
style: TextStyle(
color:
isDark
@@ -105,7 +106,7 @@ class HomeScreen extends StatelessWidget {
const SizedBox(height: 5),
Text(
"Currently, there are no available store in your zone. Try changing your location to find nearby options."
.tr,
.tr(),
textAlign: TextAlign.center,
style: TextStyle(
color:
@@ -118,7 +119,7 @@ class HomeScreen extends StatelessWidget {
),
const SizedBox(height: 20),
RoundedButtonFill(
title: "Change Zone".tr,
title: "Change Zone".tr(),
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -229,7 +230,7 @@ class HomeScreen extends StatelessWidget {
onTap: () async {
ShowToastDialog.showLoader(
"Please wait..."
.tr,
.tr(),
);
// ✅ declare it once here!
@@ -516,7 +517,7 @@ class HomeScreen extends StatelessWidget {
true
? 'Искать что угодно'
: 'Search the store, item and more...'
.tr,
.tr(),
controller: null,
enable: false,
backgroundColor:
@@ -704,7 +705,7 @@ class HomeScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"New Arrivals".tr,
"New Arrivals".tr(),
textAlign:
TextAlign
.start,
@@ -739,7 +740,7 @@ class HomeScreen extends StatelessWidget {
});
},
child: Text(
"View all".tr,
"View all".tr(),
textAlign:
TextAlign
.center,
@@ -821,7 +822,7 @@ class HomeScreen extends StatelessWidget {
Expanded(
child: Text(
"Highlights for you"
.tr,
.tr(),
textAlign:
TextAlign
.start,
@@ -851,7 +852,7 @@ class HomeScreen extends StatelessWidget {
},
child: Text(
"View all"
.tr,
.tr(),
textAlign:
TextAlign
.center,
@@ -967,7 +968,7 @@ class HomeScreen extends StatelessWidget {
),
child: Text(
"Popular Stores"
.tr,
.tr(),
textAlign:
TextAlign
.center,
@@ -1020,7 +1021,7 @@ class HomeScreen extends StatelessWidget {
vertical: 10,
),
child: Text(
"All Stores".tr,
"All Stores".tr(),
textAlign:
TextAlign
.center,
@@ -1208,16 +1209,16 @@ class HomeScreen extends StatelessWidget {
isDark
? AppThemeData.greyDark100
: AppThemeData.grey100,
value: controller.selectedOrderTypeValue.value.tr,
value: controller.selectedOrderTypeValue.value.tr(),
icon: const Icon(Icons.keyboard_arrow_down),
items:
<String>['Delivery'.tr, 'TakeAway'.tr].map((
<String>['Delivery'.tr(), 'TakeAway'.tr()].map((
String value,
) {
return DropdownMenuItem<String>(
value: value,
child: Text(
value.tr,
value.tr(),
style: TextStyle(
fontFamily: AppThemeData.semiBold,
fontSize: 16,
@@ -1242,12 +1243,12 @@ class HomeScreen extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return CustomDialogBox(
title: "Alert".tr,
title: "Alert".tr(),
descriptions:
"Do you really want to change the delivery option? Your cart will be empty."
.tr,
positiveString: "Ok".tr,
negativeString: "Cancel".tr,
.tr(),
positiveString: "Ok".tr(),
negativeString: "Cancel".tr(),
positiveClick: () async {
await Preferences.setString(
Preferences.foodDeliveryType,
@@ -1287,7 +1288,7 @@ class HomeScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
name.tr,
name.tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: AppThemeData.bold,
@@ -1300,7 +1301,7 @@ class HomeScreen extends StatelessWidget {
onPress!();
},
child: Text(
"View all".tr,
"View all".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.regular,
@@ -1474,7 +1475,7 @@ class PopularRestaurant extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
style: TextStyle(
fontSize: 14,
color: AppThemeData.carRent600,
@@ -1779,7 +1780,7 @@ class AllRestaurant extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
style: TextStyle(
fontSize: 14,
color: AppThemeData.carRent600,
@@ -2076,7 +2077,7 @@ class NewArrival extends StatelessWidget {
),
const SizedBox(width: 4),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -2186,7 +2187,7 @@ class AdvertisementHomeCard extends StatelessWidget {
final isDark = themeController.isDark.value;
return InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(
model.vendorId!,
);
@@ -2499,7 +2500,7 @@ class OfferView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Upto".tr,
"Upto".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -2514,7 +2515,7 @@ class OfferView extends StatelessWidget {
),
),
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,
maxLines: 1,
style: TextStyle(
@@ -2563,7 +2564,7 @@ class OfferView extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
style: TextStyle(
fontSize: 12,
overflow: TextOverflow.ellipsis,
@@ -2649,7 +2650,7 @@ class BannerView extends StatelessWidget {
return InkWell(
onTap: () async {
if (bannerModel.redirect_type == "store") {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel =
await FireStoreUtils.getVendorById(
bannerModel.redirect_id.toString(),
@@ -2661,7 +2662,7 @@ class BannerView extends StatelessWidget {
arguments: {"vendorModel": vendorModel},
);
} 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(),
@@ -2681,7 +2682,7 @@ class BannerView extends StatelessWidget {
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
ShowToastDialog.showToast("Could not launch".tr);
ShowToastDialog.showToast("Could not launch".tr());
}
}
},
@@ -2755,7 +2756,7 @@ class BannerBottomView extends StatelessWidget {
return InkWell(
onTap: () async {
if (bannerModel.redirect_type == "store") {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel =
await FireStoreUtils.getVendorById(
bannerModel.redirect_id.toString(),
@@ -2767,7 +2768,7 @@ class BannerBottomView extends StatelessWidget {
arguments: {"vendorModel": vendorModel},
);
} 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(),
@@ -2787,7 +2788,7 @@ class BannerBottomView extends StatelessWidget {
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
ShowToastDialog.showToast("Could not launch".tr);
ShowToastDialog.showToast("Could not launch".tr());
}
}
},
@@ -2971,7 +2972,7 @@ class StoryView extends StatelessWidget {
if (snapshot.hasError) {
return Center(
child: Text(
'${"Error".tr}: ${snapshot.error}',
'${"Error".tr()}: ${snapshot.error}',
),
);
} else if (snapshot.data == null) {
@@ -3399,7 +3400,7 @@ class MapView extends StatelessWidget {
),
Text(
"Free Delivery"
.tr,
.tr(),
style: TextStyle(
fontSize:
14,

View File

@@ -23,6 +23,7 @@ import 'package:customer/utils/preferences.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/selected_location_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:geocoding/geocoding.dart';
@@ -69,16 +70,16 @@ class HomeScreenTwo extends StatelessWidget {
children: [
Image.asset("assets/images/location.gif", height: 120),
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),
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,
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
),
const SizedBox(height: 20),
RoundedButtonFill(
title: "Change Zone".tr,
title: "Change Zone".tr(),
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -122,7 +123,7 @@ class HomeScreenTwo extends StatelessWidget {
Get.offAll(const LoginScreen());
},
child: Text(
"Login".tr,
"Login".tr(),
textAlign: TextAlign.center,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 12),
),
@@ -145,7 +146,7 @@ class HomeScreenTwo extends StatelessWidget {
} else {
Constant.checkPermission(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
// ✅ declare once for whole method
ShippingAddress shippingAddress = ShippingAddress();
@@ -255,8 +256,8 @@ class HomeScreenTwo extends StatelessWidget {
child: TextFieldWidget(
hintText:
Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true
? 'Search the dish, foo and more...'.tr
: 'Search the store, item and more...'.tr,
? 'Search the dish, foo and more...'.tr()
: 'Search the store, item and more...'.tr(),
controller: null,
enable: false,
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: [
Expanded(
child: Text(
"Highlights for you".tr,
"Highlights for you".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -311,7 +312,7 @@ class HomeScreenTwo extends StatelessWidget {
});
},
child: Text(
"See all".tr,
"See all".tr(),
textAlign: TextAlign.center,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
),
@@ -417,13 +418,13 @@ class HomeScreenTwo extends StatelessWidget {
DropdownButton<String>(
isDense: false,
underline: const SizedBox(),
value: controller.selectedOrderTypeValue.value.tr,
value: controller.selectedOrderTypeValue.value.tr(),
icon: const Icon(Icons.keyboard_arrow_down),
items:
<String>['Delivery'.tr, 'TakeAway'.tr].map((String value) {
<String>['Delivery'.tr(), 'TakeAway'.tr()].map((String value) {
return DropdownMenuItem<String>(
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(),
onChanged: (value) async {
@@ -436,10 +437,10 @@ class HomeScreenTwo extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return CustomDialogBox(
title: "Alert".tr,
descriptions: "Do you really want to change the delivery option? Your cart will be empty.".tr,
positiveString: "Ok".tr,
negativeString: "Cancel".tr,
title: "Alert".tr(),
descriptions: "Do you really want to change the delivery option? Your cart will be empty.".tr(),
positiveString: "Ok".tr(),
negativeString: "Cancel".tr(),
positiveClick: () async {
await Preferences.setString(Preferences.foodDeliveryType, value!);
controller.selectedOrderTypeValue.value = value;
@@ -493,13 +494,13 @@ class CategoryView extends StatelessWidget {
children: [
Row(
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(
onTap: () {
Get.to(const ViewAllCategoryScreen());
},
child: Text(
"See all".tr,
"See all".tr(),
textAlign: TextAlign.center,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
),
@@ -507,7 +508,7 @@ class CategoryView extends StatelessWidget {
],
),
GradientText(
'Best Servings Food'.tr,
'Best Servings Food'.tr(),
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
gradient: LinearGradient(colors: [Color(0xFF3961F1), Color(0xFF11D0EA)]),
),
@@ -571,7 +572,7 @@ class OfferView extends StatelessWidget {
children: [
Row(
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(
onTap: () {
Get.to(
@@ -580,7 +581,7 @@ class OfferView extends StatelessWidget {
);
},
child: Text(
"See all".tr,
"See all".tr(),
textAlign: TextAlign.center,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
),
@@ -588,7 +589,7 @@ class OfferView extends StatelessWidget {
],
),
GradientText(
'Save Upto 50% Off'.tr,
'Save Upto 50% Off'.tr(),
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
gradient: LinearGradient(colors: [Color(0xFF39F1C5), Color(0xFF97EA11)]),
),
@@ -642,7 +643,7 @@ class OfferView extends StatelessWidget {
const SizedBox(height: 5),
RoundedButtonFill(
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)],
textColor: AppThemeData.grey50,
width: 20,
@@ -694,13 +695,13 @@ class BannerView extends StatelessWidget {
return InkWell(
onTap: () async {
if (bannerModel.redirect_type == "store") {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
ShowToastDialog.closeLoader();
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
} 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());
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
@@ -711,7 +712,7 @@ class BannerView extends StatelessWidget {
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
ShowToastDialog.showToast("Could not launch".tr);
ShowToastDialog.showToast("Could not launch".tr());
}
}
},
@@ -746,9 +747,9 @@ class StoryView extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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(
'Best Food Stories Ever'.tr,
'Best Food Stories Ever'.tr(),
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
gradient: LinearGradient(colors: [Color(0xFFF1C839), Color(0xFFEA1111)]),
),
@@ -787,7 +788,7 @@ class StoryView extends StatelessWidget {
return Constant.loader();
} else {
if (snapshot.hasError) {
return Center(child: Text('${"Error".tr}: ${snapshot.error}'));
return Center(child: Text('${"Error".tr()}: ${snapshot.error}'));
} else if (snapshot.data == null) {
return const SizedBox();
} else {
@@ -814,7 +815,7 @@ class StoryView extends StatelessWidget {
SvgPicture.asset("assets/icons/ic_star.svg"),
const SizedBox(width: 5),
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,
maxLines: 1,
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),
child: Row(
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(
onTap: () {
Get.to(const RestaurantListScreen(), arguments: {"vendorList": controller.allNearestRestaurant, "title": "Best Restaurants"});
},
child: Text(
"See all".tr,
"See all".tr(),
textAlign: TextAlign.center,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
),
@@ -938,7 +939,7 @@ class RestaurantView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"Upto".tr,
"Upto".tr(),
textAlign: TextAlign.center,
maxLines: 1,
style: TextStyle(
@@ -949,7 +950,7 @@ class RestaurantView extends StatelessWidget {
),
),
Text(
discountAmountTempList.reduce(min).toString() + "% OFF".tr,
discountAmountTempList.reduce(min).toString() + "% OFF".tr(),
textAlign: TextAlign.center,
maxLines: 1,
style: TextStyle(
@@ -1001,7 +1002,7 @@ class RestaurantView extends StatelessWidget {
SvgPicture.asset("assets/icons/ic_free_delivery.svg", width: 18),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontFamily: AppThemeData.medium,

View File

@@ -4,6 +4,7 @@ import 'package:customer/models/favourite_model.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:easy_localization/easy_localization.dart';
import '../../../controllers/theme_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -122,7 +123,7 @@ class RestaurantListScreen extends StatelessWidget {
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
style: TextStyle(fontSize: 14, color: AppThemeData.carRent600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
),
],

View File

@@ -5,6 +5,7 @@ import 'package:customer/themes/app_them_data.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/utils.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -103,7 +104,7 @@ class MoreStoriesState extends State<MoreStories> {
return SizedBox();
} else {
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}'));
} else if (snapshot.data == null) {
return const SizedBox();
@@ -135,7 +136,7 @@ class MoreStoriesState extends State<MoreStories> {
SvgPicture.asset("assets/icons/ic_star.svg"),
const SizedBox(width: 5),
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,
maxLines: 1,
style: const TextStyle(color: AppThemeData.warning300, fontSize: 12, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700),

View File

@@ -3,6 +3,7 @@ import 'package:customer/controllers/view_all_category_controller.dart';
import 'package:customer/models/vendor_category_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -24,7 +25,7 @@ class ViewAllCategoryScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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:
controller.isLoading.value

View File

@@ -1,6 +1,7 @@
import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/live_tracking_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart' as flutterMap;
import 'package:get/get.dart';
@@ -24,7 +25,7 @@ class LiveTrackingScreen extends StatelessWidget {
return Scaffold(
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:
Constant.selectedMapType == 'osm'
? flutterMap.FlutterMap(

View File

@@ -8,6 +8,7 @@ import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -37,7 +38,7 @@ class OrderDetailsScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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:
controller.isLoading.value
@@ -56,7 +57,7 @@ class OrderDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -64,7 +65,7 @@ class OrderDetailsScreen extends StatelessWidget {
),
),
RoundedButtonFill(
title: controller.orderModel.value.status.toString().tr,
title: controller.orderModel.value.status.toString().tr(),
color: Constant.statusColor(status: controller.orderModel.value.status.toString()),
width: 32,
height: 4.5,
@@ -125,7 +126,7 @@ class OrderDetailsScreen extends StatelessWidget {
? const SizedBox()
: InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.vendor!.author.toString());
@@ -236,7 +237,7 @@ class OrderDetailsScreen extends StatelessWidget {
? const SizedBox()
: InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.vendor!.author.toString());
@@ -314,7 +315,7 @@ class OrderDetailsScreen extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
"Order Delivered.".tr,
"Order Delivered.".tr(),
textAlign: TextAlign.right,
style: TextStyle(
color: isDark ? AppThemeData.grey100 : AppThemeData.grey800,
@@ -333,8 +334,8 @@ class OrderDetailsScreen extends StatelessWidget {
const SizedBox(width: 5),
Expanded(
child: Text(
"${'Your Order has been Preparing and assign to the driver'.tr}\n${'Preparation Time'.tr} ${controller.orderModel.value.estimatedTimeToPrepare}"
.tr,
"${'Your Order has been Preparing and assign to the driver'.tr()}\n${'Preparation Time'.tr()} ${controller.orderModel.value.estimatedTimeToPrepare}"
.tr(),
textAlign: TextAlign.start,
style: TextStyle(
color: isDark ? AppThemeData.warning400 : AppThemeData.warning400,
@@ -404,7 +405,7 @@ class OrderDetailsScreen extends StatelessWidget {
const SizedBox(width: 10),
InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
UserModel? customer = await FireStoreUtils.getUserProfile(controller.orderModel.value.authorID.toString());
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(controller.orderModel.value.driverID.toString());
@@ -450,7 +451,7 @@ class OrderDetailsScreen extends StatelessWidget {
),
const SizedBox(height: 14),
Text(
"Your Order".tr,
"Your Order".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -555,7 +556,7 @@ class OrderDetailsScreen extends StatelessWidget {
Align(
alignment: Alignment.centerRight,
child: RoundedButtonFill(
title: "Rate us".tr,
title: "Rate us".tr(),
height: 3.8,
width: 20,
color: isDark ? AppThemeData.warning300 : AppThemeData.warning300,
@@ -578,7 +579,7 @@ class OrderDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Variants".tr,
"Variants".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -616,7 +617,7 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Addons".tr,
"Addons".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -670,7 +671,7 @@ class OrderDetailsScreen extends StatelessWidget {
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// "Delivery Man".tr,
// "Delivery Man".tr(),
// textAlign: TextAlign.start,
// style: TextStyle(
// fontFamily: AppThemeData.semiBold,
@@ -689,7 +690,7 @@ class OrderDetailsScreen extends StatelessWidget {
// ],
// ),
Text(
"Bill Details".tr,
"Bill Details".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -706,7 +707,7 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Item totals".tr,
"Item totals".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -726,13 +727,13 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Delivery Fee".tr,
"Delivery Fee".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
),
(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(
Constant.amountShow(
amount:
@@ -753,7 +754,7 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Coupon Discount".tr,
"Coupon Discount".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -774,7 +775,7 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Special Discount".tr,
"Special Discount".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -800,7 +801,7 @@ class OrderDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Delivery Tips".tr,
"Delivery Tips".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -860,7 +861,7 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"To Pay".tr,
"To Pay".tr(),
textAlign: TextAlign.start,
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),
Text(
"Order Details".tr,
"Order Details".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -895,17 +896,17 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Delivery type".tr,
"Delivery type".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
),
Text(
controller.orderModel.value.takeAway == true
? "TakeAway".tr
? "TakeAway".tr()
: controller.orderModel.value.scheduleTime == null
? "Standard".tr
: "Schedule".tr,
? "Standard".tr()
: "Schedule".tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: AppThemeData.medium,
@@ -926,7 +927,7 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Payment Method".tr,
"Payment Method".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -944,7 +945,7 @@ class OrderDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Date and Time".tr,
"Date and Time".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -965,7 +966,7 @@ class OrderDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Phone Number".tr,
"Phone Number".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -991,7 +992,7 @@ class OrderDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Remarks".tr,
"Remarks".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -1026,7 +1027,7 @@ class OrderDetailsScreen extends StatelessWidget {
child:
controller.orderModel.value.status == Constant.orderShipped || controller.orderModel.value.status == Constant.orderInTransit
? RoundedButtonFill(
title: "Track Order".tr,
title: "Track Order".tr(),
height: 5.5,
color: AppThemeData.warning300,
textColor: AppThemeData.grey900,
@@ -1035,14 +1036,14 @@ class OrderDetailsScreen extends StatelessWidget {
},
)
: RoundedButtonFill(
title: "Reorder".tr,
title: "Reorder".tr(),
height: 5.5,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
onPress: () async {
for (var element in controller.orderModel.value.products!) {
controller.addToCart(cartProductModel: element);
ShowToastDialog.showToast("Item Added In a cart".tr);
ShowToastDialog.showToast("Item Added In a cart".tr());
}
},
),

View File

@@ -6,6 +6,7 @@ import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controllers/theme_controller.dart';
@@ -40,16 +41,16 @@ class OrderScreen extends StatelessWidget {
children: [
Image.asset("assets/images/login.gif", height: 120),
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),
Text(
"Youre not logged in. Please sign in to access your account and explore all features.".tr,
"Youre not logged in. Please sign in to access your account and explore all features.".tr(),
textAlign: TextAlign.center,
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
),
const SizedBox(height: 20),
RoundedButtonFill(
title: "Log in".tr,
title: "Log in".tr(),
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -74,11 +75,11 @@ class OrderScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"My Order".tr,
"My Order".tr(),
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
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),
),
],
@@ -109,11 +110,11 @@ class OrderScreen extends StatelessWidget {
dividerColor: Colors.transparent,
indicatorSize: TabBarIndicatorSize.tab,
tabs: [
Padding(padding: const EdgeInsets.symmetric(horizontal: 18), child: Tab(text: 'All'.tr)),
Tab(text: 'In Progress'.tr),
Tab(text: 'Delivered'.tr),
Tab(text: 'Cancelled'.tr),
Tab(text: 'Rejected'.tr),
Padding(padding: const EdgeInsets.symmetric(horizontal: 18), child: Tab(text: 'All'.tr())),
Tab(text: 'In Progress'.tr()),
Tab(text: 'Delivered'.tr()),
Tab(text: 'Cancelled'.tr()),
Tab(text: 'Rejected'.tr()),
],
),
),
@@ -122,7 +123,7 @@ class OrderScreen extends StatelessWidget {
child: TabBarView(
children: [
controller.allList.isEmpty
? Constant.showEmptyView(message: "Order Not Found".tr)
? Constant.showEmptyView(message: "Order Not Found".tr())
: RefreshIndicator(
onRefresh: () => controller.getOrder(),
child: ListView.builder(
@@ -136,7 +137,7 @@ class OrderScreen extends StatelessWidget {
),
),
controller.inProgressList.isEmpty
? Constant.showEmptyView(message: "Order Not Found".tr)
? Constant.showEmptyView(message: "Order Not Found".tr())
: RefreshIndicator(
onRefresh: () => controller.getOrder(),
child: ListView.builder(
@@ -150,7 +151,7 @@ class OrderScreen extends StatelessWidget {
),
),
controller.deliveredList.isEmpty
? Constant.showEmptyView(message: "Order Not Found".tr)
? Constant.showEmptyView(message: "Order Not Found".tr())
: RefreshIndicator(
onRefresh: () => controller.getOrder(),
child: ListView.builder(
@@ -164,7 +165,7 @@ class OrderScreen extends StatelessWidget {
),
),
controller.cancelledList.isEmpty
? Constant.showEmptyView(message: "Order Not Found".tr)
? Constant.showEmptyView(message: "Order Not Found".tr())
: RefreshIndicator(
onRefresh: () => controller.getOrder(),
child: ListView.builder(
@@ -178,7 +179,7 @@ class OrderScreen extends StatelessWidget {
),
),
controller.rejectedList.isEmpty
? Constant.showEmptyView(message: "Order Not Found".tr)
? Constant.showEmptyView(message: "Order Not Found".tr())
: RefreshIndicator(
onRefresh: () => controller.getOrder(),
child: ListView.builder(
@@ -296,11 +297,11 @@ class OrderScreen extends StatelessWidget {
onTap: () {
for (var element in orderModel.products!) {
controller.addToCart(cartProductModel: element);
ShowToastDialog.showToast("Item Added In a cart".tr);
ShowToastDialog.showToast("Item Added In a cart".tr());
}
},
child: Text(
"Reorder".tr,
"Reorder".tr(),
textAlign: TextAlign.center,
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});
},
child: Text(
"Track Order".tr,
"Track Order".tr(),
textAlign: TextAlign.center,
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});
},
child: Text(
"View Details".tr,
"View Details".tr(),
textAlign: TextAlign.center,
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
),

View File

@@ -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/custom_dialog_box.dart';
import 'package:customer/themes/responsive.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:in_app_review/in_app_review.dart';
import '../../../controllers/theme_controller.dart';
import '../../../service/fire_store_utils.dart';
@@ -51,16 +52,16 @@ class ProfileScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"My Profile".tr,
"My Profile".tr(),
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
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),
),
const SizedBox(height: 20),
Text(
"General Information".tr,
"General Information".tr(),
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
const SizedBox(height: 10),
@@ -73,18 +74,18 @@ class ProfileScreen extends StatelessWidget {
children: [
Constant.userModel == null
? 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());
}),
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());
}),
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());
}),
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());
}),
],
@@ -97,7 +98,7 @@ class ProfileScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Bookings Information".tr,
"Bookings Information".tr(),
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
const SizedBox(height: 10),
@@ -108,7 +109,7 @@ class ProfileScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
child: Column(
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());
}),
],
@@ -120,7 +121,7 @@ class ProfileScreen extends StatelessWidget {
: const SizedBox(),
const SizedBox(height: 10),
Text(
"Preferences".tr,
"Preferences".tr(),
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
const SizedBox(height: 10),
@@ -131,17 +132,17 @@ class ProfileScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
child: Column(
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());
}),
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),
Text(
"Social".tr,
"Social".tr(),
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
const SizedBox(height: 10),
@@ -154,16 +155,16 @@ class ProfileScreen extends StatelessWidget {
children: [
Constant.userModel == null
? 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());
}),
cardDecoration(isDark, controller, "assets/icons/ic_share.svg", "Share app".tr, () {
cardDecoration(isDark, controller, "assets/icons/ic_share.svg", "Share app".tr(), () {
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}',
subject: 'Look what I made!'.tr,
'${'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(),
);
}),
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;
inAppReview.requestReview();
}),
@@ -178,7 +179,7 @@ class ProfileScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Communication".tr,
"Communication".tr(),
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
const SizedBox(height: 10),
@@ -189,16 +190,16 @@ class ProfileScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
child: Column(
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());
}),
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());
}),
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());
}),
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());
}),
],
@@ -208,7 +209,7 @@ class ProfileScreen extends StatelessWidget {
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),
Container(
width: Responsive.width(100, context),
@@ -217,10 +218,10 @@ class ProfileScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
child: Column(
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"));
}),
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"));
}),
],
@@ -237,18 +238,18 @@ class ProfileScreen extends StatelessWidget {
child: Column(
children: [
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());
})
: cardDecoration(isDark, controller, "assets/icons/ic_logout.svg", "Log out".tr, () {
: cardDecoration(isDark, controller, "assets/icons/ic_logout.svg", "Log out".tr(), () {
showDialog(
context: context,
builder: (BuildContext context) {
return CustomDialogBox(
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,
positiveString: "Log out".tr,
negativeString: "Cancel".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(),
positiveString: "Log out".tr(),
negativeString: "Cancel".tr(),
positiveClick: () async {
Constant.userModel!.fcmToken = "";
await FireStoreUtils.updateUser(Constant.userModel!);
@@ -279,20 +280,20 @@ class ProfileScreen extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return CustomDialogBox(
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,
positiveString: "Delete".tr,
negativeString: "Cancel".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(),
positiveString: "Delete".tr(),
negativeString: "Cancel".tr(),
positiveClick: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
await controller.deleteUserFromServer();
await FireStoreUtils.deleteUser().then((value) {
ShowToastDialog.closeLoader();
if (value == true) {
ShowToastDialog.showToast("Account deleted successfully".tr);
ShowToastDialog.showToast("Account deleted successfully".tr());
Get.offAll(const LoginScreen());
} 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"),
const SizedBox(width: 10),
Text(
"Delete Account".tr,
"Delete Account".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.danger300 : AppThemeData.danger300),
),
@@ -347,25 +348,25 @@ class ProfileScreen extends StatelessWidget {
},
child: Row(
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),
Expanded(
child: Text(
title.tr,
title.tr(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: AppThemeData.medium,
fontSize: 16,
color:
title == "Log out".tr
title == "Log out".tr()
? AppThemeData.danger300
: title == "Log In".tr
: title == "Log In".tr()
? AppThemeData.success500
: (isDark ? AppThemeData.grey100 : AppThemeData.grey800),
),
),
),
title == "Dark Mode".tr
title == "Dark Mode".tr()
? Transform.scale(
scale: 0.8,
child: Obx(() => CupertinoSwitch(value: controller.isDarkModeSwitch.value, activeTrackColor: AppThemeData.primary300, onChanged: controller.toggleDarkMode)),

View File

@@ -6,6 +6,7 @@ import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -31,7 +32,7 @@ class RateProductScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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:
controller.isLoading.value
@@ -49,9 +50,9 @@ class RateProductScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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(
"${controller.productModel.value.name}".tr,
"${controller.productModel.value.name}".tr(),
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 18, fontFamily: AppThemeData.semiBold),
),
const SizedBox(height: 10),
@@ -123,14 +124,14 @@ class RateProductScreen extends StatelessWidget {
SvgPicture.asset('assets/icons/ic_folder.svg'),
const SizedBox(height: 10),
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),
),
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),
RoundedButtonFill(
title: "Brows Image".tr,
title: "Brows Image".tr(),
color: AppThemeData.primary50,
width: 30,
height: 5,
@@ -216,7 +217,7 @@ class RateProductScreen extends StatelessWidget {
enabledBorder: InputBorder.none,
errorBorder: 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),
),
),
@@ -235,7 +236,7 @@ class RateProductScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(bottom: 20),
child: RoundedButtonFill(
title: "Submit Review".tr,
title: "Submit Review".tr(),
height: 5.5,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
@@ -265,7 +266,7 @@ class RateProductScreen extends StatelessWidget {
children: [
Padding(
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(
mainAxisAlignment: MainAxisAlignment.center,
@@ -277,7 +278,7 @@ class RateProductScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
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,
children: [
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())),
],
),
),

View File

@@ -3,6 +3,7 @@ import 'package:customer/controllers/refer_friend_controller.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.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")),
const SizedBox(height: 10),
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),
),
const SizedBox(width: 4),
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),
),
const SizedBox(height: 32),
Text(
"Invite Friends & Businesses".tr,
"Invite Friends & Businesses".tr(),
style: TextStyle(
fontSize: 16,
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
@@ -71,8 +72,8 @@ class ReferFriendScreen extends StatelessWidget {
),
const SizedBox(height: 8),
Text(
"${'Invite your friends to sign up with Foodie using your code, and youll earn'.tr} ${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount)} ${'after their Success the first order! 💸🍔'.tr}"
.tr,
"${'Invite your friends to sign up with Foodie using your code, and youll earn'.tr()} ${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount)} ${'after their Success the first order! 💸🍔'.tr()}"
.tr(),
textAlign: TextAlign.center,
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(
onTap: () {
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),
),
@@ -117,7 +118,7 @@ class ReferFriendScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 30),
child: Text(
"or".tr,
"or".tr(),
textAlign: TextAlign.center,
style: TextStyle(
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
@@ -132,13 +133,13 @@ class ReferFriendScreen extends StatelessWidget {
),
),
RoundedButtonFill(
title: "Share Code".tr,
title: "Share Code".tr(),
width: 55,
color: AppThemeData.ecommerce300,
textColor: AppThemeData.grey50,
onPress: () async {
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()}",
);
},
),

View File

@@ -13,6 +13,7 @@ import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -51,8 +52,8 @@ class RestaurantDetailsScreen extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
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('${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)),
],
),
),
@@ -89,7 +90,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
children: [
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
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});
},
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),
),
),
@@ -301,7 +302,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
: Row(
children: [
Text(
controller.isOpen.value ? "Open".tr : "Close".tr,
controller.isOpen.value ? "Open".tr() : "Close".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -316,13 +317,13 @@ class RestaurantDetailsScreen extends StatelessWidget {
InkWell(
onTap: () {
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 {
timeShowBottomSheet(context, controller);
}
},
child: Text(
"View Timings".tr,
"View Timings".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -344,7 +345,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
children: [
const SizedBox(height: 20),
Text(
"Also applicable on table booking".tr,
"Also applicable on table booking".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -383,7 +384,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Table Booking".tr,
"Table Booking".tr(),
style: TextStyle(
fontSize: 16,
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
@@ -392,7 +393,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
),
),
Text(
"Quick Conformations".tr,
"Quick Conformations".tr(),
style: TextStyle(
fontSize: 12,
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
@@ -418,7 +419,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
children: [
const SizedBox(height: 20),
Text(
"Additional Offers".tr,
"Additional Offers".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -435,7 +436,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
),
const SizedBox(height: 20),
Text(
"Menu".tr,
"Menu".tr(),
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -449,7 +450,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
const SizedBox(height: 10),
TextFieldWidget(
controller: controller.searchEditingController.value,
hintText: 'Search the item and more...'.tr,
hintText: 'Search the item and more...'.tr(),
onchange: (value) {
controller.searchProduct(value);
},
@@ -492,7 +493,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
SvgPicture.asset("assets/icons/ic_veg.svg", height: 20, width: 20),
const SizedBox(width: 8),
Text(
'Veg'.tr,
'Veg'.tr(),
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),
const SizedBox(width: 8),
Text(
'Non Veg'.tr,
'Non Veg'.tr(),
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
),
],
@@ -805,7 +806,7 @@ class CouponListView extends StatelessWidget {
InkWell(
onTap: () {
Clipboard.setData(ClipboardData(text: offerModel.code.toString())).then((value) {
ShowToastDialog.showToast("Copied".tr);
ShowToastDialog.showToast("Copied".tr());
});
},
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"),
const SizedBox(width: 5),
Text(
productModel.nonveg == true ? "Non Veg.".tr : "Pure veg.".tr,
productModel.nonveg == true ? "Non Veg.".tr() : "Pure veg.".tr(),
style: TextStyle(
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
fontFamily: AppThemeData.semiBold,
@@ -995,7 +996,7 @@ class ProductListView extends StatelessWidget {
Icon(Icons.info, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, size: 18),
const SizedBox(width: 8),
Text(
"Info".tr,
"Info".tr(),
maxLines: 2,
style: TextStyle(
overflow: TextOverflow.ellipsis,
@@ -1064,7 +1065,7 @@ class ProductListView extends StatelessWidget {
child:
selectedVariants.isNotEmpty || (productModel.addOnsTitle != null && productModel.addOnsTitle!.isNotEmpty)
? RoundedButtonFill(
title: "Add".tr,
title: "Add".tr(),
width: 10,
height: 4,
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,
);
} else {
ShowToastDialog.showToast("Out of stock".tr);
ShowToastDialog.showToast("Out of stock".tr());
}
},
child: Icon(Icons.add, color: isDark ? AppThemeData.grey50 : AppThemeData.greyDark50),
@@ -1186,7 +1187,7 @@ class ProductListView extends StatelessWidget {
),
)
: RoundedButtonFill(
title: "Add".tr,
title: "Add".tr(),
width: 10,
height: 4,
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
@@ -1195,7 +1196,7 @@ class ProductListView extends StatelessWidget {
if (1 <= (productModel.quantity ?? 0) || (productModel.quantity ?? 0) == -1) {
controller.addToCart(productModel: productModel, price: price, discountPrice: disPrice, isIncrement: true, quantity: 1);
} else {
ShowToastDialog.showToast("Out of stock".tr);
ShowToastDialog.showToast("Out of stock".tr());
}
},
),
@@ -1257,7 +1258,7 @@ class ProductListView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Product Information's".tr,
"Product Information's".tr(),
textAlign: TextAlign.start,
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: [
Expanded(
child: Text(
"Gram".tr,
"Gram".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -1300,7 +1301,7 @@ class ProductListView extends StatelessWidget {
children: [
Expanded(
child: Text(
"Calories".tr,
"Calories".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -1322,7 +1323,7 @@ class ProductListView extends StatelessWidget {
children: [
Expanded(
child: Text(
"Proteins".tr,
"Proteins".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -1344,7 +1345,7 @@ class ProductListView extends StatelessWidget {
children: [
Expanded(
child: Text(
"Fats".tr,
"Fats".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
),
@@ -1365,7 +1366,7 @@ class ProductListView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Specification".tr,
"Specification".tr(),
textAlign: TextAlign.start,
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,
children: [
Text(
"Brand".tr,
"Brand".tr(),
textAlign: TextAlign.start,
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(height: 20),
RoundedButtonFill(
title: "Back".tr,
title: "Back".tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
onPress: () async {
@@ -1588,7 +1589,7 @@ class ProductDetailsView extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Required • Select any 1 option".tr,
"Required • Select any 1 option".tr(),
style: TextStyle(
fontSize: 12,
overflow: TextOverflow.ellipsis,
@@ -1700,7 +1701,7 @@ class ProductDetailsView extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Text(
"Addons".tr,
"Addons".tr(),
style: TextStyle(
fontSize: 16,
overflow: TextOverflow.ellipsis,
@@ -1830,7 +1831,7 @@ class ProductDetailsView extends StatelessWidget {
controller.quantity.value += 1;
controller.update();
} else {
ShowToastDialog.showToast("Out of stock".tr);
ShowToastDialog.showToast("Out of stock".tr());
}
} else {
int totalQuantity = int.parse(
@@ -1840,7 +1841,7 @@ class ProductDetailsView extends StatelessWidget {
controller.quantity.value += 1;
controller.update();
} else {
ShowToastDialog.showToast("Out of stock".tr);
ShowToastDialog.showToast("Out of stock".tr());
}
}
},
@@ -1854,7 +1855,7 @@ class ProductDetailsView extends StatelessWidget {
Expanded(
flex: 2,
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,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,

View File

@@ -6,6 +6,7 @@ import 'package:customer/models/rating_model.dart';
import 'package:customer/models/review_attribute_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import '../../../controllers/theme_controller.dart';
import 'package:customer/utils/network_image_widget.dart';
@@ -31,13 +32,13 @@ class ReviewListScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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:
controller.isLoading.value
? Constant.loader()
: controller.ratingList.isEmpty
? Constant.showEmptyView(message: "No Review found".tr)
? Constant.showEmptyView(message: "No Review found".tr())
: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: ListView.builder(
@@ -72,7 +73,7 @@ class ReviewListScreen extends StatelessWidget {
} else if (snapshot.data != null) {
ProductModel model = ProductModel.fromJson(snapshot.data!.data()!);
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),
);
} else {

View File

@@ -1,6 +1,7 @@
import 'package:customer/controllers/scan_qr_code_controller.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:qr_code_dart_scan/qr_code_dart_scan.dart';
@@ -24,7 +25,7 @@ class ScanQrCodeScreen extends StatelessWidget {
centerTitle: false,
titleSpacing: 0,
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(
// 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)
onCapture: (Result result) {
Get.back();
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
if (controller.allNearestRestaurant.isNotEmpty) {
if (controller.allNearestRestaurant.where((vendor) => vendor.id == result.text).isEmpty) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Store is not available".tr);
ShowToastDialog.showToast("Store is not available".tr());
return;
}
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});
} else {
Get.back();
ShowToastDialog.showToast("Store is not available".tr);
ShowToastDialog.showToast("Store is not available".tr());
}
},
),

View File

@@ -5,6 +5,7 @@ import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import '../../../controllers/theme_controller.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:flutter/material.dart';
@@ -31,7 +32,7 @@ class SearchScreen extends StatelessWidget {
centerTitle: false,
titleSpacing: 0,
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,
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -40,7 +41,7 @@ class SearchScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
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")),
controller: null,
onchange: (value) {
@@ -65,7 +66,7 @@ class SearchScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Store".tr,
"Store".tr(),
textAlign: TextAlign.start,
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"),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
"Free Delivery".tr(),
style: TextStyle(fontSize: 14, color: AppThemeData.success300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
),
],
@@ -236,7 +237,7 @@ class SearchScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Items".tr,
"Items".tr(),
textAlign: TextAlign.start,
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"),
const SizedBox(width: 5),
Text(
productModel.nonveg == true ? "Non Veg.".tr : "Pure veg.".tr,
productModel.nonveg == true ? "Non Veg.".tr() : "Pure veg.".tr(),
style: TextStyle(
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
fontFamily: AppThemeData.semiBold,

View File

@@ -1,5 +1,6 @@
import 'package:customer/constant/constant.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.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),
),
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),
),
elevation: 0,

View File

@@ -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/round_button_fill.dart';
import 'package:customer/themes/text_field_widget.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
@@ -27,7 +28,7 @@ class PaymentListScreen extends StatelessWidget {
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
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(
child: Column(
@@ -36,8 +37,8 @@ class PaymentListScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TextFieldWidget(
title: 'Amount'.tr,
hintText: 'Enter Amount'.tr,
title: 'Amount'.tr(),
hintText: 'Enter Amount'.tr(),
controller: controller.topUpAmountController.value,
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))),
@@ -47,7 +48,7 @@ class PaymentListScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
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),
),
),
@@ -86,14 +87,14 @@ class PaymentListScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(bottom: 20),
child: RoundedButtonFill(
title: "Top-up".tr,
title: "Top-up".tr(),
height: 5.5,
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
fontSizes: 16,
onPress: () async {
if (controller.topUpAmountController.value.text.isEmpty) {
ShowToastDialog.showToast("Please Enter Amount".tr);
ShowToastDialog.showToast("Please Enter Amount".tr());
} else {
if (double.parse(controller.topUpAmountController.value.text) >= double.parse(Constant.minimumAmountToDeposit.toString())) {
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) {
if (value == null) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
CreateRazorPayOrderModel result = value;
controller.openCheckout(amount: controller.topUpAmountController.value.text, orderId: result.id);
}
});
} else {
ShowToastDialog.showToast("Please select payment method".tr);
ShowToastDialog.showToast("Please select payment method".tr());
}
} 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)}");
}
}
},

View File

@@ -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/themes/app_them_data.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import '../../../constant/collection_name.dart';
import '../../../controllers/theme_controller.dart';
import '../../../models/cab_order_model.dart';
@@ -48,16 +49,16 @@ class WalletScreen extends StatelessWidget {
children: [
Image.asset("assets/images/login.gif", height: 120),
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),
Text(
"Youre not logged in. Please sign in to access your account and explore all features.".tr,
"Youre not logged in. Please sign in to access your account and explore all features.".tr(),
textAlign: TextAlign.center,
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
),
const SizedBox(height: 20),
RoundedButtonFill(
title: "Log in".tr,
title: "Log in".tr(),
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -86,11 +87,11 @@ class WalletScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"My Wallet".tr,
"My Wallet".tr(),
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
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),
),
],
@@ -112,7 +113,7 @@ class WalletScreen extends StatelessWidget {
child: Column(
children: [
Text(
"My Wallet".tr,
"My Wallet".tr(),
maxLines: 1,
style: TextStyle(
color: isDark ? AppThemeData.primary100 : AppThemeData.primary100,
@@ -130,7 +131,7 @@ class WalletScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 80),
child: RoundedButtonFill(
title: "Top up".tr,
title: "Top up".tr(),
color: AppThemeData.warning300,
textColor: AppThemeData.grey900,
onPress: () {
@@ -148,7 +149,7 @@ class WalletScreen extends StatelessWidget {
Expanded(
child:
controller.walletTransactionList.isEmpty
? Constant.showEmptyView(message: "Transaction not found".tr)
? Constant.showEmptyView(message: "Transaction not found".tr())
: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: ListView.builder(
@@ -197,7 +198,7 @@ class WalletScreen extends StatelessWidget {
Get.to(const OrderDetailsScreen(), arguments: {"orderModel": OrderModel.fromJson(orderData)});
break;
default:
ShowToastDialog.showToast("Order details not available".tr);
ShowToastDialog.showToast("Order details not available".tr());
}
}
},

View File

@@ -1,5 +1,6 @@
import 'package:customer/constant/assets.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../controllers/on_boarding_controller.dart';
@@ -65,7 +66,7 @@ class OnboardingScreen extends StatelessWidget {
const SizedBox(height: 20),
controller.currentPage.value == pageCount - 1
? RoundedButtonFill(
title: "Lets Get Started".tr,
title: "Lets Get Started".tr(),
onPress: () {
_finish();
},
@@ -73,11 +74,11 @@ class OnboardingScreen extends StatelessWidget {
)
: Row(
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),
Expanded(
child: RoundedButtonFill(
title: "Next".tr,
title: "Next".tr(),
onPress: () {
controller.nextPage();
},

View File

@@ -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/themes/app_them_data.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -32,7 +33,7 @@ class FavouriteOndemandScreen extends StatelessWidget {
child: Row(
children: [
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: [
Image.asset("assets/images/login.gif", height: 120),
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),
Text(
"Youre not logged in. Please sign in to access your account and explore all features.".tr,
"Youre not logged in. Please sign in to access your account and explore all features.".tr(),
textAlign: TextAlign.center,
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
),
const SizedBox(height: 20),
RoundedButtonFill(
title: "Log in".tr,
title: "Log in".tr(),
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -74,7 +75,7 @@ class FavouriteOndemandScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child:
controller.lstFav.isEmpty
? Constant.showEmptyView(message: "Favourite Service not found.".tr)
? Constant.showEmptyView(message: "Favourite Service not found.".tr())
: ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.zero,
@@ -271,19 +272,19 @@ class FavouriteOndemandScreen extends StatelessWidget {
Widget _buildPrice(ProviderServiceModel provider, {bool isDark = false}) {
if (provider.disPrice == "" || provider.disPrice == "0") {
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),
);
} else {
return Row(
children: [
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),
),
const SizedBox(width: 5),
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),
),
],

View File

@@ -1,4 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
@@ -29,7 +30,7 @@ class MyBookingOnDemandScreen extends StatelessWidget {
automaticallyImplyLeading: false,
backgroundColor: AppThemeData.primary300,
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(
preferredSize: const Size.fromHeight(48),
child: TabBar(
@@ -54,7 +55,7 @@ class MyBookingOnDemandScreen extends StatelessWidget {
final orders = controller.getOrdersForTab(title);
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(
@@ -124,7 +125,7 @@ class MyBookingOnDemandScreen extends StatelessWidget {
onProviderOrder.otp != null &&
onProviderOrder.otp!.isNotEmpty)
Text(
"${'OTP :'.tr} ${onProviderOrder.otp}",
"${'OTP :'.tr()} ${onProviderOrder.otp}",
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();
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),
);
}
@@ -194,8 +195,8 @@ class MyBookingOnDemandScreen extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
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(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)),
],
),
);

View File

@@ -1,5 +1,6 @@
import 'package:bottom_picker/bottom_picker.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart';
@@ -46,7 +47,7 @@ class OnDemandBookingScreen extends StatelessWidget {
),
),
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,
children: [
// 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),
Container(
decoration: BoxDecoration(
@@ -118,7 +119,7 @@ class OnDemandBookingScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
InkWell(
onTap: () async {
@@ -130,14 +131,14 @@ class OnDemandBookingScreen extends StatelessWidget {
controller.selectedAddress.value = shippingAddress;
controller.calculatePrice();
} else {
ShowToastDialog.showToast("Service not available in this area".tr);
ShowToastDialog.showToast("Service not available in this area".tr());
}
}
});
} else {
Constant.checkPermission(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
ShippingAddress shippingAddress = ShippingAddress();
@@ -205,7 +206,7 @@ class OnDemandBookingScreen extends StatelessWidget {
),
),
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),
GestureDetector(
onTap: () {
@@ -225,7 +226,7 @@ class OnDemandBookingScreen extends StatelessWidget {
closeIconColor: isDark ? Colors.white : Colors.black,
).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),
controller.provider.value?.priceUnit == "Fixed"
@@ -248,7 +249,7 @@ class OnDemandBookingScreen extends StatelessWidget {
buildPromoCode(controller, isDark),
Padding(
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),
],
@@ -259,7 +260,7 @@ class OnDemandBookingScreen extends StatelessWidget {
),
bottomNavigationBar: Padding(
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(
margin: const EdgeInsets.only(top: 3),
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),
),
),
@@ -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)),
Container(margin: const EdgeInsets.only(left: 15, right: 15, top: 3), width: 1, color: AppThemeData.grey50),
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),
),
],
@@ -337,10 +338,10 @@ class OnDemandBookingScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
Text(
"Apply promo code".tr,
"Apply promo code".tr(),
style: AppThemeData.mediumTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
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: 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(
child: Container(
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(
@@ -426,7 +427,7 @@ class OnDemandBookingScreen extends StatelessWidget {
controller: controller.couponTextController.value,
decoration: InputDecoration(
border: InputBorder.none,
hintText: "Write Coupon Code".tr,
hintText: "Write Coupon Code".tr(),
hintStyle: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark400 : AppThemeData.grey400),
),
),
@@ -437,7 +438,7 @@ class OnDemandBookingScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(top: 30, bottom: 30, left: 15, right: 15),
child: RoundedButtonFill(
title: "REDEEM NOW".tr,
title: "REDEEM NOW".tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
onPress: () {
@@ -449,7 +450,7 @@ class OnDemandBookingScreen extends StatelessWidget {
controller.applyCoupon(matchingCoupon);
Get.back();
} 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(
children: [
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
? Padding(
@@ -488,7 +489,7 @@ class OnDemandBookingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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),
),
Text(controller.offerCode.value, style: TextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
@@ -501,7 +502,7 @@ class OnDemandBookingScreen extends StatelessWidget {
)
: const SizedBox(),
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(),
ListView.builder(
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),
],
),
@@ -548,8 +549,8 @@ class OnDemandBookingScreen extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
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(title.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