BASE: Implement Localization In My Cab Booking Screen.
This commit is contained in:
@@ -98,5 +98,9 @@
|
|||||||
"popularDestinations": "Popular Destinations",
|
"popularDestinations": "Popular Destinations",
|
||||||
"selectPaymentMethod": "Select Payment Method",
|
"selectPaymentMethod": "Select Payment Method",
|
||||||
"prefferedPayment": "Preferred Payment",
|
"prefferedPayment": "Preferred Payment",
|
||||||
"otherPaymentOptions": "Other Payment Options"
|
"otherPaymentOptions": "Other Payment Options",
|
||||||
|
"rideHistory": "Ride History",
|
||||||
|
"plsLoginToAcc": "Please Log In to Continue",
|
||||||
|
"youAreNotLoggedIn": "You’re not logged in. Please sign in to access your account and explore all features.",
|
||||||
|
"noOrderfound": "No order found"
|
||||||
}
|
}
|
||||||
@@ -98,10 +98,10 @@ class ConstTexts {
|
|||||||
static String selectPaymentMethod = "selectPaymentMethod";
|
static String selectPaymentMethod = "selectPaymentMethod";
|
||||||
static String prefferedPayment = "prefferedPayment";
|
static String prefferedPayment = "prefferedPayment";
|
||||||
static String otherPaymentOptions = "otherPaymentOptions";
|
static String otherPaymentOptions = "otherPaymentOptions";
|
||||||
static String rideDetails = "rideDetails";
|
static String rideHistory = "rideHistory";
|
||||||
static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
|
static String plsLoginToAcc = "plsLoginToAcc";
|
||||||
static String somethingWentWrong = "somethingWentWrong";
|
static String youAreNotLoggedIn = "youAreNotLoggedIn";
|
||||||
static String cash = "cash";
|
static String noOrderfound = "noOrderfound";
|
||||||
static String yourSosrequestAlreadySubmitted = "yourSosrequestAlreadySubmitted";
|
static String yourSosrequestAlreadySubmitted = "yourSosrequestAlreadySubmitted";
|
||||||
static String payNow = "payNow";
|
static String payNow = "payNow";
|
||||||
static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
|
static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:io';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:customer/constant/const_texts.dart';
|
import 'package:customer/constant/const_texts.dart';
|
||||||
import 'package:customer/controllers/Intercity_home_controller.dart';
|
import 'package:customer/controllers/Intercity_home_controller.dart';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:customer/constant/const_texts.dart';
|
||||||
import 'package:customer/models/cab_order_model.dart';
|
import 'package:customer/models/cab_order_model.dart';
|
||||||
import 'package:customer/payment/createRazorPayOrderModel.dart';
|
import 'package:customer/payment/createRazorPayOrderModel.dart';
|
||||||
import 'package:customer/payment/rozorpayConroller.dart';
|
import 'package:customer/payment/rozorpayConroller.dart';
|
||||||
@@ -5,6 +6,7 @@ import 'package:customer/screen_ui/auth_screens/login_screen.dart';
|
|||||||
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart';
|
||||||
import 'package:customer/themes/round_button_fill.dart';
|
import 'package:customer/themes/round_button_fill.dart';
|
||||||
import 'package:customer/themes/show_toast_dialog.dart';
|
import 'package:customer/themes/show_toast_dialog.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -38,7 +40,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
backgroundColor: AppThemeData.primary300,
|
backgroundColor: AppThemeData.primary300,
|
||||||
title: Padding(
|
title: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 10),
|
padding: const EdgeInsets.only(bottom: 10),
|
||||||
child: Row(children: [const SizedBox(width: 10), Text("Ride History".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900))]),
|
child: Row(children: [const SizedBox(width: 10), Text(ConstTexts.rideHistory.tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900))]),
|
||||||
),
|
),
|
||||||
bottom: PreferredSize(
|
bottom: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(48),
|
preferredSize: const Size.fromHeight(48),
|
||||||
@@ -81,17 +83,17 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text("Please Log In to Continue".tr, style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
Text(ConstTexts.plsLoginToAcc.tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Text(
|
Text(
|
||||||
"You’re not logged in. Please sign in to access your account and explore all features.".tr,
|
ConstTexts.youAreNotLoggedIn.tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Log in".tr,
|
title: ConstTexts.login.tr(),
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 5.5,
|
height: 5.5,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
@@ -109,7 +111,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
final orders = controller.getOrdersForTab(title);
|
final orders = controller.getOrdersForTab(title);
|
||||||
|
|
||||||
if (orders.isEmpty) {
|
if (orders.isEmpty) {
|
||||||
return Center(child: Text("No order found".tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)));
|
return Center(child: Text(ConstTexts.noOrderfound.tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
@@ -133,7 +135,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${'Booking Date:'.tr} ${controller.formatDate(order.scheduleDateTime!)}".tr,
|
"${'Booking Date:'.tr} ${controller.formatDate(order.scheduleDateTime!)}",
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||||
),
|
),
|
||||||
@@ -220,7 +222,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text("Otp :".tr, style: AppThemeData.mediumTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
|
Text("Otp :", style: AppThemeData.mediumTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
|
||||||
SizedBox(width: 5),
|
SizedBox(width: 5),
|
||||||
Text(order.otpCode ?? '', style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text(order.otpCode ?? '', style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
],
|
],
|
||||||
@@ -229,7 +231,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
order.status == Constant.orderInTransit && order.paymentStatus == false
|
order.status == Constant.orderInTransit && order.paymentStatus == false
|
||||||
? RoundedButtonFill(
|
? RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Pay Now".tr,
|
title: ConstTexts.payNow.tr(),
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
controller.selectedPaymentMethod.value = order.paymentMethod.toString();
|
controller.selectedPaymentMethod.value = order.paymentMethod.toString();
|
||||||
controller.calculateTotalAmount(order);
|
controller.calculateTotalAmount(order);
|
||||||
@@ -273,7 +275,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text("Select Payment Method".tr, style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
Text(ConstTexts.selectPaymentMethod.tr(), style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
@@ -288,7 +290,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
children: [
|
children: [
|
||||||
Text("Preferred Payment".tr, textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
|
Text(ConstTexts.prefferedPayment.tr(), textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
if (controller.walletSettingModel.value.isEnabled == true || controller.cashOnDeliverySettingModel.value.isEnabled == true)
|
if (controller.walletSettingModel.value.isEnabled == true || controller.cashOnDeliverySettingModel.value.isEnabled == true)
|
||||||
Container(
|
Container(
|
||||||
@@ -319,7 +321,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Other Payment Options".tr,
|
ConstTexts.otherPaymentOptions.tr(),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: AppThemeData.boldTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500),
|
style: AppThemeData.boldTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500),
|
||||||
),
|
),
|
||||||
@@ -365,12 +367,12 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Continue".tr,
|
title: ConstTexts.continueT.tr(),
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: AppThemeData.grey900,
|
textColor: AppThemeData.grey900,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
if (controller.selectedPaymentMethod.value.isEmpty) {
|
if (controller.selectedPaymentMethod.value.isEmpty) {
|
||||||
ShowToastDialog.showToast("Please select a payment method".tr);
|
ShowToastDialog.showToast(ConstTexts.plsSelectPaymentMethod.tr());
|
||||||
} else {
|
} else {
|
||||||
if (controller.selectedPaymentMethod.value == PaymentGateway.stripe.name) {
|
if (controller.selectedPaymentMethod.value == PaymentGateway.stripe.name) {
|
||||||
controller.stripeMakePayment(amount: controller.totalAmount.value.toString());
|
controller.stripeMakePayment(amount: controller.totalAmount.value.toString());
|
||||||
@@ -388,7 +390,7 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
controller.completeOrder();
|
controller.completeOrder();
|
||||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.wallet.name) {
|
} else if (controller.selectedPaymentMethod.value == PaymentGateway.wallet.name) {
|
||||||
if (Constant.userModel!.walletAmount == null || Constant.userModel!.walletAmount! < controller.totalAmount.value) {
|
if (Constant.userModel!.walletAmount == null || Constant.userModel!.walletAmount! < controller.totalAmount.value) {
|
||||||
ShowToastDialog.showToast("You do not have sufficient wallet balance".tr);
|
ShowToastDialog.showToast(ConstTexts.youDoNothaveSufficientwalletBalance.tr());
|
||||||
} else {
|
} else {
|
||||||
controller.completeOrder();
|
controller.completeOrder();
|
||||||
}
|
}
|
||||||
@@ -402,14 +404,14 @@ class MyCabBookingScreen extends StatelessWidget {
|
|||||||
RazorPayController().createOrderRazorPay(amount: double.parse(controller.totalAmount.value.toString()), razorpayModel: controller.razorPayModel.value).then((value) {
|
RazorPayController().createOrderRazorPay(amount: double.parse(controller.totalAmount.value.toString()), razorpayModel: controller.razorPayModel.value).then((value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
Get.back();
|
Get.back();
|
||||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
|
ShowToastDialog.showToast(ConstTexts.somethingWentWrong.tr());
|
||||||
} else {
|
} else {
|
||||||
CreateRazorPayOrderModel result = value;
|
CreateRazorPayOrderModel result = value;
|
||||||
controller.openCheckout(amount: controller.totalAmount.value.toString(), orderId: result.id);
|
controller.openCheckout(amount: controller.totalAmount.value.toString(), orderId: result.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShowToastDialog.showToast("Please select payment method".tr);
|
ShowToastDialog.showToast(ConstTexts.plsSelectPaymentMethod.tr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user