@@ -1,3 +1,4 @@
import ' package:customer/constant/const_texts.dart ' ;
import ' package:customer/models/cab_order_model.dart ' ;
import ' package:customer/payment/createRazorPayOrderModel.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/themes/round_button_fill.dart ' ;
import ' package:customer/themes/show_toast_dialog.dart ' ;
import ' package:easy_localization/easy_localization.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter_screenutil/flutter_screenutil.dart ' ;
import ' package:get/get.dart ' ;
@@ -38,7 +40,7 @@ class MyCabBookingScreen extends StatelessWidget {
backgroundColor: AppThemeData . primary300 ,
title: Padding (
padding: const EdgeInsets . only ( bottom: 10 ) ,
child: Row ( children: [ const SizedBox ( width: 10 ) , Text ( " R ide History" . tr , style: AppThemeData . boldTextStyle ( fontSize: 18 , color: AppThemeData . grey900 ) ) ] ) ,
child: Row ( children: [ const SizedBox ( width: 10 ) , Text ( ConstTexts . r ideHistory. tr ( ) , style: AppThemeData . boldTextStyle ( fontSize: 18 , color: AppThemeData . grey900 ) ) ] ) ,
) ,
bottom: PreferredSize (
preferredSize: const Size . fromHeight ( 48 ) ,
@@ -81,17 +83,17 @@ class MyCabBookingScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment . center ,
crossAxisAlignment: CrossAxisAlignment . center ,
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 ) ,
Text (
" You’ re not logged in. Please sign in to access your account and explore all features. " . tr ,
ConstTexts . youAreNotLoggedIn . tr ( ) ,
textAlign: TextAlign . center ,
style: TextStyle ( color: isDark ? AppThemeData . grey50 : AppThemeData . grey500 , fontSize: 16 , fontFamily: AppThemeData . bold ) ,
) ,
const SizedBox ( height: 20 ) ,
RoundedButtonFill (
borderRadius: 10. r ,
title: " L og in" . tr ,
title: ConstTexts . l ogin. tr ( ) ,
width: 55 ,
height: 5.5 ,
color: AppThemeData . primary300 ,
@@ -109,7 +111,7 @@ class MyCabBookingScreen extends StatelessWidget {
final orders = controller . getOrdersForTab ( title ) ;
if ( orders . isEmpty ) {
return Center ( child: Text ( " No o rder found" . tr , style: AppThemeData . mediumTextStyle ( color: isDark ? AppThemeData . greyDark900 : AppThemeData . grey900 ) ) ) ;
return Center ( child: Text ( ConstTexts . noO rderfound. tr ( ) , style: AppThemeData . mediumTextStyle ( color: isDark ? AppThemeData . greyDark900 : AppThemeData . grey900 ) ) ) ;
}
return ListView . builder (
@@ -133,7 +135,7 @@ class MyCabBookingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
" ${ ' Booking Date: ' . tr } ${ controller . formatDate ( order . scheduleDateTime ! ) } " . tr ,
" ${ ' Booking Date: ' . tr } ${ controller . formatDate ( order . scheduleDateTime ! ) } " ,
textAlign: TextAlign . start ,
style: TextStyle ( fontFamily: AppThemeData . semiBold , fontSize: 18 , color: isDark ? AppThemeData . grey50 : AppThemeData . grey900 ) ,
) ,
@@ -220,7 +222,7 @@ class MyCabBookingScreen extends StatelessWidget {
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment . center ,
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 ) ,
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
? RoundedButtonFill (
borderRadius: 10. r ,
title: " P ay Now" . tr ,
title: ConstTexts . p ayNow. tr ( ) ,
onPress: ( ) async {
controller . selectedPaymentMethod . value = order . paymentMethod . toString ( ) ;
controller . calculateTotalAmount ( order ) ;
@@ -273,7 +275,7 @@ class MyCabBookingScreen extends StatelessWidget {
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Text ( " S elect Payment Method" . tr , style: AppThemeData . mediumTextStyle ( fontSize: 18 , color: isDark ? AppThemeData . greyDark900 : AppThemeData . grey900 ) ) ,
Text ( ConstTexts . s electPaymentMethod. tr ( ) , style: AppThemeData . mediumTextStyle ( fontSize: 18 , color: isDark ? AppThemeData . greyDark900 : AppThemeData . grey900 ) ) ,
GestureDetector (
onTap: ( ) {
Get . back ( ) ;
@@ -288,7 +290,7 @@ class MyCabBookingScreen extends StatelessWidget {
padding: EdgeInsets . zero ,
controller: scrollController ,
children: [
Text ( " P refer red Payment" . tr , textAlign: TextAlign . start , style: AppThemeData . boldTextStyle ( fontSize: 15 , color: isDark ? AppThemeData . greyDark500 : AppThemeData . grey500 ) ) ,
Text ( ConstTexts . p reff eredPayment. tr ( ) , textAlign: TextAlign . start , style: AppThemeData . boldTextStyle ( fontSize: 15 , color: isDark ? AppThemeData . greyDark500 : AppThemeData . grey500 ) ) ,
const SizedBox ( height: 10 ) ,
if ( controller . walletSettingModel . value . isEnabled = = true | | controller . cashOnDeliverySettingModel . value . isEnabled = = true )
Container (
@@ -319,7 +321,7 @@ class MyCabBookingScreen extends StatelessWidget {
children: [
const SizedBox ( height: 10 ) ,
Text (
" O ther Payment Options " . tr ,
ConstTexts . o therPaymentOptions. tr ( ) ,
textAlign: TextAlign . start ,
style: AppThemeData . boldTextStyle ( fontSize: 15 , color: isDark ? AppThemeData . greyDark500 : AppThemeData . grey500 ) ,
) ,
@@ -365,12 +367,12 @@ class MyCabBookingScreen extends StatelessWidget {
) ,
RoundedButtonFill (
borderRadius: 10. r ,
title: " C ontinue" . tr ,
title: ConstTexts . c ontinueT . tr ( ) ,
color: AppThemeData . primary300 ,
textColor: AppThemeData . grey900 ,
onPress: ( ) async {
if ( controller . selectedPaymentMethod . value . isEmpty ) {
ShowToastDialog . showToast ( " Please s elect a p ayment m ethod" . tr ) ;
ShowToastDialog . showToast ( ConstTexts . plsS electP aymentM ethod. tr ( ) );
} else {
if ( controller . selectedPaymentMethod . value = = PaymentGateway . stripe . name ) {
controller . stripeMakePayment ( amount: controller . totalAmount . value . toString ( ) ) ;
@@ -388,7 +390,7 @@ class MyCabBookingScreen extends StatelessWidget {
controller . completeOrder ( ) ;
} else if ( controller . selectedPaymentMethod . value = = PaymentGateway . wallet . name ) {
if ( Constant . userModel ! . walletAmount = = null | | Constant . userModel ! . walletAmount ! < controller . totalAmount . value ) {
ShowToastDialog . showToast ( " You do n ot have s ufficient wallet b alance" . tr ) ;
ShowToastDialog . showToast ( ConstTexts . youDoN othaveS ufficientwalletB alance. tr ( ) );
} else {
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 ) {
if ( value = = null ) {
Get . back ( ) ;
ShowToastDialog . showToast ( " S omething w ent w rong, please contact admin. " . tr ) ;
ShowToastDialog . showToast ( ConstTexts . s omethingW entW rong. tr ( ) );
} else {
CreateRazorPayOrderModel result = value ;
controller . openCheckout ( amount: controller . totalAmount . value . toString ( ) , orderId: result . id ) ;
}
} ) ;
} else {
ShowToastDialog . showToast ( " Please s elect p ayment m ethod" . tr ) ;
ShowToastDialog . showToast ( ConstTexts . plsS electP aymentM ethod. tr ( ) );
}
}
} ,