BASE: Imlement Localization In Auth.

This commit is contained in:
2025-12-03 15:25:19 +05:00
parent 2736727592
commit 3e18352abe
24 changed files with 3484 additions and 795 deletions

View File

@@ -1,3 +1,6 @@
import java.util.Properties
import java.io.FileInputStream
plugins { plugins {
id("com.android.application") id("com.android.application")
// START: FlutterFire Configuration // START: FlutterFire Configuration
@@ -8,8 +11,14 @@ plugins {
id("dev.flutter.flutter-gradle-plugin") id("dev.flutter.flutter-gradle-plugin")
} }
val keystoreProperties = Properties()
val keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}
android { android {
namespace = "com.emart.customer" namespace = "felix.fondex.uz"
compileSdk = 36 compileSdk = 36
ndkVersion = flutter.ndkVersion ndkVersion = flutter.ndkVersion
@@ -25,7 +34,7 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.emart.customer" applicationId = "felix.fondex.uz"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config. // For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 26 minSdk = 26
@@ -34,11 +43,20 @@ android {
versionName = flutter.versionName versionName = flutter.versionName
} }
signingConfigs {
create("release") {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
storePassword = keystoreProperties["storePassword"] as String
}
}
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug") signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = false isMinifyEnabled = false
isShrinkResources = false isShrinkResources = false
} }

View File

@@ -10,7 +10,7 @@
"client_info": { "client_info": {
"mobilesdk_app_id": "1:893074789710:android:05002c15a64cf1e0c4ba1f", "mobilesdk_app_id": "1:893074789710:android:05002c15a64cf1e0c4ba1f",
"android_client_info": { "android_client_info": {
"package_name": "com.emart.customer" "package_name": "felix.fondex.uz"
} }
}, },
"oauth_client": [ "oauth_client": [
@@ -35,7 +35,7 @@
"client_id": "893074789710-pv12m4nhe82a4ueg9sb2pgt42r0e5da3.apps.googleusercontent.com", "client_id": "893074789710-pv12m4nhe82a4ueg9sb2pgt42r0e5da3.apps.googleusercontent.com",
"client_type": 2, "client_type": 2,
"ios_info": { "ios_info": {
"bundle_id": "com.emart.customer" "bundle_id": "felix.fondex.uz"
} }
} }
] ]

View File

@@ -10,7 +10,7 @@
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> -->
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
@@ -53,7 +53,7 @@
<!-- Main Activity (Kotlin-based) --> <!-- Main Activity (Kotlin-based) -->
<activity <activity
android:name="com.emart.customer.MainActivity" android:name="felix.fondex.uz.MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:enableOnBackInvokedCallback="true" android:enableOnBackInvokedCallback="true"
android:exported="true" android:exported="true"
@@ -90,7 +90,7 @@
<data <data
android:host="paypalpay" android:host="paypalpay"
android:scheme="com.emart.customer" /> android:scheme="felix.fondex.uz" />
</intent-filter> </intent-filter>
<!-- PayPal cancel redirect --> <!-- PayPal cancel redirect -->
@@ -102,7 +102,7 @@
<data <data
android:host="paypalcancel" android:host="paypalcancel"
android:scheme="com.emart.customer" /> android:scheme="felix.fondex.uz" />
</intent-filter> </intent-filter>

View File

@@ -1,4 +1,4 @@
package com.emart.customer package felix.fondex.uz
import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.android.FlutterFragmentActivity

View File

@@ -0,0 +1,50 @@
{
"loginToExplore" : "Log in to explore your all in one vendor app favourites and shop effortlessly.",
"emailAddress": "Email Address*",
"password": "Password*",
"enterPassword": "Enter password",
"forgotPassword": "Forgot Password",
"login": "Log in",
"orContinueWith": "or continue with",
"withGoogle": "with Google",
"withApple": "with Apple",
"dontHaveAccount": "Didn't have an account?",
"signUp": "Sign up",
"skip": "Skip",
"signUpToExplore": "Sign up to explore all our services and start shopping, riding, and more.",
"firstName": "First Name*",
"lastName": "Last Name*",
"enterMobileNumber": "Enter Mobile number",
"confirmPassword": "Confirm Password*",
"enterConfirmPassword": "Enter confirm password",
"referralCode": "Referral Code",
"enterReferralCode": "Enter referral code",
"alreadyHaveAccount":"Already have an account?",
"enterYourregisteredEmail": "Enter your registered email to receive a reset link.",
"sendLink": "Send Link",
"rememberPassword": "Remember Password?",
"enterOtpSent": "Enter the OTP sent to your mobile",
"resendOTP": "Resend OTP",
"verify": "Verify",
"useYourMobileNumber": "Use your mobile number to Log in easily and securely.",
"sendCode":"Send Code",
"forgotPassword": "Forgot Password",
"login": "Log in",
"emailAddress": "Email Address*",
"password": "Password*",
"enterPassword": "Enter password",
"forgotPassword": "Forgot Password",
"login": "Log in",
"emailAddress": "Email Address*",
"password": "Password*",
"enterPassword": "Enter password",
"forgotPassword": "Forgot Password",
"login": "Log in",
"emailAddress": "Email Address*",
"password": "Password*",
"enterPassword": "Enter password",
"forgotPassword": "Forgot Password",
"login": "Log in"
}

View File

@@ -504,7 +504,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.emart.customer; PRODUCT_BUNDLE_IDENTIFIER = felix.fondex.uz;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@@ -521,7 +521,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.emart.customer.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = felix.fondex.uz.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -539,7 +539,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.emart.customer.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = felix.fondex.uz.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@@ -555,7 +555,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.emart.customer.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = felix.fondex.uzRunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@@ -691,7 +691,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.emart.customer; PRODUCT_BUNDLE_IDENTIFIER = felix.fondex.uz;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -716,7 +716,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.emart.customer; PRODUCT_BUNDLE_IDENTIFIER = felix.fondex.uz;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;

View File

@@ -13,7 +13,7 @@
<key>PLIST_VERSION</key> <key>PLIST_VERSION</key>
<string>1</string> <string>1</string>
<key>BUNDLE_ID</key> <key>BUNDLE_ID</key>
<string>com.emart.customer</string> <string>felix.fondex.uz</string>
<key>PROJECT_ID</key> <key>PROJECT_ID</key>
<string>fondexuzb</string> <string>fondexuzb</string>
<key>STORAGE_BUCKET</key> <key>STORAGE_BUCKET</key>

View File

@@ -0,0 +1,39 @@
class ConstTexts {
static String loginToExplore = "logintoExplore";
static String emailAddress = "emailAddress";
static String password = "password";
static String enterPassword = "enterPassword";
static String forgotPassword = "forgotPassword";
static String login = "login";
static String orContinueWith = "orContinueWith";
static String mobileNumber = "mobileNumber";
static String withGoogle = "withGoogle";
static String withApple = "withApple";
static String dontHaveAccount = "dontHaveAccount";
static String signUp = "signUp";
static String skip = "skip";
static String signUpToExplore = "signUpToExplore";
static String firstName = "firstName";
static String lastName = "lastName";
static String enterMobileNumber = "enterMobileNumber";
static String confirmPassword = "confirmPassword";
static String enterConfirmPassword = "enterConfirmPassword";
static String referralCode = "referralCode";
static String enterReferralCode = "enterReferralCode";
static String alreadyHaveAccount = "alreadyHaveAccount";
static String enterYourregisteredEmail = "enterYourregisteredEmail";
static String sendLink = "sendLink";
static String rememberPassword = "rememberPassword";
static String enterOtpSent = "enterOtpSent";
static String resendOTP = "resendOTP";
static String verify = "verify";
static String useYourMobileNumber = "useYourMobileNumber";
static String sendCode = "sendCode";
static String loginToExplore = "logintoExplore";
static String emailAddress = "emailAddress";
static String password = "password";
static String loginToExplore = "logintoExplore";
static String emailAddress = "emailAddress";
static String password = "password";
}

View File

@@ -96,11 +96,19 @@ class ParcelOrderConfirmationController extends GetxController {
subTotal.value = double.tryParse(parcelOrder.value.subTotal ?? '0') ?? 0.0; subTotal.value = double.tryParse(parcelOrder.value.subTotal ?? '0') ?? 0.0;
if (selectedCouponModel.value.id != null) { if (selectedCouponModel.value.id != null) {
discount.value = Constant.calculateDiscount(amount: subTotal.value.toString(), offerModel: selectedCouponModel.value); discount.value = Constant.calculateDiscount(
amount: subTotal.value.toString(),
offerModel: selectedCouponModel.value,
);
} }
for (var element in Constant.taxList) { for (var element in Constant.taxList) {
taxAmount.value = (taxAmount.value + Constant.calculateTax(amount: (subTotal.value - discount.value).toString(), taxModel: element)); taxAmount.value =
(taxAmount.value +
Constant.calculateTax(
amount: (subTotal.value - discount.value).toString(),
taxModel: element,
));
} }
print("Tax: ${taxAmount.value}"); print("Tax: ${taxAmount.value}");
@@ -133,25 +141,40 @@ class ParcelOrderConfirmationController extends GetxController {
List<String> parcelImages = []; List<String> parcelImages = [];
if (images.isNotEmpty) { if (images.isNotEmpty) {
for (var image in images) { for (var image in images) {
final upload = await FireStoreUtils.uploadChatImageToFireStorage(File(image.path), Get.context!); final upload = await FireStoreUtils.uploadChatImageToFireStorage(
File(image.path),
Get.context!,
);
parcelImages.add(upload.url); parcelImages.add(upload.url);
} }
} }
parcelOrder.value.parcelImages = parcelImages; parcelOrder.value.parcelImages = parcelImages;
parcelOrder.value.discount = discount.value.toString(); parcelOrder.value.discount = discount.value.toString();
parcelOrder.value.discountType = selectedCouponModel.value.discountType.toString(); parcelOrder.value.discountType =
parcelOrder.value.discountLabel = selectedCouponModel.value.code.toString(); selectedCouponModel.value.discountType.toString();
parcelOrder.value.adminCommission = Constant.sectionConstantModel?.adminCommision?.amount?.toString(); parcelOrder.value.discountLabel =
parcelOrder.value.adminCommissionType = Constant.sectionConstantModel?.adminCommision?.commissionType; selectedCouponModel.value.code.toString();
parcelOrder.value.adminCommission =
Constant.sectionConstantModel?.adminCommision?.amount?.toString();
parcelOrder.value.adminCommissionType =
Constant.sectionConstantModel?.adminCommision?.commissionType;
parcelOrder.value.status = Constant.orderPlaced; parcelOrder.value.status = Constant.orderPlaced;
parcelOrder.value.createdAt = Timestamp.now(); parcelOrder.value.createdAt = Timestamp.now();
parcelOrder.value.author = userModel.value; parcelOrder.value.author = userModel.value;
parcelOrder.value.authorID = FireStoreUtils.getCurrentUid(); parcelOrder.value.authorID = FireStoreUtils.getCurrentUid();
parcelOrder.value.paymentMethod = paymentBy.value == "Receiver" ? "cod" : selectedPaymentMethod.value; parcelOrder.value.paymentMethod =
parcelOrder.value.paymentCollectByReceiver = paymentBy.value == "Receiver"; paymentBy.value == "Receiver" ? "cod" : selectedPaymentMethod.value;
parcelOrder.value.senderZoneId = Constant.getZoneId(parcelOrder.value.senderLatLong!.latitude ?? 0.0, parcelOrder.value.senderLatLong!.longitude ?? 0.0); parcelOrder.value.paymentCollectByReceiver =
parcelOrder.value.receiverZoneId = Constant.getZoneId(parcelOrder.value.receiverLatLong!.latitude ?? 0.0, parcelOrder.value.receiverLatLong!.longitude ?? 0.0); paymentBy.value == "Receiver";
parcelOrder.value.senderZoneId = Constant.getZoneId(
parcelOrder.value.senderLatLong!.latitude ?? 0.0,
parcelOrder.value.senderLatLong!.longitude ?? 0.0,
);
parcelOrder.value.receiverZoneId = Constant.getZoneId(
parcelOrder.value.receiverLatLong!.latitude ?? 0.0,
parcelOrder.value.receiverLatLong!.longitude ?? 0.0,
);
if (selectedPaymentMethod.value == PaymentGateway.wallet.name) { if (selectedPaymentMethod.value == PaymentGateway.wallet.name) {
WalletTransactionModel transactionModel = WalletTransactionModel( WalletTransactionModel transactionModel = WalletTransactionModel(
@@ -168,16 +191,26 @@ class ParcelOrderConfirmationController extends GetxController {
serviceType: Constant.parcelServiceType, serviceType: Constant.parcelServiceType,
); );
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async { await FireStoreUtils.setWalletTransaction(transactionModel).then((
value,
) async {
if (value == true) { if (value == true) {
await FireStoreUtils.updateUserWallet(amount: "-${totalAmount.value.toString()}", userId: FireStoreUtils.getCurrentUid()); await FireStoreUtils.updateUserWallet(
amount: "-${totalAmount.value.toString()}",
userId: FireStoreUtils.getCurrentUid(),
);
} }
}); });
} }
await FireStoreUtils.parcelOrderPlace(parcelOrder.value).then((value) async { await FireStoreUtils.parcelOrderPlace(parcelOrder.value).then((
value,
) async {
ShowToastDialog.closeLoader(); ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Order placed successfully".tr); ShowToastDialog.showToast("Order placed successfully".tr);
Get.offAll(() => OrderSuccessfullyPlaced(), arguments: {'parcelOrder': parcelOrder.value}); Get.offAll(
() => OrderSuccessfullyPlaced(),
arguments: {'parcelOrder': parcelOrder.value},
);
await FireStoreUtils.sendParcelBookEmail(orderModel: parcelOrder.value); await FireStoreUtils.sendParcelBookEmail(orderModel: parcelOrder.value);
}); });
} catch (e) { } catch (e) {
@@ -203,19 +236,45 @@ class ParcelOrderConfirmationController extends GetxController {
Future<void> getPaymentSettings() async { Future<void> getPaymentSettings() async {
await FireStoreUtils.getPaymentSettingsData().then((value) { await FireStoreUtils.getPaymentSettingsData().then((value) {
stripeModel.value = StripeModel.fromJson(jsonDecode(Preferences.getString(Preferences.stripeSettings))); stripeModel.value = StripeModel.fromJson(
payPalModel.value = PayPalModel.fromJson(jsonDecode(Preferences.getString(Preferences.paypalSettings))); jsonDecode(Preferences.getString(Preferences.stripeSettings)),
payStackModel.value = PayStackModel.fromJson(jsonDecode(Preferences.getString(Preferences.payStack))); );
mercadoPagoModel.value = MercadoPagoModel.fromJson(jsonDecode(Preferences.getString(Preferences.mercadoPago))); payPalModel.value = PayPalModel.fromJson(
flutterWaveModel.value = FlutterWaveModel.fromJson(jsonDecode(Preferences.getString(Preferences.flutterWave))); jsonDecode(Preferences.getString(Preferences.paypalSettings)),
paytmModel.value = PaytmModel.fromJson(jsonDecode(Preferences.getString(Preferences.paytmSettings))); );
payFastModel.value = PayFastModel.fromJson(jsonDecode(Preferences.getString(Preferences.payFastSettings))); payStackModel.value = PayStackModel.fromJson(
razorPayModel.value = RazorPayModel.fromJson(jsonDecode(Preferences.getString(Preferences.razorpaySettings))); jsonDecode(Preferences.getString(Preferences.payStack)),
midTransModel.value = MidTrans.fromJson(jsonDecode(Preferences.getString(Preferences.midTransSettings))); );
orangeMoneyModel.value = OrangeMoney.fromJson(jsonDecode(Preferences.getString(Preferences.orangeMoneySettings))); mercadoPagoModel.value = MercadoPagoModel.fromJson(
xenditModel.value = Xendit.fromJson(jsonDecode(Preferences.getString(Preferences.xenditSettings))); jsonDecode(Preferences.getString(Preferences.mercadoPago)),
walletSettingModel.value = WalletSettingModel.fromJson(jsonDecode(Preferences.getString(Preferences.walletSettings))); );
cashOnDeliverySettingModel.value = CodSettingModel.fromJson(jsonDecode(Preferences.getString(Preferences.codSettings))); flutterWaveModel.value = FlutterWaveModel.fromJson(
jsonDecode(Preferences.getString(Preferences.flutterWave)),
);
paytmModel.value = PaytmModel.fromJson(
jsonDecode(Preferences.getString(Preferences.paytmSettings)),
);
payFastModel.value = PayFastModel.fromJson(
jsonDecode(Preferences.getString(Preferences.payFastSettings)),
);
razorPayModel.value = RazorPayModel.fromJson(
jsonDecode(Preferences.getString(Preferences.razorpaySettings)),
);
midTransModel.value = MidTrans.fromJson(
jsonDecode(Preferences.getString(Preferences.midTransSettings)),
);
orangeMoneyModel.value = OrangeMoney.fromJson(
jsonDecode(Preferences.getString(Preferences.orangeMoneySettings)),
);
xenditModel.value = Xendit.fromJson(
jsonDecode(Preferences.getString(Preferences.xenditSettings)),
);
walletSettingModel.value = WalletSettingModel.fromJson(
jsonDecode(Preferences.getString(Preferences.walletSettings)),
);
cashOnDeliverySettingModel.value = CodSettingModel.fromJson(
jsonDecode(Preferences.getString(Preferences.codSettings)),
);
if (walletSettingModel.value.isEnabled == true) { if (walletSettingModel.value.isEnabled == true) {
selectedPaymentMethod.value = PaymentGateway.wallet.name; selectedPaymentMethod.value = PaymentGateway.wallet.name;
@@ -257,20 +316,32 @@ class ParcelOrderConfirmationController extends GetxController {
Future<void> stripeMakePayment({required String amount}) async { Future<void> stripeMakePayment({required String amount}) async {
log(double.parse(amount).toStringAsFixed(0)); log(double.parse(amount).toStringAsFixed(0));
try { try {
Map<String, dynamic>? paymentIntentData = await createStripeIntent(amount: amount); Map<String, dynamic>? paymentIntentData = await createStripeIntent(
amount: amount,
);
log("stripe Responce====>$paymentIntentData"); log("stripe Responce====>$paymentIntentData");
if (paymentIntentData!.containsKey("error")) { if (paymentIntentData!.containsKey("error")) {
Get.back(); Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr); ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr,
);
} else { } else {
await Stripe.instance.initPaymentSheet( await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters( paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret: paymentIntentData['client_secret'], paymentIntentClientSecret: paymentIntentData['client_secret'],
allowsDelayedPaymentMethods: false, allowsDelayedPaymentMethods: false,
googlePay: const PaymentSheetGooglePay(merchantCountryCode: 'US', testEnv: true, currencyCode: "USD"), googlePay: const PaymentSheetGooglePay(
merchantCountryCode: 'US',
testEnv: true,
currencyCode: "USD",
),
customFlow: true, customFlow: true,
style: ThemeMode.system, style: ThemeMode.system,
appearance: PaymentSheetAppearance(colors: PaymentSheetAppearanceColors(primary: AppThemeData.primary300)), appearance: PaymentSheetAppearance(
colors: PaymentSheetAppearanceColors(
primary: AppThemeData.primary300,
),
),
merchantDisplayName: 'GoRide', merchantDisplayName: 'GoRide',
), ),
); );
@@ -316,7 +387,10 @@ class ParcelOrderConfirmationController extends GetxController {
var response = await http.post( var response = await http.post(
Uri.parse('https://api.stripe.com/v1/payment_intents'), Uri.parse('https://api.stripe.com/v1/payment_intents'),
body: body, body: body,
headers: {'Authorization': 'Bearer $stripeSecret', 'Content-Type': 'application/x-www-form-urlencoded'}, headers: {
'Authorization': 'Bearer $stripeSecret',
'Content-Type': 'application/x-www-form-urlencoded',
},
); );
return jsonDecode(response.body); return jsonDecode(response.body);
@@ -326,8 +400,14 @@ class ParcelOrderConfirmationController extends GetxController {
} }
//mercadoo //mercadoo
Future<Null> mercadoPagoMakePayment({required BuildContext context, required String amount}) async { Future<Null> mercadoPagoMakePayment({
final headers = {'Authorization': 'Bearer ${mercadoPagoModel.value.accessToken}', 'Content-Type': 'application/json'}; required BuildContext context,
required String amount,
}) async {
final headers = {
'Authorization': 'Bearer ${mercadoPagoModel.value.accessToken}',
'Content-Type': 'application/json',
};
final body = jsonEncode({ final body = jsonEncode({
"items": [ "items": [
@@ -340,12 +420,20 @@ class ParcelOrderConfirmationController extends GetxController {
}, },
], ],
"payer": {"email": Constant.userModel?.email}, "payer": {"email": Constant.userModel?.email},
"back_urls": {"failure": "${Constant.globalUrl}payment/failure", "pending": "${Constant.globalUrl}payment/pending", "success": "${Constant.globalUrl}payment/success"}, "back_urls": {
"failure": "${Constant.globalUrl}payment/failure",
"pending": "${Constant.globalUrl}payment/pending",
"success": "${Constant.globalUrl}payment/success",
},
"auto_return": "approved", "auto_return": "approved",
// Automatically return after payment is approved // Automatically return after payment is approved
}); });
final response = await http.post(Uri.parse("https://api.mercadopago.com/checkout/preferences"), headers: headers, body: body); final response = await http.post(
Uri.parse("https://api.mercadopago.com/checkout/preferences"),
headers: headers,
body: body,
);
if (response.statusCode == 200 || response.statusCode == 201) { if (response.statusCode == 200 || response.statusCode == 201) {
final data = jsonDecode(response.body); final data = jsonDecode(response.body);
@@ -375,8 +463,8 @@ class ParcelOrderConfirmationController extends GetxController {
sandboxMode: payPalModel.value.isLive == true ? false : true, sandboxMode: payPalModel.value.isLive == true ? false : true,
clientId: payPalModel.value.paypalClient ?? '', clientId: payPalModel.value.paypalClient ?? '',
secretKey: payPalModel.value.paypalSecret ?? '', secretKey: payPalModel.value.paypalSecret ?? '',
returnURL: "com.emart.customer://paypalpay", returnURL: "felix.fondex.uz://paypalpay",
cancelURL: "com.emart.customer://paypalcancel", cancelURL: "felix.fondex.uz://paypalcancel",
transactions: [ transactions: [
{ {
@@ -418,8 +506,8 @@ class ParcelOrderConfirmationController extends GetxController {
// secretKey: payPalModel.value.paypalSecret ?? '', // secretKey: payPalModel.value.paypalSecret ?? '',
// returnURL: "https://success.emart.com/return", // returnURL: "https://success.emart.com/return",
// cancelURL: "https://cancel.emart.com/cancel", // cancelURL: "https://cancel.emart.com/cancel",
// // returnURL: "com.emart.customer://paypalpay", // // returnURL: "felix.fondex.uz://paypalpay",
// // cancelURL: "com.emart.customer://paypalpay", // // cancelURL: "felix.fondex.uz://paypalpay",
// transactions: [ // transactions: [
// { // {
// "amount": { // "amount": {
@@ -477,17 +565,25 @@ class ParcelOrderConfirmationController extends GetxController {
} }
}); });
} else { } else {
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr); ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr,
);
} }
}); });
} }
///flutter wave Payment Method ///flutter wave Payment Method
Future<void> flutterWaveInitiatePayment({required BuildContext context, required String amount}) async { Future<void> flutterWaveInitiatePayment({
required BuildContext context,
required String amount,
}) async {
setRef(); // make sure you generate reference setRef(); // make sure you generate reference
final url = Uri.parse('https://api.flutterwave.com/v3/payments'); final url = Uri.parse('https://api.flutterwave.com/v3/payments');
final headers = {'Authorization': 'Bearer ${flutterWaveModel.value.secretKey}', 'Content-Type': 'application/json'}; final headers = {
'Authorization': 'Bearer ${flutterWaveModel.value.secretKey}',
'Content-Type': 'application/json',
};
final body = jsonEncode({ final body = jsonEncode({
"tx_ref": _ref, "tx_ref": _ref,
@@ -495,8 +591,15 @@ class ParcelOrderConfirmationController extends GetxController {
"currency": "NGN", "currency": "NGN",
"redirect_url": "${Constant.globalUrl}payment/success", "redirect_url": "${Constant.globalUrl}payment/success",
"payment_options": "ussd, card, barter, payattitude", "payment_options": "ussd, card, barter, payattitude",
"customer": {"email": Constant.userModel?.email.toString(), "phonenumber": Constant.userModel?.phoneNumber, "name": Constant.userModel?.fullName()}, "customer": {
"customizations": {"title": "Payment for Services", "description": "Payment for XYZ services"}, "email": Constant.userModel?.email.toString(),
"phonenumber": Constant.userModel?.phoneNumber,
"name": Constant.userModel?.fullName(),
},
"customizations": {
"title": "Payment for Services",
"description": "Payment for XYZ services",
},
}); });
final response = await http.post(url, headers: headers, body: body); final response = await http.post(url, headers: headers, body: body);
@@ -504,7 +607,9 @@ class ParcelOrderConfirmationController extends GetxController {
if (response.statusCode == 200) { if (response.statusCode == 200) {
final data = jsonDecode(response.body); final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) async { Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((
value,
) async {
bool isVerified = await verifyFlutterWavePayment(_ref!); bool isVerified = await verifyFlutterWavePayment(_ref!);
if (isVerified) { if (isVerified) {
@@ -522,13 +627,19 @@ class ParcelOrderConfirmationController extends GetxController {
Future<bool> verifyFlutterWavePayment(String txRef) async { Future<bool> verifyFlutterWavePayment(String txRef) async {
try { try {
final url = Uri.parse("https://api.flutterwave.com/v3/transactions/verify_by_reference?tx_ref=$txRef"); final url = Uri.parse(
final headers = {'Authorization': 'Bearer ${flutterWaveModel.value.secretKey}', 'Content-Type': 'application/json'}; "https://api.flutterwave.com/v3/transactions/verify_by_reference?tx_ref=$txRef",
);
final headers = {
'Authorization': 'Bearer ${flutterWaveModel.value.secretKey}',
'Content-Type': 'application/json',
};
final response = await http.get(url, headers: headers); final response = await http.get(url, headers: headers);
if (response.statusCode == 200) { if (response.statusCode == 200) {
final data = jsonDecode(response.body); final data = jsonDecode(response.body);
if (data['status'] == 'success' && data['data']['status'] == 'successful') { if (data['status'] == 'success' &&
data['data']['status'] == 'successful') {
return true; // ✅ Payment confirmed return true; // ✅ Payment confirmed
} }
} }
@@ -554,8 +665,14 @@ class ParcelOrderConfirmationController extends GetxController {
// payFast // payFast
void payFastPayment({required BuildContext context, required String amount}) { void payFastPayment({required BuildContext context, required String amount}) {
PayStackURLGen.getPayHTML(payFastSettingData: payFastModel.value, amount: amount.toString(), userModel: Constant.userModel!).then((String? value) async { PayStackURLGen.getPayHTML(
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value)); payFastSettingData: payFastModel.value,
amount: amount.toString(),
userModel: Constant.userModel!,
).then((String? value) async {
bool isDone = await Get.to(
PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value),
);
if (isDone) { if (isDone) {
Get.back(); Get.back();
ShowToastDialog.showToast("Payment successfully".tr); ShowToastDialog.showToast("Payment successfully".tr);
@@ -576,26 +693,50 @@ class ParcelOrderConfirmationController extends GetxController {
final response = await http.post( final response = await http.post(
Uri.parse(getChecksum), Uri.parse(getChecksum),
headers: {}, headers: {},
body: {"mid": paytmModel.value.paytmMID.toString(), "order_id": orderId, "key_secret": paytmModel.value.pAYTMMERCHANTKEY.toString()}, body: {
"mid": paytmModel.value.paytmMID.toString(),
"order_id": orderId,
"key_secret": paytmModel.value.pAYTMMERCHANTKEY.toString(),
},
); );
final data = jsonDecode(response.body); final data = jsonDecode(response.body);
await verifyCheckSum(checkSum: data["code"], amount: amount, orderId: orderId).then((value) { await verifyCheckSum(
checkSum: data["code"],
amount: amount,
orderId: orderId,
).then((value) {
initiatePayment(amount: amount, orderId: orderId).then((value) { initiatePayment(amount: amount, orderId: orderId).then((value) {
String callback = ""; String callback = "";
if (paytmModel.value.isSandboxEnabled == true) { if (paytmModel.value.isSandboxEnabled == true) {
callback = "${callback}https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=$orderId"; callback =
"${callback}https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=$orderId";
} else { } else {
callback = "${callback}https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=$orderId"; callback =
"${callback}https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=$orderId";
} }
GetPaymentTxtTokenModel result = value; GetPaymentTxtTokenModel result = value;
startTransaction(context, txnTokenBy: result.body.txnToken ?? '', orderId: orderId, amount: amount, callBackURL: callback, isStaging: paytmModel.value.isSandboxEnabled); startTransaction(
context,
txnTokenBy: result.body.txnToken ?? '',
orderId: orderId,
amount: amount,
callBackURL: callback,
isStaging: paytmModel.value.isSandboxEnabled,
);
}); });
}); });
} }
Future<void> startTransaction(context, {required String txnTokenBy, required orderId, required double amount, required callBackURL, required isStaging}) async { Future<void> startTransaction(
context, {
required String txnTokenBy,
required orderId,
required double amount,
required callBackURL,
required isStaging,
}) async {
// try { // try {
// var response = AllInOneSdk.startTransaction( // var response = AllInOneSdk.startTransaction(
// paytmModel.value.paytmMID.toString(), // paytmModel.value.paytmMID.toString(),
@@ -631,28 +772,44 @@ class ParcelOrderConfirmationController extends GetxController {
// } // }
} }
Future verifyCheckSum({required String checkSum, required double amount, required orderId}) async { Future verifyCheckSum({
required String checkSum,
required double amount,
required orderId,
}) async {
String getChecksum = "${Constant.globalUrl}payments/validatechecksum"; String getChecksum = "${Constant.globalUrl}payments/validatechecksum";
final response = await http.post( final response = await http.post(
Uri.parse(getChecksum), Uri.parse(getChecksum),
headers: {}, headers: {},
body: {"mid": paytmModel.value.paytmMID.toString(), "order_id": orderId, "key_secret": paytmModel.value.pAYTMMERCHANTKEY.toString(), "checksum_value": checkSum}, body: {
"mid": paytmModel.value.paytmMID.toString(),
"order_id": orderId,
"key_secret": paytmModel.value.pAYTMMERCHANTKEY.toString(),
"checksum_value": checkSum,
},
); );
final data = jsonDecode(response.body); final data = jsonDecode(response.body);
return data['status']; return data['status'];
} }
Future<GetPaymentTxtTokenModel> initiatePayment({required double amount, required String orderId}) async { Future<GetPaymentTxtTokenModel> initiatePayment({
required double amount,
required String orderId,
}) async {
String initiateURL = "${Constant.globalUrl}payments/initiatepaytmpayment"; String initiateURL = "${Constant.globalUrl}payments/initiatepaytmpayment";
String callback = String callback =
(paytmModel.value.isSandboxEnabled ?? false) ? "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=$orderId" : "https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=$orderId"; (paytmModel.value.isSandboxEnabled ?? false)
? "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=$orderId"
: "https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=$orderId";
print("INITIATE PAYMENT CALL:"); print("INITIATE PAYMENT CALL:");
print("MID: ${paytmModel.value.paytmMID}"); print("MID: ${paytmModel.value.paytmMID}");
print("OrderId: $orderId"); print("OrderId: $orderId");
print("Amount: $amount"); print("Amount: $amount");
print("Env: ${(paytmModel.value.isSandboxEnabled ?? false) ? "STAGING" : "LIVE"}"); print(
"Env: ${(paytmModel.value.isSandboxEnabled ?? false) ? "STAGING" : "LIVE"}",
);
final response = await http.post( final response = await http.post(
Uri.parse(initiateURL), Uri.parse(initiateURL),
@@ -671,9 +828,12 @@ class ParcelOrderConfirmationController extends GetxController {
log("Paytm Initiate Response: ${response.body}"); log("Paytm Initiate Response: ${response.body}");
final data = jsonDecode(response.body); final data = jsonDecode(response.body);
if (data["body"]["txnToken"] == null || data["body"]["txnToken"].toString().isEmpty) { if (data["body"]["txnToken"] == null ||
data["body"]["txnToken"].toString().isEmpty) {
Get.back(); Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr); ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr,
);
} }
return GetPaymentTxtTokenModel.fromJson(data); return GetPaymentTxtTokenModel.fromJson(data);
@@ -723,7 +883,10 @@ class ParcelOrderConfirmationController extends GetxController {
'description': 'wallet Topup', 'description': 'wallet Topup',
'retry': {'enabled': true, 'max_count': 1}, 'retry': {'enabled': true, 'max_count': 1},
'send_sms_hash': true, 'send_sms_hash': true,
'prefill': {'contact': Constant.userModel?.phoneNumber, 'email': Constant.userModel?.email}, 'prefill': {
'contact': Constant.userModel?.phoneNumber,
'email': Constant.userModel?.email,
},
'external': { 'external': {
'wallets': ['paytm'], 'wallets': ['paytm'],
}, },
@@ -758,7 +921,10 @@ class ParcelOrderConfirmationController extends GetxController {
} }
//Midtrans payment //Midtrans payment
Future<void> midtransMakePayment({required String amount, required BuildContext context}) async { Future<void> midtransMakePayment({
required String amount,
required BuildContext context,
}) async {
await createPaymentLink(amount: amount).then((url) { await createPaymentLink(amount: amount).then((url) {
ShowToastDialog.closeLoader(); ShowToastDialog.closeLoader();
if (url != '') { if (url != '') {
@@ -776,15 +942,30 @@ class ParcelOrderConfirmationController extends GetxController {
Future<String> createPaymentLink({required var amount}) async { Future<String> createPaymentLink({required var amount}) async {
var ordersId = const Uuid().v1(); var ordersId = const Uuid().v1();
final url = Uri.parse(midTransModel.value.isSandbox! ? 'https://api.sandbox.midtrans.com/v1/payment-links' : 'https://api.midtrans.com/v1/payment-links'); final url = Uri.parse(
midTransModel.value.isSandbox!
? 'https://api.sandbox.midtrans.com/v1/payment-links'
: 'https://api.midtrans.com/v1/payment-links',
);
final response = await http.post( final response = await http.post(
url, url,
headers: {'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': generateBasicAuthHeader(midTransModel.value.serverKey!)}, headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': generateBasicAuthHeader(
midTransModel.value.serverKey!,
),
},
body: jsonEncode({ body: jsonEncode({
'transaction_details': {'order_id': ordersId, 'gross_amount': double.parse(amount.toString()).toInt()}, 'transaction_details': {
'order_id': ordersId,
'gross_amount': double.parse(amount.toString()).toInt(),
},
'usage_limit': 2, 'usage_limit': 2,
"callbacks": {"finish": "https://www.google.com?merchant_order_id=$ordersId"}, "callbacks": {
"finish": "https://www.google.com?merchant_order_id=$ordersId",
},
}), }),
); );
@@ -792,7 +973,9 @@ class ParcelOrderConfirmationController extends GetxController {
final responseData = jsonDecode(response.body); final responseData = jsonDecode(response.body);
return responseData['payment_url']; return responseData['payment_url'];
} else { } else {
ShowToastDialog.showToast("something went wrong, please contact admin.".tr); ShowToastDialog.showToast(
"something went wrong, please contact admin.".tr,
);
return ''; return '';
} }
} }
@@ -809,7 +992,10 @@ class ParcelOrderConfirmationController extends GetxController {
static String orderId = ''; static String orderId = '';
static String amount = ''; static String amount = '';
Future<void> orangeMakePayment({required String amount, required BuildContext context}) async { Future<void> orangeMakePayment({
required String amount,
required BuildContext context,
}) async {
reset(); reset();
var id = const Uuid().v4(); var id = const Uuid().v4();
debugPrint('🟩 Starting OrangePay Payment...'); debugPrint('🟩 Starting OrangePay Payment...');
@@ -817,14 +1003,28 @@ class ParcelOrderConfirmationController extends GetxController {
ShowToastDialog.showLoader("Initializing payment...".tr); ShowToastDialog.showLoader("Initializing payment...".tr);
var paymentURL = await fetchToken(context: context, orderId: id, amount: amount, currency: 'USD'); var paymentURL = await fetchToken(
context: context,
orderId: id,
amount: amount,
currency: 'USD',
);
ShowToastDialog.closeLoader(); ShowToastDialog.closeLoader();
if (paymentURL.toString().isNotEmpty) { if (paymentURL.toString().isNotEmpty) {
debugPrint('✅ Payment URL fetched successfully: $paymentURL'); debugPrint('✅ Payment URL fetched successfully: $paymentURL');
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))?.then((value) async { Get.to(
() => OrangeMoneyScreen(
initialURl: paymentURL,
accessToken: accessToken,
amount: amount,
orangePay: orangeMoneyModel.value,
orderId: orderId,
payToken: payToken,
),
)?.then((value) async {
if (value == true) { if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr); ShowToastDialog.showToast("Payment Successful!!".tr);
debugPrint('🎉 Payment Successful for Order ID: $orderId'); debugPrint('🎉 Payment Successful for Order ID: $orderId');
@@ -844,16 +1044,27 @@ class ParcelOrderConfirmationController extends GetxController {
} }
} }
Future fetchToken({required String orderId, required String currency, required BuildContext context, required String amount}) async { Future fetchToken({
required String orderId,
required String currency,
required BuildContext context,
required String amount,
}) async {
const String apiUrl = 'https://api.orange.com/oauth/v3/token'; const String apiUrl = 'https://api.orange.com/oauth/v3/token';
final Map<String, String> requestBody = {'grant_type': 'client_credentials'}; final Map<String, String> requestBody = {
'grant_type': 'client_credentials',
};
debugPrint('🔐 Fetching access token from Orange API...'); debugPrint('🔐 Fetching access token from Orange API...');
debugPrint('📡 POST $apiUrl'); debugPrint('📡 POST $apiUrl');
final response = await http.post( final response = await http.post(
Uri.parse(apiUrl), Uri.parse(apiUrl),
headers: {'Authorization': "Basic ${orangeMoneyModel.value.auth!}", 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json'}, headers: {
'Authorization': "Basic ${orangeMoneyModel.value.auth!}",
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
},
body: requestBody, body: requestBody,
); );
@@ -865,19 +1076,34 @@ class ParcelOrderConfirmationController extends GetxController {
accessToken = responseData['access_token']; accessToken = responseData['access_token'];
debugPrint('✅ Access Token Received: $accessToken'); debugPrint('✅ Access Token Received: $accessToken');
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId); return await webpayment(
context: context,
amountData: amount,
currency: currency,
orderIdData: orderId,
);
} else { } else {
debugPrint('❌ Failed to fetch access token.'); debugPrint('❌ Failed to fetch access token.');
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr); ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr,
);
return ''; return '';
} }
} }
Future webpayment({required String orderIdData, required BuildContext context, required String currency, required String amountData}) async { Future webpayment({
required String orderIdData,
required BuildContext context,
required String currency,
required String amountData,
}) async {
orderId = orderIdData; orderId = orderIdData;
amount = amountData; amount = amountData;
String apiUrl = orangeMoneyModel.value.isSandbox == true ? 'https://api.orange.com/orange-money-webpay/dev/v1/webpayment' : 'https://api.orange.com/orange-money-webpay/cm/v1/webpayment'; String apiUrl =
orangeMoneyModel.value.isSandbox == true
? 'https://api.orange.com/orange-money-webpay/dev/v1/webpayment'
: 'https://api.orange.com/orange-money-webpay/cm/v1/webpayment';
// ✅ Ensure amount formatted correctly // ✅ Ensure amount formatted correctly
String formattedAmount = double.parse(amountData).toStringAsFixed(2); String formattedAmount = double.parse(amountData).toStringAsFixed(2);
@@ -900,7 +1126,11 @@ class ParcelOrderConfirmationController extends GetxController {
final response = await http.post( final response = await http.post(
Uri.parse(apiUrl), Uri.parse(apiUrl),
headers: {'Authorization': 'Bearer $accessToken', 'Content-Type': 'application/json', 'Accept': 'application/json'}, headers: {
'Authorization': 'Bearer $accessToken',
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: json.encode(requestBody), body: json.encode(requestBody),
); );
@@ -920,7 +1150,9 @@ class ParcelOrderConfirmationController extends GetxController {
} }
} else { } else {
debugPrint('❌ Payment request failed.'); debugPrint('❌ Payment request failed.');
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr); ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr,
);
return ''; return '';
} }
} }
@@ -938,7 +1170,13 @@ class ParcelOrderConfirmationController extends GetxController {
await createXenditInvoice(amount: amount).then((model) { await createXenditInvoice(amount: amount).then((model) {
ShowToastDialog.closeLoader(); ShowToastDialog.closeLoader();
if (model.id != null) { if (model.id != null) {
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) { Get.to(
() => XenditScreen(
initialURl: model.invoiceUrl ?? '',
transId: model.id ?? '',
apiKey: xenditModel.value.apiKey!.toString(),
),
)!.then((value) {
if (value == true) { if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr); ShowToastDialog.showToast("Payment Successful!!".tr);
placeOrder(); placeOrder();
@@ -955,7 +1193,9 @@ class ParcelOrderConfirmationController extends GetxController {
const url = 'https://api.xendit.co/v2/invoices'; const url = 'https://api.xendit.co/v2/invoices';
var headers = { var headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': generateBasicAuthHeader(xenditModel.value.apiKey!.toString()), 'Authorization': generateBasicAuthHeader(
xenditModel.value.apiKey!.toString(),
),
// 'Cookie': '__cf_bm=yERkrx3xDITyFGiou0bbKY1bi7xEwovHNwxV1vCNbVc-1724155511-1.0.1.1-jekyYQmPCwY6vIJ524K0V6_CEw6O.dAwOmQnHtwmaXO_MfTrdnmZMka0KZvjukQgXu5B.K_6FJm47SGOPeWviQ', // 'Cookie': '__cf_bm=yERkrx3xDITyFGiou0bbKY1bi7xEwovHNwxV1vCNbVc-1724155511-1.0.1.1-jekyYQmPCwY6vIJ524K0V6_CEw6O.dAwOmQnHtwmaXO_MfTrdnmZMka0KZvjukQgXu5B.K_6FJm47SGOPeWviQ',
}; };
@@ -968,7 +1208,11 @@ class ParcelOrderConfirmationController extends GetxController {
}); });
try { try {
final response = await http.post(Uri.parse(url), headers: headers, body: body); final response = await http.post(
Uri.parse(url),
headers: headers,
body: body,
);
if (response.statusCode == 200 || response.statusCode == 201) { if (response.statusCode == 200 || response.statusCode == 201) {
XenditModel model = XenditModel.fromJson(jsonDecode(response.body)); XenditModel model = XenditModel.fromJson(jsonDecode(response.body));

View File

@@ -1,7 +1,8 @@
// File generated by FlutterFire CLI. // File generated by FlutterFire CLI.
// ignore_for_file: type=lint // ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform; import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps. /// Default [FirebaseOptions] for use with your Firebase apps.
/// ///
@@ -64,8 +65,8 @@ class DefaultFirebaseOptions {
projectId: 'fondexuzb', projectId: 'fondexuzb',
databaseURL: 'https://fondexuzb-default-rtdb.firebaseio.com', databaseURL: 'https://fondexuzb-default-rtdb.firebaseio.com',
storageBucket: 'fondexuzb.firebasestorage.app', storageBucket: 'fondexuzb.firebasestorage.app',
iosClientId: '893074789710-pv12m4nhe82a4ueg9sb2pgt42r0e5da3.apps.googleusercontent.com', iosClientId:
iosBundleId: 'com.emart.customer', '893074789710-pv12m4nhe82a4ueg9sb2pgt42r0e5da3.apps.googleusercontent.com',
iosBundleId: 'felix.fondex.uz',
); );
} }

View File

@@ -1,3 +1,5 @@
import 'package:customer/constant/const_texts.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -36,7 +38,7 @@ class ForgotPasswordScreen extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
"Skip".tr, ConstTexts.skip.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: color:
isDark isDark
@@ -72,8 +74,7 @@ class ForgotPasswordScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Enter your registered email to receive a reset link." ConstTexts.enterYourregisteredEmail.tr(),
.tr,
style: AppThemeData.boldTextStyle( style: AppThemeData.boldTextStyle(
fontSize: 24, fontSize: 24,
color: color:
@@ -84,14 +85,14 @@ class ForgotPasswordScreen extends StatelessWidget {
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
TextFieldWidget( TextFieldWidget(
title: "Email Address*".tr, title: ConstTexts.emailAddress.tr(),
hintText: "jerome014@gmail.com", hintText: "abdusalom@gmail.com",
controller: controller.emailEditingController.value, controller: controller.emailEditingController.value,
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
RoundedButtonFill( RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "Send Link".tr, title: ConstTexts.sendLink.tr(),
onPress: controller.forgotPassword, onPress: controller.forgotPassword,
color: color:
isDark isDark
@@ -111,7 +112,7 @@ class ForgotPasswordScreen extends StatelessWidget {
child: Center( child: Center(
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
text: "Remember Password?".tr, text: ConstTexts.rememberPassword.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: color:
isDark isDark
@@ -120,7 +121,7 @@ class ForgotPasswordScreen extends StatelessWidget {
), ),
children: [ children: [
TextSpan( TextSpan(
text: "Log in".tr, text: ConstTexts.login.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: AppThemeData.ecommerce300, color: AppThemeData.ecommerce300,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,

View File

@@ -1,7 +1,9 @@
import 'dart:io'; 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/auth_screens/sign_up_screen.dart';
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart'; import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -36,7 +38,7 @@ class LoginScreen extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Text( Text(
"Skip".tr, ConstTexts.skip.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: color:
isDark isDark
@@ -70,8 +72,8 @@ class LoginScreen extends StatelessWidget {
children: [ children: [
const SizedBox(height: 20), const SizedBox(height: 20),
Text( Text(
"Log in to explore your all in one vendor app favourites and shop effortlessly." ConstTexts.loginToExplore.tr()
.tr, ,
style: AppThemeData.boldTextStyle( style: AppThemeData.boldTextStyle(
fontSize: 24, fontSize: 24,
color: color:
@@ -82,15 +84,15 @@ class LoginScreen extends StatelessWidget {
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
TextFieldWidget( TextFieldWidget(
title: "Email Address*".tr, title: ConstTexts.emailAddress.tr(),
hintText: "jerome014@gmail.com", hintText: "abdusalom@gmail.com",
controller: controller.emailController.value, controller: controller.emailController.value,
focusNode: controller.emailFocusNode, focusNode: controller.emailFocusNode,
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
TextFieldWidget( TextFieldWidget(
title: "Password*".tr, title: ConstTexts.password.tr(),
hintText: "Enter password".tr, hintText: ConstTexts.enterPassword.tr(),
controller: controller.passwordController.value, controller: controller.passwordController.value,
obscureText: controller.passwordVisible.value, obscureText: controller.passwordVisible.value,
focusNode: controller.passwordFocusNode, focusNode: controller.passwordFocusNode,
@@ -132,7 +134,7 @@ class LoginScreen extends StatelessWidget {
() => const ForgotPasswordScreen(), () => const ForgotPasswordScreen(),
), ),
child: Text( child: Text(
"Forgot Password".tr, ConstTexts.forgotPassword.tr(),
style: AppThemeData.semiBoldTextStyle( style: AppThemeData.semiBoldTextStyle(
color: AppThemeData.info400, color: AppThemeData.info400,
), ),
@@ -142,7 +144,7 @@ class LoginScreen extends StatelessWidget {
const SizedBox(height: 20), const SizedBox(height: 20),
RoundedButtonFill( RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "Log in".tr, title: ConstTexts.login.tr(),
onPress: controller.loginWithEmail, onPress: controller.loginWithEmail,
color: color:
isDark isDark
@@ -167,7 +169,7 @@ class LoginScreen extends StatelessWidget {
), ),
const SizedBox(width: 15), const SizedBox(width: 15),
Text( Text(
"or continue with".tr, ConstTexts.orContinueWith.tr(),
style: AppThemeData.regularTextStyle( style: AppThemeData.regularTextStyle(
color: color:
isDark isDark
@@ -191,7 +193,7 @@ class LoginScreen extends StatelessWidget {
const SizedBox(height: 25), const SizedBox(height: 25),
RoundedButtonFill( RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "Mobile number".tr, title: ConstTexts.mobileNumber.tr(),
onPress: onPress:
() => Get.to(() => const MobileLoginScreen()), () => Get.to(() => const MobileLoginScreen()),
isRight: false, isRight: false,
@@ -217,7 +219,7 @@ class LoginScreen extends StatelessWidget {
Expanded( Expanded(
child: RoundedButtonFill( child: RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "with Google".tr, title: ConstTexts.withGoogle.tr(),
textColor: textColor:
isDark isDark
? AppThemeData.grey100 ? AppThemeData.grey100
@@ -241,7 +243,7 @@ class LoginScreen extends StatelessWidget {
? Expanded( ? Expanded(
child: RoundedButtonFill( child: RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "with Apple".tr, title: ConstTexts.withApple.tr(),
isCenter: true, isCenter: true,
textColor: textColor:
isDark isDark
@@ -272,7 +274,7 @@ class LoginScreen extends StatelessWidget {
child: Center( child: Center(
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
text: "Didn't have an account?".tr, text: ConstTexts.dontHaveAccount.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: color:
isDark isDark
@@ -281,7 +283,7 @@ class LoginScreen extends StatelessWidget {
), ),
children: [ children: [
TextSpan( TextSpan(
text: "Sign up".tr, text: ConstTexts.signUp.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: AppThemeData.ecommerce300, color: AppThemeData.ecommerce300,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,

View File

@@ -1,6 +1,8 @@
import 'package:country_code_picker/country_code_picker.dart'; import 'package:country_code_picker/country_code_picker.dart';
import 'package:customer/constant/const_texts.dart';
import 'package:customer/screen_ui/auth_screens/sign_up_screen.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:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@@ -53,7 +55,7 @@ class MobileLoginScreen extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
"Skip".tr, ConstTexts.skip.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: color:
isDark isDark
@@ -89,8 +91,7 @@ class MobileLoginScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Use your mobile number to Log in easily and securely." ConstTexts.useYourMobileNumber.tr(),
.tr,
style: AppThemeData.boldTextStyle( style: AppThemeData.boldTextStyle(
fontSize: 24, fontSize: 24,
color: color:
@@ -101,8 +102,8 @@ class MobileLoginScreen extends StatelessWidget {
), ),
const SizedBox(height: 25), const SizedBox(height: 25),
TextFieldWidget( TextFieldWidget(
title: "Mobile Number*".tr, title: ConstTexts.mobileNumber.tr(),
hintText: "Enter Mobile number".tr, hintText: ConstTexts.enterMobileNumber.tr(),
controller: controller.mobileController.value, controller: controller.mobileController.value,
textInputType: textInputType:
const TextInputType.numberWithOptions( const TextInputType.numberWithOptions(
@@ -181,7 +182,7 @@ class MobileLoginScreen extends StatelessWidget {
const SizedBox(height: 30), const SizedBox(height: 30),
RoundedButtonFill( RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "Send Code".tr, title: ConstTexts.sendCode.tr(),
onPress: controller.sendOtp, onPress: controller.sendOtp,
color: color:
isDark isDark
@@ -206,7 +207,7 @@ class MobileLoginScreen extends StatelessWidget {
), ),
const SizedBox(width: 15), const SizedBox(width: 15),
Text( Text(
"or continue with".tr, ConstTexts.orContinueWith.tr(),
style: AppThemeData.regularTextStyle( style: AppThemeData.regularTextStyle(
color: color:
isDark isDark
@@ -228,7 +229,7 @@ class MobileLoginScreen extends StatelessWidget {
const SizedBox(height: 25), const SizedBox(height: 25),
RoundedButtonFill( RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "Email address".tr, title: ConstTexts.emailAddress.tr(),
onPress: () => Get.to(() => const SignUpScreen()), onPress: () => Get.to(() => const SignUpScreen()),
isRight: false, isRight: false,
isCenter: true, isCenter: true,
@@ -256,7 +257,7 @@ class MobileLoginScreen extends StatelessWidget {
child: Center( child: Center(
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
text: "Didn't have an account?".tr, text: ConstTexts.dontHaveAccount.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: color:
isDark isDark
@@ -265,7 +266,7 @@ class MobileLoginScreen extends StatelessWidget {
), ),
children: [ children: [
TextSpan( TextSpan(
text: "Sign up".tr, text: ConstTexts.signUp.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: AppThemeData.ecommerce300, color: AppThemeData.ecommerce300,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,

View File

@@ -1,4 +1,6 @@
import 'package:customer/constant/const_texts.dart';
import 'package:customer/screen_ui/auth_screens/sign_up_screen.dart'; import 'package:customer/screen_ui/auth_screens/sign_up_screen.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -49,7 +51,7 @@ class OtpVerificationScreen extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
"Skip".tr, ConstTexts.skip.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: color:
isDark isDark
@@ -85,7 +87,7 @@ class OtpVerificationScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"${"Enter the OTP sent to your mobile".tr} ${controller.countryCode} ${controller.maskPhoneNumber(controller.phoneNumber.value)}", "${ConstTexts.enterOtpSent.tr()} ${controller.countryCode} ${controller.maskPhoneNumber(controller.phoneNumber.value)}",
style: AppThemeData.boldTextStyle( style: AppThemeData.boldTextStyle(
fontSize: 24, fontSize: 24,
color: color:
@@ -163,7 +165,7 @@ class OtpVerificationScreen extends StatelessWidget {
controller.sendOTP(); controller.sendOTP();
}, },
child: Text( child: Text(
"Resend OTP".tr, ConstTexts.resendOTP.tr(),
style: AppThemeData.semiBoldTextStyle( style: AppThemeData.semiBoldTextStyle(
color: AppThemeData.info400, color: AppThemeData.info400,
fontSize: 16, fontSize: 16,
@@ -178,7 +180,7 @@ class OtpVerificationScreen extends StatelessWidget {
/// Verify Button /// Verify Button
RoundedButtonFill( RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "Verify".tr, title: ConstTexts.verify.tr(),
onPress: controller.verifyOtp, onPress: controller.verifyOtp,
color: color:
isDark isDark
@@ -198,7 +200,7 @@ class OtpVerificationScreen extends StatelessWidget {
child: Center( child: Center(
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
text: "Didn't have an account?".tr, text: ConstTexts.dontHaveAccount.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: color:
isDark isDark
@@ -207,7 +209,7 @@ class OtpVerificationScreen extends StatelessWidget {
), ),
children: [ children: [
TextSpan( TextSpan(
text: "Sign up".tr, text: ConstTexts.signUp.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: AppThemeData.ecommerce300, color: AppThemeData.ecommerce300,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,

View File

@@ -1,5 +1,7 @@
import 'package:country_code_picker/country_code_picker.dart'; import 'package:country_code_picker/country_code_picker.dart';
import 'package:customer/constant/const_texts.dart';
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart'; import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@@ -34,14 +36,33 @@ class SignUpScreen extends StatelessWidget {
onPressed: () { onPressed: () {
Get.to(() => LocationPermissionScreen()); Get.to(() => LocationPermissionScreen());
}, },
style: TextButton.styleFrom(padding: const EdgeInsets.symmetric(horizontal: 12), minimumSize: const Size(0, 40), tapTargetSize: MaterialTapTargetSize.shrinkWrap), style: TextButton.styleFrom(
padding: const EdgeInsets.symmetric(horizontal: 12),
minimumSize: const Size(0, 40),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text("Skip".tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)), Text(
ConstTexts.skip.tr(),
style: AppThemeData.mediumTextStyle(
color:
isDark
? AppThemeData.greyDark500
: AppThemeData.grey500,
),
),
Padding( Padding(
padding: const EdgeInsets.only(top: 2), padding: const EdgeInsets.only(top: 2),
child: Icon(Icons.arrow_forward_ios, size: 16, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500), child: Icon(
Icons.arrow_forward_ios,
size: 16,
color:
isDark
? AppThemeData.greyDark500
: AppThemeData.grey500,
),
), ),
], ],
), ),
@@ -57,62 +78,125 @@ class SignUpScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Sign up to explore all our services and start shopping, riding, and more.".tr, ConstTexts.signUpToExplore.tr(),
style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900), style: AppThemeData.boldTextStyle(
fontSize: 24,
color:
isDark
? AppThemeData.greyDark900
: AppThemeData.grey900,
),
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: TextFieldWidget(title: "First Name*".tr, hintText: "Jerome".tr, controller: controller.firstNameController.value)), Expanded(
child: TextFieldWidget(
title: ConstTexts.firstName.tr(),
hintText: "Abdusalom",
controller: controller.firstNameController.value,
),
),
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded(child: TextFieldWidget(title: "Last Name*".tr, hintText: "Bell".tr, controller: controller.lastNameController.value)), Expanded(
child: TextFieldWidget(
title: ConstTexts.lastName.tr(),
hintText: "G'ayratov",
controller: controller.lastNameController.value,
),
),
], ],
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
TextFieldWidget( TextFieldWidget(
title: "Email Address*".tr, title: ConstTexts.emailAddress.tr(),
hintText: "jerome014@gmail.com", hintText: "abdusalom@gmail.com",
controller: controller.emailController.value, controller: controller.emailController.value,
focusNode: controller.emailFocusNode, focusNode: controller.emailFocusNode,
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
TextFieldWidget( TextFieldWidget(
title: "Mobile Number*".tr, title: ConstTexts.mobileNumber.tr(),
hintText: "Enter Mobile number".tr, hintText: ConstTexts.enterMobileNumber.tr(),
enable: controller.type.value == "mobileNumber" ? false : true, enable:
controller.type.value == "mobileNumber"
? false
: true,
controller: controller.mobileController.value, controller: controller.mobileController.value,
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true), textInputType: const TextInputType.numberWithOptions(
signed: true,
decimal: true,
),
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]')), LengthLimitingTextInputFormatter(10)], inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
LengthLimitingTextInputFormatter(10),
],
prefix: Row( prefix: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
CountryCodePicker( CountryCodePicker(
onChanged: (value) { onChanged: (value) {
controller.countryCodeController.value.text = value.dialCode ?? Constant.defaultCountryCode; controller.countryCodeController.value.text =
value.dialCode ?? Constant.defaultCountryCode;
}, },
initialSelection: controller.countryCodeController.value.text.isNotEmpty ? controller.countryCodeController.value.text : Constant.defaultCountryCode, initialSelection:
controller
.countryCodeController
.value
.text
.isNotEmpty
? controller
.countryCodeController
.value
.text
: Constant.defaultCountryCode,
showCountryOnly: false, showCountryOnly: false,
showOnlyCountryWhenClosed: false, showOnlyCountryWhenClosed: false,
alignLeft: false, alignLeft: false,
enabled: controller.type.value != "mobileNumber", enabled: controller.type.value != "mobileNumber",
textStyle: TextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : Colors.black), textStyle: TextStyle(
dialogTextStyle: TextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900), fontSize: 16,
searchStyle: TextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900), color:
dialogBackgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, isDark
? AppThemeData.greyDark900
: Colors.black,
),
dialogTextStyle: TextStyle(
fontSize: 16,
color:
isDark
? AppThemeData.greyDark900
: AppThemeData.grey900,
),
searchStyle: TextStyle(
fontSize: 16,
color:
isDark
? AppThemeData.greyDark900
: AppThemeData.grey900,
),
dialogBackgroundColor:
isDark
? AppThemeData.surfaceDark
: AppThemeData.surface,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
), ),
// const Icon(Icons.keyboard_arrow_down_rounded, size: 24, color: AppThemeData.grey400), // const Icon(Icons.keyboard_arrow_down_rounded, size: 24, color: AppThemeData.grey400),
Container(height: 24, width: 1, color: AppThemeData.grey400), Container(
height: 24,
width: 1,
color: AppThemeData.grey400,
),
const SizedBox(width: 4), const SizedBox(width: 4),
], ],
), ),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
TextFieldWidget( TextFieldWidget(
title: "Password*".tr, title: ConstTexts.password.tr(),
hintText: "Enter password".tr, hintText: ConstTexts.enterPassword.tr(),
controller: controller.passwordController.value, controller: controller.passwordController.value,
obscureText: controller.passwordVisible.value, obscureText: controller.passwordVisible.value,
focusNode: controller.passwordFocusNode, focusNode: controller.passwordFocusNode,
@@ -120,78 +204,142 @@ class SignUpScreen extends StatelessWidget {
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
controller.passwordVisible.value = !controller.passwordVisible.value; controller.passwordVisible.value =
!controller.passwordVisible.value;
}, },
child: child:
controller.passwordVisible.value controller.passwordVisible.value
? SvgPicture.asset( ? SvgPicture.asset(
"assets/icons/ic_password_show.svg", "assets/icons/ic_password_show.svg",
colorFilter: ColorFilter.mode(isDark ? AppThemeData.grey300 : AppThemeData.grey600, BlendMode.srcIn), colorFilter: ColorFilter.mode(
isDark
? AppThemeData.grey300
: AppThemeData.grey600,
BlendMode.srcIn,
),
) )
: SvgPicture.asset( : SvgPicture.asset(
"assets/icons/ic_password_close.svg", "assets/icons/ic_password_close.svg",
colorFilter: ColorFilter.mode(isDark ? AppThemeData.grey300 : AppThemeData.grey600, BlendMode.srcIn), colorFilter: ColorFilter.mode(
isDark
? AppThemeData.grey300
: AppThemeData.grey600,
BlendMode.srcIn,
),
), ),
), ),
), ),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
TextFieldWidget( TextFieldWidget(
title: "Confirm Password*".tr, title: ConstTexts.confirmPassword.tr(),
hintText: "Enter confirm password".tr, hintText: ConstTexts.enterConfirmPassword.tr(),
controller: controller.confirmPasswordController.value, controller: controller.confirmPasswordController.value,
obscureText: controller.conformPasswordVisible.value, obscureText: controller.conformPasswordVisible.value,
suffix: Padding( suffix: Padding(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
controller.conformPasswordVisible.value = !controller.conformPasswordVisible.value; controller.conformPasswordVisible.value =
!controller.conformPasswordVisible.value;
}, },
child: child:
controller.conformPasswordVisible.value controller.conformPasswordVisible.value
? SvgPicture.asset( ? SvgPicture.asset(
"assets/icons/ic_password_show.svg", "assets/icons/ic_password_show.svg",
colorFilter: ColorFilter.mode(isDark ? AppThemeData.grey300 : AppThemeData.grey600, BlendMode.srcIn), colorFilter: ColorFilter.mode(
isDark
? AppThemeData.grey300
: AppThemeData.grey600,
BlendMode.srcIn,
),
) )
: SvgPicture.asset( : SvgPicture.asset(
"assets/icons/ic_password_close.svg", "assets/icons/ic_password_close.svg",
colorFilter: ColorFilter.mode(isDark ? AppThemeData.grey300 : AppThemeData.grey600, BlendMode.srcIn), colorFilter: ColorFilter.mode(
isDark
? AppThemeData.grey300
: AppThemeData.grey600,
BlendMode.srcIn,
),
), ),
), ),
), ),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
TextFieldWidget(title: "Referral Code".tr, hintText: "Enter referral code".tr, controller: controller.referralController.value), TextFieldWidget(
title: ConstTexts.referralCode.tr(),
hintText: ConstTexts.enterReferralCode.tr(),
controller: controller.referralController.value,
),
const SizedBox(height: 40), const SizedBox(height: 40),
RoundedButtonFill( RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "Sign up".tr, title: ConstTexts.signUp.tr(),
onPress: () => controller.signUp(), onPress: () => controller.signUp(),
color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, color:
textColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, isDark
? AppThemeData.greyDark900
: AppThemeData.grey900,
textColor:
isDark
? AppThemeData.surfaceDark
: AppThemeData.surface,
), ),
const SizedBox(height: 25), const SizedBox(height: 25),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container(width: 52, height: 1, color: isDark ? AppThemeData.greyDark400 : AppThemeData.grey300), Container(
width: 52,
height: 1,
color:
isDark
? AppThemeData.greyDark400
: AppThemeData.grey300,
),
const SizedBox(width: 15), const SizedBox(width: 15),
Text("or continue with".tr, style: AppThemeData.regularTextStyle(color: isDark ? AppThemeData.greyDark400 : AppThemeData.grey400)), Text(
ConstTexts.orContinueWith.tr(),
style: AppThemeData.regularTextStyle(
color:
isDark
? AppThemeData.greyDark400
: AppThemeData.grey400,
),
),
const SizedBox(width: 15), const SizedBox(width: 15),
Container(width: 52, height: 1, color: isDark ? AppThemeData.greyDark400 : AppThemeData.grey300), Container(
width: 52,
height: 1,
color:
isDark
? AppThemeData.greyDark400
: AppThemeData.grey300,
),
], ],
), ),
const SizedBox(height: 25), const SizedBox(height: 25),
RoundedButtonFill( RoundedButtonFill(
borderRadius: 10.r, borderRadius: 10.r,
title: "Mobile number".tr, title: ConstTexts.mobileNumber.tr(),
onPress: () => Get.to(() => const MobileLoginScreen()), onPress: () => Get.to(() => const MobileLoginScreen()),
isRight: false, isRight: false,
isCenter: true, isCenter: true,
icon: Icon(Icons.mobile_friendly_outlined, size: 20, color: isDark ? AppThemeData.greyDark900 : null), icon: Icon(
Icons.mobile_friendly_outlined,
size: 20,
color: isDark ? AppThemeData.greyDark900 : null,
),
//Image.asset(AppAssets.icMessage, width: 20, height: 18, color: isDark ? AppThemeData.greyDark900 : null), //Image.asset(AppAssets.icMessage, width: 20, height: 18, color: isDark ? AppThemeData.greyDark900 : null),
color: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200, color:
textColor: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, isDark
? AppThemeData.greyDark200
: AppThemeData.grey200,
textColor:
isDark
? AppThemeData.greyDark900
: AppThemeData.grey900,
), ),
const SizedBox(height: 25), const SizedBox(height: 25),
Padding( Padding(
@@ -199,11 +347,16 @@ class SignUpScreen extends StatelessWidget {
child: Center( child: Center(
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
text: "Already have an account?".tr, text: ConstTexts.alreadyHaveAccount.tr(),
style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800), style: AppThemeData.mediumTextStyle(
color:
isDark
? AppThemeData.greyDark800
: AppThemeData.grey800,
),
children: [ children: [
TextSpan( TextSpan(
text: "Log in".tr, text: ConstTexts.login.tr(),
style: AppThemeData.mediumTextStyle( style: AppThemeData.mediumTextStyle(
color: AppThemeData.ecommerce300, color: AppThemeData.ecommerce300,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,

View File

@@ -92,8 +92,8 @@ class CabBookingScreen extends StatelessWidget {
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: userAgentPackageName:
Platform.isAndroid Platform.isAndroid
? "com.emart.customer" ? "felix.fondex.uz"
: "com.emart.customer.ios", : "felix.fondex.uz.ios",
), ),
flutterMap.MarkerLayer( flutterMap.MarkerLayer(
markers: controller.osmMarker, markers: controller.osmMarker,
@@ -1408,7 +1408,6 @@ class CabBookingScreen extends StatelessWidget {
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
@@ -1636,6 +1635,7 @@ class CabBookingScreen extends StatelessWidget {
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
@@ -1778,7 +1778,13 @@ class CabBookingScreen extends StatelessWidget {
), ),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Text( Text(
controller.selectedPaymentMethod.value == "cod" ? "Наличными" : controller.selectedPaymentMethod.value.tr, controller.selectedPaymentMethod.value ==
"cod"
? "Наличными"
: controller
.selectedPaymentMethod
.value
.tr,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: AppThemeData.boldTextStyle( style: AppThemeData.boldTextStyle(
fontSize: 16, fontSize: 16,
@@ -2946,7 +2952,11 @@ class CabBookingScreen extends StatelessWidget {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
), ),
child: value == PaymentGateway.click || value == PaymentGateway.payme ? Image.asset(image) : Padding( child:
value == PaymentGateway.click ||
value == PaymentGateway.payme
? Image.asset(image)
: Padding(
padding: EdgeInsets.all( padding: EdgeInsets.all(
value.name == "payFast" ? 0 : 8.0, value.name == "payFast" ? 0 : 8.0,
), ),
@@ -2996,7 +3006,9 @@ class CabBookingScreen extends StatelessWidget {
) )
: Expanded( : Expanded(
child: Text( child: Text(
value.name == "cod" ? "Наличными" : value.name.capitalizeString(), value.name == "cod"
? "Наличными"
: value.name.capitalizeString(),
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: AppThemeData.semiBoldTextStyle( style: AppThemeData.semiBoldTextStyle(
fontSize: 16, fontSize: 16,

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@ class LiveTrackingScreen extends StatelessWidget {
mapController: controller.osmMapController, mapController: controller.osmMapController,
options: flutterMap.MapOptions(initialCenter: controller.driverCurrent.value, initialZoom: 14), options: flutterMap.MapOptions(initialCenter: controller.driverCurrent.value, initialZoom: 14),
children: [ children: [
flutterMap.TileLayer(urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', userAgentPackageName: 'com.emart.customer'), flutterMap.TileLayer(urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', userAgentPackageName: 'felix.fondex.uz'),
if (controller.routePoints.isNotEmpty) flutterMap.PolylineLayer(polylines: [flutterMap.Polyline(points: controller.routePoints, strokeWidth: 5.0, color: Colors.blue)]), if (controller.routePoints.isNotEmpty) flutterMap.PolylineLayer(polylines: [flutterMap.Polyline(points: controller.routePoints, strokeWidth: 5.0, color: Colors.blue)]),
flutterMap.MarkerLayer(markers: controller.orderModel.value.id == null ? [] : controller.osmMarkers), flutterMap.MarkerLayer(markers: controller.orderModel.value.id == null ? [] : controller.osmMarkers),
], ],

View File

@@ -83,7 +83,11 @@ class FireStoreUtils {
static FirebaseFirestore fireStore = FirebaseFirestore.instance; static FirebaseFirestore fireStore = FirebaseFirestore.instance;
static String getCurrentUid() { static String getCurrentUid() {
return auth.FirebaseAuth.instance.currentUser!.uid; final user = auth.FirebaseAuth.instance.currentUser;
if(user != null){
return user.uid;
}
return "hello";
} }
static Future<bool> isLogin() async { static Future<bool> isLogin() async {

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../controllers/theme_controller.dart'; import '../controllers/theme_controller.dart';
import 'app_them_data.dart'; import 'app_them_data.dart';
@@ -121,7 +122,7 @@ class _TextFieldWidgetState extends State<TextFieldWidget> {
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(8), borderSide: const BorderSide(color: Colors.red)), errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(8), borderSide: const BorderSide(color: Colors.red)),
disabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(8), borderSide: BorderSide(color: borderColor)), disabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(8), borderSide: BorderSide(color: borderColor)),
hintText: widget.hintText.tr, hintText: widget.hintText.tr,
hintStyle: AppThemeData.regularTextStyle(fontSize: 14, color: hintColor), hintStyle: AppThemeData.regularTextStyle(fontSize: 14.sp, color: hintColor),
), ),
), ),
], ],

View File

@@ -44,7 +44,7 @@ class MapPickerPage extends StatelessWidget {
options: MapOptions( options: MapOptions(
initialCenter: initialCenter:
controller.pickedPlace.value?.coordinates ?? controller.pickedPlace.value?.coordinates ??
LatLng(20.5937, 78.9629), // Default India center LatLng(41.3775, 64.5853), // Default UZB center
initialZoom: 13, initialZoom: 13,
onTap: (tapPos, latlng) { onTap: (tapPos, latlng) {
controller.addLatLngOnly(latlng); controller.addLatLngOnly(latlng);
@@ -180,7 +180,8 @@ class MapPickerPage extends StatelessWidget {
title: "Confirm Location".tr, title: "Confirm Location".tr,
color: AppThemeData.mainColor, color: AppThemeData.mainColor,
textColor: AppThemeData.grey50, textColor: AppThemeData.grey50,
height: 4.h, borderRadius: 12,
height: 6,
onPress: () async { onPress: () async {
final selected = controller.pickedPlace.value; final selected = controller.pickedPlace.value;
if (selected != null) { if (selected != null) {

View File

@@ -321,6 +321,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
easy_localization:
dependency: "direct main"
description:
name: easy_localization
sha256: "2ccdf9db8fe4d9c5a75c122e6275674508fd0f0d49c827354967b8afcc56bbed"
url: "https://pub.dev"
source: hosted
version: "3.0.8"
easy_logger:
dependency: transitive
description:
name: easy_logger
sha256: c764a6e024846f33405a2342caf91c62e357c24b02c04dbc712ef232bf30ffb7
url: "https://pub.dev"
source: hosted
version: "0.0.2"
equatable: equatable:
dependency: transitive dependency: transitive
description: description:
@@ -614,6 +630,19 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.3" version: "1.0.3"
flutter_localization:
dependency: "direct main"
description:
name: flutter_localization
sha256: "578a73455a0deffc4169ef9372ba0562a3e2cff563e5c524ea87bc96daa519c0"
url: "https://pub.dev"
source: hosted
version: "0.3.3"
flutter_localizations:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_map: flutter_map:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -1829,6 +1858,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.1" version: "0.3.1"
universal_io:
dependency: transitive
description:
name: universal_io
sha256: f63cbc48103236abf48e345e07a03ce5757ea86285ed313a6a032596ed9301e2
url: "https://pub.dev"
source: hosted
version: "2.3.1"
url_launcher: url_launcher:
dependency: transitive dependency: transitive
description: description:
@@ -2061,6 +2098,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.6.1" version: "6.6.1"
yaml:
dependency: transitive
description:
name: yaml
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
url: "https://pub.dev"
source: hosted
version: "3.1.3"
zxing_lib: zxing_lib:
dependency: transitive dependency: transitive
description: description:

View File

@@ -1,7 +1,7 @@
name: customer name: customer
description: "A new Flutter project." description: "A new Flutter project."
version: 1.0.0+1 version: 1.0.0+2
environment: environment:
sdk: ^3.7.2 sdk: ^3.7.2
@@ -88,6 +88,8 @@ dependencies:
flutter_google_places_hoc081098: ^2.0.0 flutter_google_places_hoc081098: ^2.0.0
flutter_screenutil: ^5.9.3 flutter_screenutil: ^5.9.3
flutter_hooks: ^0.21.3+1 flutter_hooks: ^0.21.3+1
easy_localization: ^3.0.8
flutter_localization: ^0.3.3
dependency_overrides: dependency_overrides:
webview_flutter: ^4.9.0 webview_flutter: ^4.9.0