BASE: Switch From EasyLocalization To GetX Localization.
This commit is contained in:
@@ -19,7 +19,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:geolocator/geolocator.dart' as geolocator;
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:mailer/mailer.dart';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'dart:convert';
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import '../../models/onprovider_order_model.dart';
|
||||
import '../models/wallet_transaction_model.dart';
|
||||
@@ -75,7 +76,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 =
|
||||
@@ -111,7 +112,7 @@ class OnDemandPaymentController extends GetxController {
|
||||
);
|
||||
}
|
||||
|
||||
ShowToastDialog.showToast("OnDemand Service successfully booked".tr());
|
||||
ShowToastDialog.showToast("OnDemand Service successfully booked".tr);
|
||||
}
|
||||
if (selectedPaymentMethod.value == PaymentGateway.wallet.name) {
|
||||
WalletTransactionModel transactionModel = WalletTransactionModel(
|
||||
@@ -123,8 +124,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((
|
||||
@@ -161,7 +162,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((
|
||||
@@ -189,7 +190,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((
|
||||
@@ -321,7 +322,7 @@ class OnDemandPaymentController 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(
|
||||
@@ -354,7 +355,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) {
|
||||
@@ -437,10 +438,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 {
|
||||
@@ -472,15 +473,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -507,15 +508,15 @@ 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(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -557,10 +558,10 @@ class OnDemandPaymentController extends GetxController {
|
||||
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 {
|
||||
@@ -594,11 +595,11 @@ class OnDemandPaymentController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -743,7 +744,7 @@ class OnDemandPaymentController 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,
|
||||
);
|
||||
}
|
||||
return GetPaymentTxtTokenModel.fromJson(data);
|
||||
@@ -780,18 +781,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) {
|
||||
@@ -809,10 +810,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -853,7 +854,7 @@ class OnDemandPaymentController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -901,12 +902,12 @@ class OnDemandPaymentController 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -934,7 +935,7 @@ 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 '';
|
||||
}
|
||||
|
||||
@@ -946,7 +947,7 @@ class OnDemandPaymentController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1001,7 +1002,7 @@ class OnDemandPaymentController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1029,13 +1030,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);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@@ -1058,7 +1059,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 '';
|
||||
// }
|
||||
// }
|
||||
@@ -1099,7 +1100,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 '';
|
||||
// }
|
||||
// }
|
||||
@@ -1124,11 +1125,11 @@ class OnDemandPaymentController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ 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';
|
||||
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
|
||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:latlong2/latlong.dart' as latlong;
|
||||
@@ -402,7 +402,7 @@ 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(
|
||||
@@ -412,7 +412,7 @@ class IntercityHomeController extends GetxController {
|
||||
Marker(
|
||||
markerId: const MarkerId("driver"),
|
||||
position: LatLng(driverLat, driverLng),
|
||||
infoWindow: InfoWindow(title: "Driver at Pickup".tr()),
|
||||
infoWindow: InfoWindow(title: "Driver at Pickup".tr),
|
||||
icon: taxiIcon ?? BitmapDescriptor.defaultMarker,
|
||||
),
|
||||
]);
|
||||
@@ -421,7 +421,7 @@ class IntercityHomeController extends GetxController {
|
||||
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(
|
||||
@@ -431,7 +431,7 @@ class IntercityHomeController extends GetxController {
|
||||
Marker(
|
||||
markerId: const MarkerId("driver"),
|
||||
position: LatLng(driverLat, driverLng),
|
||||
infoWindow: InfoWindow(title: "Driver Location".tr()),
|
||||
infoWindow: InfoWindow(title: "Driver Location".tr),
|
||||
icon: taxiIcon ?? BitmapDescriptor.defaultMarker,
|
||||
),
|
||||
]);
|
||||
@@ -536,7 +536,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();
|
||||
});
|
||||
@@ -557,8 +557,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,
|
||||
);
|
||||
|
||||
@@ -575,7 +575,7 @@ class IntercityHomeController extends GetxController {
|
||||
}
|
||||
|
||||
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
||||
ShowToastDialog.showToast("Payment successfully".tr());
|
||||
ShowToastDialog.showToast("Payment successfully".tr);
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
@@ -743,7 +743,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;
|
||||
@@ -1371,7 +1371,7 @@ class IntercityHomeController 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(
|
||||
@@ -1404,7 +1404,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) {
|
||||
@@ -1487,10 +1487,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 {
|
||||
@@ -1522,15 +1522,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -1557,15 +1557,15 @@ 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(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -1607,10 +1607,10 @@ class IntercityHomeController extends GetxController {
|
||||
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 {
|
||||
@@ -1644,11 +1644,11 @@ class IntercityHomeController extends GetxController {
|
||||
);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1776,7 +1776,7 @@ class IntercityHomeController 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,
|
||||
);
|
||||
}
|
||||
return GetPaymentTxtTokenModel.fromJson(data);
|
||||
@@ -1813,18 +1813,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) {
|
||||
@@ -1842,10 +1842,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1886,7 +1886,7 @@ class IntercityHomeController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1929,13 +1929,13 @@ class IntercityHomeController 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1973,7 +1973,7 @@ class IntercityHomeController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -2024,7 +2024,7 @@ class IntercityHomeController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -2050,11 +2050,11 @@ class IntercityHomeController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:customer/models/user_model.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/constant.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/models/advertisement_model.dart';
|
||||
import 'package:customer/models/favourite_model.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AdvertisementListController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/models/brands_model.dart';
|
||||
import 'package:customer/models/product_model.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AllBrandProductController extends GetxController {
|
||||
RxList<ProductModel> productList = <ProductModel>[].obs;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:customer/models/product_model.dart';
|
||||
import 'package:customer/models/vendor_category_model.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AllCategoryProductController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -3,12 +3,12 @@ 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';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart' as latlong;
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
@@ -124,12 +124,12 @@ class BookParcelController extends GetxController {
|
||||
void onCameraClick(BuildContext context) {
|
||||
final action = CupertinoActionSheet(
|
||||
message: Text(
|
||||
'Add your parcel image.'.tr(),
|
||||
'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();
|
||||
@@ -139,7 +139,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(
|
||||
@@ -152,7 +152,7 @@ class BookParcelController extends GetxController {
|
||||
),
|
||||
],
|
||||
cancelButton: CupertinoActionSheetAction(
|
||||
child: Text('Cancel'.tr()),
|
||||
child: Text('Cancel'.tr),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
);
|
||||
@@ -184,39 +184,39 @@ 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(),
|
||||
"Please select both sender and receiver locations".tr,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ 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(),
|
||||
.tr,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -264,7 +264,7 @@ class BookParcelController extends GetxController {
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ 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';
|
||||
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
|
||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:latlong2/latlong.dart' as latlong;
|
||||
@@ -393,7 +393,7 @@ 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(
|
||||
@@ -403,7 +403,7 @@ class CabBookingController extends GetxController {
|
||||
Marker(
|
||||
markerId: const MarkerId("driver"),
|
||||
position: LatLng(driverLat, driverLng),
|
||||
infoWindow: InfoWindow(title: "Driver at Pickup".tr()),
|
||||
infoWindow: InfoWindow(title: "Driver at Pickup".tr),
|
||||
icon: taxiIcon ?? BitmapDescriptor.defaultMarker,
|
||||
),
|
||||
]);
|
||||
@@ -412,7 +412,7 @@ class CabBookingController extends GetxController {
|
||||
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(
|
||||
@@ -422,7 +422,7 @@ class CabBookingController extends GetxController {
|
||||
Marker(
|
||||
markerId: const MarkerId("driver"),
|
||||
position: LatLng(driverLat, driverLng),
|
||||
infoWindow: InfoWindow(title: "Driver Location".tr()),
|
||||
infoWindow: InfoWindow(title: "Driver Location".tr),
|
||||
icon: taxiIcon ?? BitmapDescriptor.defaultMarker,
|
||||
),
|
||||
]);
|
||||
@@ -527,7 +527,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();
|
||||
});
|
||||
@@ -566,7 +566,7 @@ class CabBookingController extends GetxController {
|
||||
}
|
||||
|
||||
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
|
||||
ShowToastDialog.showToast("Payment successfully".tr());
|
||||
ShowToastDialog.showToast("Payment successfully".tr);
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
@@ -699,7 +699,7 @@ class CabBookingController extends GetxController {
|
||||
Marker(
|
||||
markerId: markerId,
|
||||
infoWindow: InfoWindow(
|
||||
title: '${'Stop'.tr()} ${String.fromCharCode(index + 65)}',
|
||||
title: '${'Stop'.tr} ${String.fromCharCode(index + 65)}',
|
||||
),
|
||||
position: LatLng(lat, lng),
|
||||
icon: stopIcon!,
|
||||
@@ -734,7 +734,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;
|
||||
@@ -1362,7 +1362,7 @@ class CabBookingController 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(
|
||||
@@ -1395,7 +1395,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) {
|
||||
@@ -1478,10 +1478,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 {
|
||||
@@ -1513,15 +1513,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -1548,15 +1548,15 @@ 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(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -1598,10 +1598,10 @@ class CabBookingController extends GetxController {
|
||||
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 {
|
||||
@@ -1635,11 +1635,11 @@ class CabBookingController extends GetxController {
|
||||
);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1767,7 +1767,7 @@ class CabBookingController 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,
|
||||
);
|
||||
}
|
||||
return GetPaymentTxtTokenModel.fromJson(data);
|
||||
@@ -1804,18 +1804,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) {
|
||||
@@ -1833,10 +1833,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1877,7 +1877,7 @@ class CabBookingController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1920,13 +1920,13 @@ class CabBookingController 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1964,7 +1964,7 @@ class CabBookingController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -2015,7 +2015,7 @@ class CabBookingController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -2041,11 +2041,11 @@ class CabBookingController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/models/coupon_model.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class CabCouponCodeController extends GetxController {
|
||||
// Add your methods and properties here
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/screen_ui/cab_service_screens/cab_home_screen.dart';
|
||||
import 'package:customer/screen_ui/multi_vendor_service/profile_screen/profile_screen.dart';
|
||||
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../screen_ui/cab_service_screens/my_cab_booking_screen.dart';
|
||||
|
||||
class CabDashboardController extends GetxController {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/models/banner_model.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class CabHomeController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'dart:convert';
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/rating_model.dart';
|
||||
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart' as gmap;
|
||||
import 'package:latlong2/latlong.dart' as osm;
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/screen_ui/multi_vendor_service/profile_screen/profile_s
|
||||
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||
import 'package:customer/screen_ui/rental_service/rental_home_screen.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../screen_ui/rental_service/my_rental_booking_screen.dart';
|
||||
|
||||
class CabRentalDashboardControllers extends GetxController {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/collection_name.dart';
|
||||
import '../models/rating_model.dart';
|
||||
import '../models/user_model.dart';
|
||||
@@ -73,11 +73,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 ?? '',
|
||||
|
||||
@@ -13,11 +13,11 @@ 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';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:razorpay_flutter/razorpay_flutter.dart';
|
||||
@@ -416,7 +416,7 @@ class CartController extends GetxController {
|
||||
setOrder();
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"You don't have sufficient wallet balance to place order".tr(),
|
||||
"You don't have sufficient wallet balance to place order".tr,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -425,7 +425,7 @@ 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) &&
|
||||
@@ -438,7 +438,7 @@ class CartController extends GetxController {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast(
|
||||
"This vendor has reached their maximum order capacity. Please select a different vendor or try again later."
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -508,8 +508,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((
|
||||
@@ -712,7 +712,7 @@ class CartController 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(
|
||||
@@ -745,7 +745,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) {
|
||||
@@ -828,10 +828,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 {
|
||||
@@ -863,15 +863,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -898,15 +898,15 @@ 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(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -948,10 +948,10 @@ class CartController extends GetxController {
|
||||
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 {
|
||||
@@ -985,11 +985,11 @@ class CartController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1134,7 +1134,7 @@ class CartController 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,
|
||||
);
|
||||
}
|
||||
return GetPaymentTxtTokenModel.fromJson(data);
|
||||
@@ -1170,18 +1170,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) {
|
||||
@@ -1199,10 +1199,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1243,7 +1243,7 @@ class CartController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1286,13 +1286,13 @@ class CartController 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1330,7 +1330,7 @@ class CartController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1381,7 +1381,7 @@ class CartController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1407,11 +1407,11 @@ class CartController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import '../models/cashback_model.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
class CashbackController extends GetxController {
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/models/vendor_model.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import '../models/vendor_category_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class CategoryRestaurantController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/language_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/collection_name.dart';
|
||||
|
||||
class ChangeLanguageController extends GetxController {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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';
|
||||
import '../models/inbox_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import '../service/send_notification.dart';
|
||||
@@ -104,11 +104,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,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");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/cab_order_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import '../themes/show_toast_dialog.dart';
|
||||
@@ -22,7 +21,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();
|
||||
}
|
||||
}
|
||||
@@ -38,7 +37,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;
|
||||
}
|
||||
@@ -47,12 +46,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;
|
||||
}
|
||||
|
||||
@@ -82,16 +81,16 @@ class ComplainController extends GetxController {
|
||||
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast(
|
||||
"Your complaint has been submitted to admin".tr(),
|
||||
"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;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import '../screen_ui/multi_vendor_service/order_list_screen/order_screen.dart';
|
||||
import '../screen_ui/multi_vendor_service/profile_screen/profile_screen.dart';
|
||||
import '../screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DashBoardController extends GetxController {
|
||||
RxInt selectedIndex = 0.obs;
|
||||
|
||||
@@ -5,7 +5,7 @@ import '../screen_ui/multi_vendor_service/order_list_screen/order_screen.dart';
|
||||
import '../screen_ui/multi_vendor_service/profile_screen/profile_screen.dart';
|
||||
import '../screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DashBoardEcommerceController extends GetxController {
|
||||
RxInt selectedIndex = 0.obs;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import '../models/dine_in_booking_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DineInBookingController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:customer/models/dine_in_booking_model.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DineInBookingDetailsController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import '../models/banner_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DineInController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -4,11 +4,11 @@ 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';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../service/send_notification.dart';
|
||||
@@ -37,9 +37,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;
|
||||
}
|
||||
@@ -65,7 +65,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(
|
||||
@@ -118,7 +118,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() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/models/coupon_model.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DiscountRestaurantListController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
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';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '../themes/show_toast_dialog.dart';
|
||||
@@ -48,7 +48,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(
|
||||
@@ -78,7 +78,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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/user_model.dart';
|
||||
|
||||
class EnterManuallyLocationController extends GetxController {
|
||||
@@ -76,13 +76,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;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:customer/models/favourite_model.dart';
|
||||
import 'package:customer/models/product_model.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class FavouriteController extends GetxController {
|
||||
RxBool favouriteRestaurant = true.obs;
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:customer/models/favorite_ondemand_service_model.dart';
|
||||
import 'package:customer/models/provider_serivce_model.dart';
|
||||
import 'package:customer/screen_ui/auth_screens/login_screen.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class FavouriteOndemmandController extends GetxController {
|
||||
// Add your controller logic here
|
||||
|
||||
@@ -9,9 +9,9 @@ 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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import '../models/banner_model.dart';
|
||||
import '../models/story_model.dart';
|
||||
@@ -33,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;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../themes/show_toast_dialog.dart';
|
||||
|
||||
class ForgotPasswordController extends GetxController {
|
||||
@@ -12,32 +11,29 @@ 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(
|
||||
'reset_password_link_sent'.tr(namedArgs: {'email': email})
|
||||
|
||||
'reset_password_link_sent'.trParams({'email': email}),
|
||||
);
|
||||
Get.back();
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +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';
|
||||
@@ -42,7 +42,7 @@ import '../screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
@@ -99,7 +99,7 @@ class GiftCardController extends GetxController {
|
||||
setOrder();
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"You don't have sufficient wallet balance to purchase gift card".tr(),
|
||||
"You don't have sufficient wallet balance to purchase gift card".tr,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -108,7 +108,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();
|
||||
@@ -136,8 +136,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((
|
||||
@@ -154,7 +154,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() {
|
||||
@@ -371,7 +371,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) {
|
||||
@@ -454,10 +454,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 {
|
||||
@@ -486,15 +486,15 @@ 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(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -536,10 +536,10 @@ class GiftCardController extends GetxController {
|
||||
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 {
|
||||
@@ -573,11 +573,11 @@ class GiftCardController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -605,15 +605,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -759,7 +759,7 @@ class GiftCardController 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,
|
||||
);
|
||||
}
|
||||
return GetPaymentTxtTokenModel.fromJson(data);
|
||||
@@ -796,18 +796,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
|
||||
@@ -820,10 +820,10 @@ class GiftCardController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -864,7 +864,7 @@ class GiftCardController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -907,13 +907,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -951,7 +951,7 @@ class GiftCardController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1002,7 +1002,7 @@ class GiftCardController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1028,11 +1028,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:customer/models/currency_model.dart';
|
||||
import 'package:customer/models/user_model.dart';
|
||||
import 'package:customer/utils/notification_service.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/collection_name.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class HistoryGiftCardController extends GetxController {
|
||||
RxList<GiftCardsOrderModel> giftCardsOrderList = <GiftCardsOrderModel>[].obs;
|
||||
@@ -40,7 +40,7 @@ class HistoryGiftCardController extends GetxController {
|
||||
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",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:customer/models/vendor_model.dart';
|
||||
import 'package:customer/service/cart_provider.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/constant.dart';
|
||||
|
||||
class HomeECommerceController extends GetxController {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/banner_model.dart';
|
||||
import '../models/parcel_category.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:customer/models/order_model.dart';
|
||||
import 'package:customer/models/user_model.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:latlong2/latlong.dart' as location;
|
||||
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'dart:convert';
|
||||
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_sign_in/google_sign_in.dart';
|
||||
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
|
||||
import '../constant/constant.dart';
|
||||
@@ -33,18 +34,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,
|
||||
@@ -69,34 +70,34 @@ class LoginController extends GetxController {
|
||||
|
||||
Constant.selectedLocation = defaultAddress;
|
||||
|
||||
Get.offAll(() => const ServiceListScreen());
|
||||
Get.offAll(ServiceListScreen());
|
||||
} else {
|
||||
Get.offAll(() => const LocationPermissionScreen());
|
||||
Get.offAll(LocationPermissionScreen());
|
||||
}
|
||||
} else {
|
||||
await FirebaseAuth.instance.signOut();
|
||||
ShowToastDialog.showToast(
|
||||
"This user is disabled. Please contact admin.".tr(),
|
||||
"This user is disabled. Please contact admin.".tr,
|
||||
);
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(LoginScreen());
|
||||
}
|
||||
} else {
|
||||
await FirebaseAuth.instance.signOut();
|
||||
ShowToastDialog.showToast(
|
||||
"This user does not exist in the customer app.".tr(),
|
||||
"This user does not exist in the customer app.".tr,
|
||||
);
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(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(),
|
||||
e.message?.tr ?? "Login failed. Please try again.".tr,
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
@@ -106,7 +107,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) {
|
||||
@@ -148,23 +149,23 @@ class LoginController extends GetxController {
|
||||
|
||||
Constant.selectedLocation = defaultAddress;
|
||||
|
||||
Get.offAll(() => const ServiceListScreen());
|
||||
Get.offAll(ServiceListScreen());
|
||||
} else {
|
||||
Get.offAll(() => const LocationPermissionScreen());
|
||||
Get.offAll(LocationPermissionScreen());
|
||||
}
|
||||
} else {
|
||||
await FirebaseAuth.instance.signOut();
|
||||
ShowToastDialog.showToast(
|
||||
"This user is disabled. Please contact admin.".tr(),
|
||||
"This user is disabled. Please contact admin.".tr,
|
||||
);
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(LoginScreen());
|
||||
}
|
||||
} else {
|
||||
await FirebaseAuth.instance.signOut();
|
||||
ShowToastDialog.showToast(
|
||||
"This user does not exist in the customer app.".tr(),
|
||||
"This user does not exist in the customer app.".tr,
|
||||
);
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(LoginScreen());
|
||||
}
|
||||
} else {
|
||||
UserModel userModel = UserModel();
|
||||
@@ -186,7 +187,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) {
|
||||
@@ -231,23 +232,23 @@ class LoginController extends GetxController {
|
||||
);
|
||||
|
||||
Constant.selectedLocation = defaultAddress;
|
||||
Get.offAll(() => const ServiceListScreen());
|
||||
Get.offAll(ServiceListScreen());
|
||||
} else {
|
||||
Get.offAll(() => const LocationPermissionScreen());
|
||||
Get.offAll(LocationPermissionScreen());
|
||||
}
|
||||
} else {
|
||||
await FirebaseAuth.instance.signOut();
|
||||
ShowToastDialog.showToast(
|
||||
"This user is disabled. Please contact admin.".tr(),
|
||||
"This user is disabled. Please contact admin.".tr,
|
||||
);
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(LoginScreen());
|
||||
}
|
||||
} else {
|
||||
await FirebaseAuth.instance.signOut();
|
||||
ShowToastDialog.showToast(
|
||||
"This user does not exist in the customer app.".tr(),
|
||||
"This user does not exist in the customer app.".tr,
|
||||
);
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(LoginScreen());
|
||||
}
|
||||
} else {
|
||||
// User not in DB → go to signup
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'dart:typed_data';
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:latlong2/latlong.dart' as location;
|
||||
import '../screen_ui/multi_vendor_service/restaurant_details_screen/restaurant_details_screen.dart';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/constant.dart';
|
||||
import '../screen_ui/auth_screens/otp_verification_screen.dart';
|
||||
|
||||
@@ -21,13 +21,13 @@ class MobileLoginController extends GetxController {
|
||||
|
||||
if (mobile.isEmpty || mobile.length != 10) {
|
||||
ShowToastDialog.showToast(
|
||||
"Please enter a valid 10-digit mobile number".tr(),
|
||||
"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',
|
||||
@@ -37,10 +37,10 @@ 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(),
|
||||
e.message ?? "OTP verification failed".tr,
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -57,13 +57,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/onprovider_order_model.dart';
|
||||
import '../models/worker_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
@@ -34,12 +34,12 @@ 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';
|
||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:razorpay_flutter/razorpay_flutter.dart';
|
||||
@@ -139,13 +139,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;
|
||||
}
|
||||
@@ -219,7 +219,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 {
|
||||
@@ -237,8 +237,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,
|
||||
);
|
||||
|
||||
@@ -253,7 +253,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();
|
||||
});
|
||||
}
|
||||
@@ -348,7 +348,7 @@ class MyCabBookingController 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(
|
||||
@@ -381,7 +381,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) {
|
||||
@@ -464,10 +464,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 {
|
||||
@@ -499,15 +499,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -534,15 +534,15 @@ 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(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -585,10 +585,10 @@ class MyCabBookingController extends GetxController {
|
||||
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 {
|
||||
@@ -622,11 +622,11 @@ class MyCabBookingController extends GetxController {
|
||||
);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -754,7 +754,7 @@ class MyCabBookingController 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,
|
||||
);
|
||||
}
|
||||
return GetPaymentTxtTokenModel.fromJson(data);
|
||||
@@ -791,18 +791,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) {
|
||||
@@ -820,10 +820,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -864,7 +864,7 @@ class MyCabBookingController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -907,13 +907,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -951,7 +951,7 @@ class MyCabBookingController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1002,7 +1002,7 @@ class MyCabBookingController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1028,11 +1028,11 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/controllers/theme_controller.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class MyProfileController extends GetxController {
|
||||
|
||||
@@ -4,8 +4,8 @@ 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' hide Trans;
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import '../models/rental_order_model.dart';
|
||||
import '../models/tax_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
@@ -157,7 +157,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();
|
||||
});
|
||||
@@ -174,8 +174,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,
|
||||
);
|
||||
|
||||
@@ -192,7 +192,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();
|
||||
});
|
||||
@@ -290,8 +290,8 @@ 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,
|
||||
);
|
||||
|
||||
@@ -301,9 +301,9 @@ class MyRentalBookingController extends GetxController {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/on_boarding_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@ 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:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../models/onprovider_order_model.dart';
|
||||
import '../models/provider_serivce_model.dart';
|
||||
@@ -149,9 +150,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!,
|
||||
@@ -201,7 +202,7 @@ class OnDemandBookingController extends GetxController {
|
||||
},
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
OnProviderOrderModel onDemandOrder = OnProviderOrderModel(
|
||||
otp: Constant.getReferralCode(),
|
||||
authorID: FireStoreUtils.getCurrentUid(),
|
||||
@@ -254,7 +255,7 @@ class OnDemandBookingController extends GetxController {
|
||||
OnDemandDashboardController(),
|
||||
);
|
||||
controller.selectedIndex.value = 2;
|
||||
ShowToastDialog.showToast("OnDemand Service successfully booked".tr());
|
||||
ShowToastDialog.showToast("OnDemand Service successfully booked".tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/category_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/screen_ui/multi_vendor_service/profile_screen/profile_s
|
||||
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||
import 'package:customer/screen_ui/on_demand_service/favourite_ondemand_screen.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../screen_ui/on_demand_service/my_booking_on_demand_screen.dart';
|
||||
import '../screen_ui/on_demand_service/on_demand_home_screen.dart';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/user_model.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../models/favorite_ondemand_service_model.dart';
|
||||
import '../models/provider_serivce_model.dart';
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:customer/models/favorite_ondemand_service_model.dart';
|
||||
import 'package:customer/models/provider_serivce_model.dart';
|
||||
import 'package:customer/screen_ui/auth_screens/login_screen.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import '../constant/constant.dart';
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ 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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/constant.dart';
|
||||
import '../models/onprovider_order_model.dart';
|
||||
import '../models/wallet_transaction_model.dart';
|
||||
@@ -172,7 +172,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;
|
||||
@@ -222,7 +222,7 @@ class OnDemandOrderDetailsController extends GetxController {
|
||||
isTopup: true,
|
||||
orderId: order.id,
|
||||
note: 'Booking Amount Refund',
|
||||
paymentStatus: "success".tr(),
|
||||
paymentStatus: "success".tr,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -240,7 +240,7 @@ class OnDemandOrderDetailsController extends GetxController {
|
||||
isTopup: false,
|
||||
orderId: order.id,
|
||||
note: 'Booking Amount Refund',
|
||||
paymentStatus: "success".tr(),
|
||||
paymentStatus: "success".tr,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -260,7 +260,7 @@ class OnDemandOrderDetailsController extends GetxController {
|
||||
isTopup: true,
|
||||
orderId: order.id,
|
||||
note: 'Admin commission refund',
|
||||
paymentStatus: "success".tr(),
|
||||
paymentStatus: "success".tr,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -289,11 +289,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/collection_name.dart';
|
||||
import '../models/onprovider_order_model.dart';
|
||||
import '../models/provider_serivce_model.dart';
|
||||
@@ -133,7 +133,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;
|
||||
@@ -171,7 +171,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;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/models/cart_product_model.dart';
|
||||
import 'package:customer/models/order_model.dart';
|
||||
import '../service/cart_provider.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class OrderController extends GetxController {
|
||||
RxList<OrderModel> allList = <OrderModel>[].obs;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/cart_product_model.dart';
|
||||
import 'package:customer/models/order_model.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../service/cart_provider.dart';
|
||||
|
||||
class OrderDetailsController extends GetxController {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'package:customer/models/order_model.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../service/database_helper.dart';
|
||||
|
||||
class OrderPlacingController extends GetxController {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:developer';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_osm_plugin/flutter_osm_plugin.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class OsmSearchPlaceController extends GetxController {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
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:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/constant.dart';
|
||||
import '../models/user_model.dart';
|
||||
import '../screen_ui/auth_screens/login_screen.dart';
|
||||
@@ -43,7 +44,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,
|
||||
@@ -56,12 +57,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,
|
||||
@@ -107,14 +108,14 @@ class OtpVerifyController extends GetxController {
|
||||
final userModel = await FireStoreUtils.getUserProfile(result.user!.uid);
|
||||
if (userModel == null || userModel.role != 'customer') {
|
||||
await _auth.signOut();
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(LoginScreen());
|
||||
return;
|
||||
}
|
||||
|
||||
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());
|
||||
Get.offAll(LoginScreen());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -128,13 +129,13 @@ class OtpVerifyController extends GetxController {
|
||||
);
|
||||
Constant.selectedLocation = defaultAddress;
|
||||
|
||||
Get.offAll(() => const ServiceListScreen());
|
||||
Get.offAll(ServiceListScreen());
|
||||
} else {
|
||||
Get.offAll(() => const LocationPermissionScreen());
|
||||
Get.offAll(LocationPermissionScreen());
|
||||
}
|
||||
} catch (e) {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Invalid OTP or Verification Failed".tr());
|
||||
ShowToastDialog.showToast("Invalid OTP or Verification Failed".tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/models/coupon_model.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ParcelCouponController extends GetxController {
|
||||
@override
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/screen_ui/multi_vendor_service/profile_screen/profile_s
|
||||
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||
import 'package:customer/screen_ui/parcel_service/home_parcel_screen.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../screen_ui/parcel_service/my_booking_screen.dart';
|
||||
|
||||
class ParcelDashboardController extends GetxController {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../constant/constant.dart';
|
||||
import '../models/parcel_order_model.dart';
|
||||
@@ -106,7 +106,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;
|
||||
}
|
||||
|
||||
@@ -160,9 +160,9 @@ class ParcelMyBookingController extends GetxController {
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ 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';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@@ -136,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 = [];
|
||||
@@ -207,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},
|
||||
@@ -216,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,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(
|
||||
@@ -357,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) {
|
||||
@@ -440,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 {
|
||||
@@ -480,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -521,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);
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
@@ -559,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,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -614,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();
|
||||
}
|
||||
});
|
||||
@@ -676,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -833,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,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -866,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);
|
||||
// }
|
||||
@@ -902,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) {
|
||||
@@ -931,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -975,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 '';
|
||||
}
|
||||
@@ -1002,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,
|
||||
@@ -1027,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();
|
||||
}
|
||||
}
|
||||
@@ -1086,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 '';
|
||||
}
|
||||
@@ -1152,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 '';
|
||||
}
|
||||
@@ -1179,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ 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' hide Trans;
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../constant/constant.dart';
|
||||
import '../models/parcel_category.dart';
|
||||
@@ -108,7 +108,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(
|
||||
@@ -137,7 +137,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/rating_model.dart';
|
||||
import '../models/user_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
@@ -76,11 +76,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 ?? '',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:customer/controllers/on_demand_home_controller.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/provider_serivce_model.dart';
|
||||
import '../models/user_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
@@ -6,13 +6,13 @@ 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';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import '../themes/show_toast_dialog.dart';
|
||||
|
||||
@@ -142,7 +142,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;
|
||||
@@ -213,10 +213,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class RedeemGiftCardController extends GetxController {
|
||||
Rx<TextEditingController> giftCodeController = TextEditingController().obs;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/models/referral_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ReferFriendController extends GetxController {
|
||||
Rx<ReferralModel> referralModel = ReferralModel().obs;
|
||||
|
||||
@@ -5,9 +5,10 @@ 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:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../screen_ui/rental_service/rental_dashboard_screen.dart';
|
||||
import 'cab_rental_dashboard_controllers.dart';
|
||||
|
||||
@@ -81,7 +82,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;
|
||||
@@ -92,8 +93,8 @@ class RentalConformationController extends GetxController {
|
||||
value,
|
||||
) async {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Order placed successfully".tr());
|
||||
Get.offAll(const RentalDashboardScreen());
|
||||
ShowToastDialog.showToast("Order placed successfully".tr);
|
||||
Get.offAll(RentalDashboardScreen());
|
||||
CabRentalDashboardControllers controller = Get.put(
|
||||
CabRentalDashboardControllers(),
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/models/coupon_model.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class RentalCouponController extends GetxController {
|
||||
@override
|
||||
|
||||
@@ -7,10 +7,10 @@ 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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart' as latlong;
|
||||
import '../constant/constant.dart';
|
||||
import '../models/payment_model/cod_setting_model.dart';
|
||||
@@ -92,7 +92,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ 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';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:razorpay_flutter/razorpay_flutter.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
@@ -210,7 +210,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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,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();
|
||||
});
|
||||
@@ -253,7 +253,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();
|
||||
});
|
||||
@@ -311,10 +311,10 @@ class RentalOrderDetailsController extends GetxController {
|
||||
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;
|
||||
}
|
||||
@@ -424,7 +424,7 @@ class RentalOrderDetailsController 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(
|
||||
@@ -457,7 +457,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) {
|
||||
@@ -540,10 +540,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 {
|
||||
@@ -575,15 +575,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -610,15 +610,15 @@ 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(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -661,10 +661,10 @@ class RentalOrderDetailsController extends GetxController {
|
||||
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 {
|
||||
@@ -698,11 +698,11 @@ class RentalOrderDetailsController extends GetxController {
|
||||
);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -830,7 +830,7 @@ class RentalOrderDetailsController 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,
|
||||
);
|
||||
}
|
||||
return GetPaymentTxtTokenModel.fromJson(data);
|
||||
@@ -867,18 +867,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) {
|
||||
@@ -896,10 +896,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -940,7 +940,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -983,13 +983,13 @@ class RentalOrderDetailsController 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1027,7 +1027,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1078,7 +1078,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1103,10 +1103,10 @@ class RentalOrderDetailsController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../constant/collection_name.dart';
|
||||
import '../models/rating_model.dart';
|
||||
import '../models/rental_order_model.dart';
|
||||
@@ -77,11 +77,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 ?? '',
|
||||
|
||||
@@ -13,7 +13,7 @@ import '../models/attributes_model.dart';
|
||||
import '../service/cart_provider.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class RestaurantDetailsController extends GetxController {
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/favourite_model.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class RestaurantListController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:customer/models/rating_model.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ReviewListController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ScanQrCodeController extends GetxController {
|
||||
@override
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/product_model.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class SearchScreenController extends GetxController {
|
||||
@override
|
||||
|
||||
@@ -12,11 +12,12 @@ 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:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:firebase_auth/firebase_auth.dart' as auth;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../screen_ui/auth_screens/login_screen.dart';
|
||||
import '../screen_ui/multi_vendor_service/dash_board_screens/dash_board_screen.dart';
|
||||
import '../screen_ui/on_demand_service/on_demand_dashboard_screen.dart';
|
||||
@@ -76,7 +77,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") ?? '') ??
|
||||
@@ -92,7 +93,7 @@ class ServiceListController extends GetxController {
|
||||
await _navigate(sectionModel);
|
||||
} else {
|
||||
ShowToastDialog.closeLoader();
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(LoginScreen());
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.closeLoader();
|
||||
@@ -161,7 +162,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),
|
||||
@@ -171,7 +172,7 @@ class ServiceListController extends GetxController {
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
height: 5.5,
|
||||
title: "Cancel".tr(),
|
||||
title: "Cancel".tr,
|
||||
onPress: () {
|
||||
Get.back();
|
||||
},
|
||||
@@ -183,7 +184,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();
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
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:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart' as auth;
|
||||
import '../constant/constant.dart';
|
||||
import '../models/referral_model.dart';
|
||||
@@ -68,7 +69,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();
|
||||
@@ -80,32 +81,32 @@ 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(),
|
||||
"Password and Confirm password do not match".tr,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@@ -132,18 +133,18 @@ class SignUpController extends GetxController {
|
||||
"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()}",
|
||||
"${'something_went_wrong'.tr}: ${e.toString()}",
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -161,7 +162,7 @@ class SignUpController extends GetxController {
|
||||
|
||||
_navigateBasedOnAddress(userModel.value);
|
||||
} catch (e) {
|
||||
ShowToastDialog.showToast("${'signup_failed'.tr()}: $e");
|
||||
ShowToastDialog.showToast("${'signup_failed'.tr}: $e");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,9 +213,9 @@ class SignUpController extends GetxController {
|
||||
/// Save the default address to global constant
|
||||
Constant.selectedLocation = defaultAddress;
|
||||
|
||||
Get.offAll(() => const ServiceListScreen());
|
||||
Get.offAll(ServiceListScreen());
|
||||
} else {
|
||||
Get.offAll(() => const LocationPermissionScreen());
|
||||
Get.offAll(LocationPermissionScreen());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@ import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/user_model.dart';
|
||||
import 'package:customer/screen_ui/maintenance_mode_screen/maintenance_mode_screen.dart';
|
||||
import 'package:customer/screen_ui/service_home_screen/service_list_screen.dart';
|
||||
import 'package:customer/utils/app_router.dart';
|
||||
import 'package:customer/utils/notification_service.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../screen_ui/auth_screens/login_screen.dart';
|
||||
import '../screen_ui/location_enable_screens/location_permission_screen.dart';
|
||||
import '../screen_ui/on_boarding_screen/on_boarding_screen.dart';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../utils/preferences.dart';
|
||||
|
||||
class ThemeController extends GetxController {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/vendor_category_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ViewAllCategoryController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/controllers/on_demand_home_controller.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../models/favorite_ondemand_service_model.dart';
|
||||
import '../models/provider_serivce_model.dart';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/controllers/on_demand_home_controller.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../models/provider_serivce_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
|
||||
@@ -17,7 +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';
|
||||
@@ -34,7 +34,7 @@ import '../payment/xenditScreen.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
@@ -160,7 +160,7 @@ class WalletController extends GetxController {
|
||||
}
|
||||
});
|
||||
|
||||
ShowToastDialog.showToast("Amount Top-up successfully".tr());
|
||||
ShowToastDialog.showToast("Amount Top-up successfully".tr);
|
||||
}
|
||||
|
||||
// Strip
|
||||
@@ -174,7 +174,7 @@ class WalletController 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(
|
||||
@@ -207,7 +207,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) {
|
||||
@@ -290,15 +290,15 @@ 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(),
|
||||
"Something want wrong please contact administrator".tr,
|
||||
);
|
||||
print('Error creating preference: ${response.body}');
|
||||
return null;
|
||||
@@ -327,15 +327,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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -362,15 +362,15 @@ 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(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -412,10 +412,10 @@ class WalletController extends GetxController {
|
||||
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 {
|
||||
@@ -449,11 +449,11 @@ class WalletController extends GetxController {
|
||||
);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -488,18 +488,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
|
||||
@@ -512,10 +512,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -556,7 +556,7 @@ class WalletController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -599,12 +599,12 @@ class WalletController extends GetxController {
|
||||
),
|
||||
)!.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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ class WalletController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -692,7 +692,7 @@ class WalletController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -718,10 +718,10 @@ class WalletController extends GetxController {
|
||||
),
|
||||
)!.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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,11 +4,10 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/easy_loading_config.dart';
|
||||
import 'package:customer/utils/app_router.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';
|
||||
import 'package:flutter_phoenix/flutter_phoenix.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'controllers/global_setting_controller.dart';
|
||||
@@ -17,7 +16,7 @@ import 'firebase_options.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await EasyLocalization.ensureInitialized();
|
||||
await LocalizationService.init();
|
||||
await Firebase.initializeApp(
|
||||
name: 'default',
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
@@ -28,19 +27,7 @@ void main() async {
|
||||
Get.put(ThemeController());
|
||||
await configEasyLoading();
|
||||
|
||||
runApp(
|
||||
EasyLocalization(
|
||||
startLocale: Locale('uz', 'UZ'),
|
||||
supportedLocales: [
|
||||
Locale('en', 'US'),
|
||||
Locale('uz', 'UZ'),
|
||||
Locale('ru', 'RU'),
|
||||
],
|
||||
path: 'assets/translations',
|
||||
fallbackLocale: Locale('uz', 'UZ'),
|
||||
child: MyApp(),
|
||||
),
|
||||
);
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@@ -56,11 +43,12 @@ class MyApp extends StatelessWidget {
|
||||
designSize: Size(375, 812),
|
||||
minTextAdapt: true,
|
||||
splitScreenMode: true,
|
||||
child: MaterialApp(
|
||||
child: GetMaterialApp(
|
||||
translations: LocalizationService(),
|
||||
locale: const Locale('uz', 'UZ'),
|
||||
navigatorKey: AppRouter.navigatorKey,
|
||||
localizationsDelegates: context.localizationDelegates,
|
||||
supportedLocales: context.supportedLocales,
|
||||
locale: context.locale,
|
||||
fallbackLocale: const Locale('uz', 'UZ'),
|
||||
supportedLocales: LocalizationService.supportedLocales,
|
||||
debugShowCheckedModeBanner: false,
|
||||
builder: (context, child) {
|
||||
return SafeArea(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class MercadoPagoScreen extends StatefulWidget {
|
||||
@@ -65,7 +65,7 @@ class _MercadoPagoScreenState extends State<MercadoPagoScreen> {
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Payment".tr()),
|
||||
title: Text("Payment".tr),
|
||||
centerTitle: false,
|
||||
leading: GestureDetector(
|
||||
onTap: () {
|
||||
@@ -85,12 +85,12 @@ 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(),
|
||||
'Cancel'.tr,
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -100,7 +100,7 @@ class _MercadoPagoScreenState extends State<MercadoPagoScreen> {
|
||||
),
|
||||
TextButton(
|
||||
child: Text(
|
||||
'Continue'.tr(),
|
||||
'Continue'.tr,
|
||||
style: const TextStyle(color: Colors.green),
|
||||
),
|
||||
onPressed: () {
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class PayFastScreen extends StatefulWidget {
|
||||
@@ -91,10 +91,10 @@ 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);
|
||||
@@ -102,7 +102,7 @@ class _PayFastScreenState extends State<PayFastScreen> {
|
||||
),
|
||||
TextButton(
|
||||
child: Text(
|
||||
'Continue Payment'.tr(),
|
||||
'Continue Payment'.tr,
|
||||
style: TextStyle(color: Colors.green),
|
||||
),
|
||||
onPressed: () {
|
||||
|
||||
@@ -2,9 +2,8 @@ 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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class MidtransScreen extends StatefulWidget {
|
||||
@@ -104,12 +103,12 @@ 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(),
|
||||
'Cancel'.tr,
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -119,7 +118,7 @@ class _MidtransScreenState extends State<MidtransScreen> {
|
||||
),
|
||||
TextButton(
|
||||
child: Text(
|
||||
'Continue'.tr(),
|
||||
'Continue'.tr,
|
||||
style: const TextStyle(color: Colors.green),
|
||||
),
|
||||
onPressed: () {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
@@ -140,7 +140,7 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
|
||||
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
|
||||
@@ -156,15 +156,15 @@ 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
|
||||
@@ -190,7 +190,7 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
|
||||
// import 'dart:convert';
|
||||
// import 'package:customer/models/payment_model/orange_money.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:get/get.dart' hide Trans;// import 'package:http/http.dart' as http;
|
||||
// import 'package:get/get.dart';// import 'package:http/http.dart' as http;
|
||||
// import 'package:webview_flutter/webview_flutter.dart';
|
||||
//
|
||||
// class OrangeMoneyScreen extends StatefulWidget {
|
||||
@@ -336,14 +336,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: () {
|
||||
@@ -353,7 +353,7 @@ class _OrangeMoneyScreenState extends State<OrangeMoneyScreen> {
|
||||
// ),
|
||||
// TextButton(
|
||||
// child: Text(
|
||||
// 'Continue'.tr(),
|
||||
// 'Continue'.tr,
|
||||
// style: const TextStyle(color: Colors.green),
|
||||
// ),
|
||||
// onPressed: () {
|
||||
|
||||
@@ -2,9 +2,9 @@ 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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class PayStackScreen extends StatefulWidget {
|
||||
@@ -95,7 +95,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: () {
|
||||
|
||||
@@ -3,9 +3,9 @@ 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' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
@@ -127,12 +127,12 @@ 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(),
|
||||
'Cancel'.tr,
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -142,7 +142,7 @@ class _XenditScreenState extends State<XenditScreen> {
|
||||
),
|
||||
TextButton(
|
||||
child: Text(
|
||||
'Continue'.tr(),
|
||||
'Continue'.tr,
|
||||
style: const TextStyle(color: Colors.green),
|
||||
),
|
||||
onPressed: () {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'package:customer/constant/const_texts.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../../controllers/forgot_password_controller.dart';
|
||||
import '../../controllers/theme_controller.dart';
|
||||
import '../../themes/app_them_data.dart';
|
||||
@@ -38,7 +39,7 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
ConstTexts.skip.tr(),
|
||||
ConstTexts.skip.tr,
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
color:
|
||||
isDark
|
||||
@@ -74,7 +75,7 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
ConstTexts.enterYourregisteredEmail.tr(),
|
||||
ConstTexts.enterYourregisteredEmail.tr,
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
@@ -85,14 +86,14 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
TextFieldWidget(
|
||||
title: ConstTexts.emailAddress.tr(),
|
||||
title: ConstTexts.emailAddress.tr,
|
||||
hintText: "abdusalom@gmail.com",
|
||||
controller: controller.emailEditingController.value,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: ConstTexts.sendLink.tr(),
|
||||
title: ConstTexts.sendLink.tr,
|
||||
onPress: controller.forgotPassword,
|
||||
color:
|
||||
isDark
|
||||
@@ -112,7 +113,7 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
child: Center(
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
text: ConstTexts.rememberPassword.tr(),
|
||||
text: ConstTexts.rememberPassword.tr,
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
color:
|
||||
isDark
|
||||
@@ -121,7 +122,7 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: ConstTexts.login.tr(),
|
||||
text: ConstTexts.login.tr,
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
color: AppThemeData.ecommerce300,
|
||||
decoration: TextDecoration.underline,
|
||||
@@ -130,7 +131,7 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
recognizer:
|
||||
TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
Get.offAll(() => const LoginScreen());
|
||||
Get.offAll(LoginScreen());
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -3,7 +3,8 @@ import 'dart:io';
|
||||
import 'package:customer/constant/const_texts.dart';
|
||||
import 'package:customer/screen_ui/auth_screens/sign_up_screen.dart';
|
||||
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@@ -13,7 +14,7 @@ import '../../controllers/theme_controller.dart';
|
||||
import '../../themes/app_them_data.dart';
|
||||
import '../../themes/round_button_fill.dart';
|
||||
import '../../themes/text_field_widget.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'forgot_password_screen.dart';
|
||||
import 'mobile_login_screen.dart';
|
||||
|
||||
@@ -38,7 +39,7 @@ class LoginScreen extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
ConstTexts.skip.tr(),
|
||||
ConstTexts.skip.tr,
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
color:
|
||||
isDark
|
||||
@@ -72,7 +73,7 @@ class LoginScreen extends StatelessWidget {
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
ConstTexts.loginToExplore.tr(),
|
||||
ConstTexts.loginToExplore.tr,
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
@@ -83,15 +84,15 @@ class LoginScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
TextFieldWidget(
|
||||
title: ConstTexts.emailAddress.tr(),
|
||||
title: ConstTexts.emailAddress.tr,
|
||||
hintText: "abdusalom@gmail.com",
|
||||
controller: controller.emailController.value,
|
||||
focusNode: controller.emailFocusNode,
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
TextFieldWidget(
|
||||
title: ConstTexts.password.tr(),
|
||||
hintText: ConstTexts.enterPassword.tr(),
|
||||
title: ConstTexts.password.tr,
|
||||
hintText: ConstTexts.enterPassword.tr,
|
||||
controller: controller.passwordController.value,
|
||||
obscureText: controller.passwordVisible.value,
|
||||
focusNode: controller.passwordFocusNode,
|
||||
@@ -133,7 +134,7 @@ class LoginScreen extends StatelessWidget {
|
||||
() => const ForgotPasswordScreen(),
|
||||
),
|
||||
child: Text(
|
||||
ConstTexts.forgotPassword.tr(),
|
||||
ConstTexts.forgotPassword.tr,
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
color: AppThemeData.info400,
|
||||
),
|
||||
@@ -143,7 +144,7 @@ class LoginScreen extends StatelessWidget {
|
||||
const SizedBox(height: 20),
|
||||
RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: ConstTexts.login.tr(),
|
||||
title: ConstTexts.login.tr,
|
||||
onPress: controller.loginWithEmail,
|
||||
color:
|
||||
isDark
|
||||
@@ -168,7 +169,7 @@ class LoginScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
ConstTexts.orContinueWith.tr(),
|
||||
ConstTexts.orContinueWith.tr,
|
||||
style: AppThemeData.regularTextStyle(
|
||||
color:
|
||||
isDark
|
||||
@@ -192,7 +193,7 @@ class LoginScreen extends StatelessWidget {
|
||||
const SizedBox(height: 25),
|
||||
RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: ConstTexts.mobileNumber.tr(),
|
||||
title: ConstTexts.mobileNumber.tr,
|
||||
onPress:
|
||||
() => Get.to(() => const MobileLoginScreen()),
|
||||
isRight: false,
|
||||
@@ -218,7 +219,7 @@ class LoginScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: ConstTexts.withGoogle.tr(),
|
||||
title: ConstTexts.withGoogle.tr,
|
||||
textColor:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
@@ -242,7 +243,7 @@ class LoginScreen extends StatelessWidget {
|
||||
? Expanded(
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: ConstTexts.withApple.tr(),
|
||||
title: ConstTexts.withApple.tr,
|
||||
isCenter: true,
|
||||
textColor:
|
||||
isDark
|
||||
@@ -273,7 +274,7 @@ class LoginScreen extends StatelessWidget {
|
||||
child: Center(
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
text: "${ConstTexts.dontHaveAccount.tr()} ",
|
||||
text: "${ConstTexts.dontHaveAccount.tr} ",
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
color:
|
||||
isDark
|
||||
@@ -282,7 +283,7 @@ class LoginScreen extends StatelessWidget {
|
||||
),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: ConstTexts.signUp.tr(),
|
||||
text: ConstTexts.signUp.tr,
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
color: AppThemeData.ecommerce300,
|
||||
decoration: TextDecoration.underline,
|
||||
@@ -290,7 +291,7 @@ class LoginScreen extends StatelessWidget {
|
||||
recognizer:
|
||||
TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
Get.offAll(() => const SignUpScreen());
|
||||
Get.offAll(SignUpScreen());
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user