From 2736727592f8fde5345453bbbfa8cd150367dc23 Mon Sep 17 00:00:00 2001 From: Abdusalom G'ayratov Date: Sat, 29 Nov 2025 11:54:45 +0500 Subject: [PATCH] BASE: Update The UI Until The Waiting For Driver Section. --- .../cab_booking_screen.dart | 418 +++++++----------- .../wallet_screen/wallet_screen.dart | 2 +- 2 files changed, 167 insertions(+), 253 deletions(-) diff --git a/lib/screen_ui/cab_service_screens/cab_booking_screen.dart b/lib/screen_ui/cab_service_screens/cab_booking_screen.dart index 007f5d8..96c67b7 100644 --- a/lib/screen_ui/cab_service_screens/cab_booking_screen.dart +++ b/lib/screen_ui/cab_service_screens/cab_booking_screen.dart @@ -714,9 +714,9 @@ class CabBookingScreen extends StatelessWidget { ) { return Positioned.fill( child: DraggableScrollableSheet( - initialChildSize: 0.70, - minChildSize: 0.30, - maxChildSize: 0.8, + initialChildSize: 0.5, + minChildSize: 0.5, + maxChildSize: 0.5, expand: false, builder: (context, scrollController) { return Container( @@ -732,13 +732,13 @@ class CabBookingScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "Select Payment Method".tr, - style: AppThemeData.mediumTextStyle( - fontSize: 18, + "Select Payment Method", + style: AppThemeData.boldTextStyle( + fontSize: 18.sp, color: isDark ? AppThemeData.greyDark900 - : AppThemeData.grey900, + : AppThemeData.darkGrey, ), ), GestureDetector( @@ -761,235 +761,146 @@ class CabBookingScreen extends StatelessWidget { padding: EdgeInsets.zero, controller: scrollController, children: [ - Text( - "Preferred Payment".tr, - textAlign: TextAlign.start, - style: AppThemeData.boldTextStyle( - fontSize: 15, - color: - isDark - ? AppThemeData.greyDark500 - : AppThemeData.grey500, + // Text( + // "Preferred Payment".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( + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(15), + // color: + // isDark + // ? AppThemeData.greyDark100 + // : AppThemeData.grey50, + // border: Border.all( + // color: + // isDark + // ? AppThemeData.greyDark200 + // : AppThemeData.grey200, + // ), + // ), + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // children: [ + // Visibility( + // visible: + // controller + // .walletSettingModel + // .value + // .isEnabled == + // true, + // child: cardDecoration( + // controller, + // PaymentGateway.wallet, + // isDark, + // "assets/images/ic_wallet.png", + // ), + // ), + // Visibility( + // visible: + // controller + // .cashOnDeliverySettingModel + // .value + // .isEnabled == + // true, + // child: cardDecoration( + // controller, + // PaymentGateway.cod, + // isDark, + // "assets/images/ic_cash.png", + // ), + // ), + // ], + // ), + // ), + // ), + // if (controller.walletSettingModel.value.isEnabled == + // true || + // controller + // .cashOnDeliverySettingModel + // .value + // .isEnabled == + // true) + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // const SizedBox(height: 10), + // Text( + // "Other Payment Options".tr, + // textAlign: TextAlign.start, + // style: AppThemeData.boldTextStyle( + // fontSize: 15, + // color: + // isDark + // ? AppThemeData.greyDark500 + // : AppThemeData.grey500, + // ), + // ), + // const SizedBox(height: 10), + // ], + // ), + Visibility( + visible: + controller.walletSettingModel.value.isEnabled == + true, + child: cardDecoration( + controller, + PaymentGateway.wallet, + isDark, + "assets/images/ic_wallet.png", ), ), - const SizedBox(height: 10), - if (controller.walletSettingModel.value.isEnabled == - true || - controller - .cashOnDeliverySettingModel - .value - .isEnabled == - true) - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: - isDark - ? AppThemeData.greyDark100 - : AppThemeData.grey50, - border: Border.all( - color: - isDark - ? AppThemeData.greyDark200 - : AppThemeData.grey200, - ), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Visibility( - visible: - controller - .walletSettingModel - .value - .isEnabled == - true, - child: cardDecoration( - controller, - PaymentGateway.wallet, - isDark, - "assets/images/ic_wallet.png", - ), - ), - Visibility( - visible: - controller - .cashOnDeliverySettingModel - .value - .isEnabled == - true, - child: cardDecoration( - controller, - PaymentGateway.cod, - isDark, - "assets/images/ic_cash.png", - ), - ), - ], - ), - ), + Divider(color: AppThemeData.cardColor, thickness: 1.3.r), + Visibility( + visible: + controller + .cashOnDeliverySettingModel + .value + .isEnabled == + true, + child: cardDecoration( + controller, + PaymentGateway.cod, + isDark, + "assets/images/ic_cash.png", ), - if (controller.walletSettingModel.value.isEnabled == - true || - controller - .cashOnDeliverySettingModel - .value - .isEnabled == - true) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 10), - Text( - "Other Payment Options".tr, - textAlign: TextAlign.start, - style: AppThemeData.boldTextStyle( - fontSize: 15, - color: - isDark - ? AppThemeData.greyDark500 - : AppThemeData.grey500, - ), - ), - const SizedBox(height: 10), - ], + ), + Divider(color: AppThemeData.cardColor, thickness: 1.3.r), + Visibility( + visible: true, + child: cardDecoration( + controller, + PaymentGateway.payme, + isDark, + "assets/images/payme_logo.png", ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: - isDark - ? AppThemeData.greyDark100 - : AppThemeData.grey50, - border: Border.all( - color: - isDark - ? AppThemeData.greyDark200 - : AppThemeData.grey200, - ), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Visibility( - visible: - controller.stripeModel.value.isEnabled == - true, - child: cardDecoration( - controller, - PaymentGateway.stripe, - isDark, - "assets/images/stripe.png", - ), - ), - Visibility( - visible: - controller.payPalModel.value.isEnabled == - true, - child: cardDecoration( - controller, - PaymentGateway.paypal, - isDark, - "assets/images/paypal.png", - ), - ), - Visibility( - visible: - controller.payStackModel.value.isEnable == - true, - child: cardDecoration( - controller, - PaymentGateway.payStack, - isDark, - "assets/images/paystack.png", - ), - ), - Visibility( - visible: - controller - .mercadoPagoModel - .value - .isEnabled == - true, - child: cardDecoration( - controller, - PaymentGateway.mercadoPago, - isDark, - "assets/images/mercado-pago.png", - ), - ), - Visibility( - visible: - controller - .flutterWaveModel - .value - .isEnable == - true, - child: cardDecoration( - controller, - PaymentGateway.flutterWave, - isDark, - "assets/images/flutterwave_logo.png", - ), - ), - Visibility( - visible: - controller.payFastModel.value.isEnable == - true, - child: cardDecoration( - controller, - PaymentGateway.payFast, - isDark, - "assets/images/payfast.png", - ), - ), - Visibility( - visible: - controller.razorPayModel.value.isEnabled == - true, - child: cardDecoration( - controller, - PaymentGateway.razorpay, - isDark, - "assets/images/razorpay.png", - ), - ), - Visibility( - visible: - controller.midTransModel.value.enable == - true, - child: cardDecoration( - controller, - PaymentGateway.midTrans, - isDark, - "assets/images/midtrans.png", - ), - ), - Visibility( - visible: - controller.orangeMoneyModel.value.enable == - true, - child: cardDecoration( - controller, - PaymentGateway.orangeMoney, - isDark, - "assets/images/orange_money.png", - ), - ), - Visibility( - visible: - controller.xenditModel.value.enable == true, - child: cardDecoration( - controller, - PaymentGateway.xendit, - isDark, - "assets/images/xendit.png", - ), - ), - ], - ), + ), + Divider(color: AppThemeData.cardColor, thickness: 1.3.r), + Visibility( + visible: + // controller.payPalModel.value.isEnabled == + true, + child: cardDecoration( + controller, + PaymentGateway.click, + isDark, + "assets/images/click_logo.png", ), ), SizedBox(height: 20), @@ -999,8 +910,8 @@ class CabBookingScreen extends StatelessWidget { RoundedButtonFill( borderRadius: 10.r, title: "Continue".tr, - color: AppThemeData.primary300, - textColor: AppThemeData.grey900, + color: AppThemeData.mainColor, + textColor: AppThemeData.grey50, onPress: () async { if (controller.selectedPaymentMethod.value.isEmpty) { ShowToastDialog.showToast( @@ -1865,9 +1776,9 @@ class CabBookingScreen extends StatelessWidget { isDark, "assets/images/razorpay.png", ), - SizedBox(width: 22), + SizedBox(width: 10.w), Text( - controller.selectedPaymentMethod.value.tr, + controller.selectedPaymentMethod.value == "cod" ? "Наличными" : controller.selectedPaymentMethod.value.tr, textAlign: TextAlign.start, style: AppThemeData.boldTextStyle( fontSize: 16, @@ -1889,8 +1800,8 @@ class CabBookingScreen extends StatelessWidget { onPress: () async { controller.placeOrder(); }, - color: AppThemeData.primary300, - textColor: AppThemeData.grey900, + color: AppThemeData.mainColor, + textColor: AppThemeData.grey50, ), ], ), @@ -1942,16 +1853,19 @@ class CabBookingScreen extends StatelessWidget { SizedBox(height: 30), Text( "Waiting for driver....".tr, - style: AppThemeData.mediumTextStyle( - fontSize: 18, - color: AppThemeData.grey900, - ), + style: AppThemeData.boldTextStyle( + fontSize: 18.sp, + color: + isDark + ? AppThemeData.greyDark900 + : AppThemeData.darkGrey, + ), ), Image.asset('assets/loader.gif', width: 250), RoundedButtonFill( borderRadius: 10.r, title: "Cancel Ride".tr, - color: AppThemeData.danger300, + color: AppThemeData.mainColor, textColor: AppThemeData.surface, onPress: () async { try { @@ -3021,8 +2935,8 @@ class CabBookingScreen extends StatelessWidget { child: Row( children: [ Container( - width: 50, - height: 50, + width: 42.r, + height: 42.r, decoration: ShapeDecoration( shape: RoundedRectangleBorder( side: const BorderSide( @@ -3032,7 +2946,7 @@ class CabBookingScreen extends StatelessWidget { borderRadius: BorderRadius.circular(8), ), ), - child: Padding( + child: value == PaymentGateway.click || value == PaymentGateway.payme ? Image.asset(image) : Padding( padding: EdgeInsets.all( value.name == "payFast" ? 0 : 8.0, ), @@ -3070,11 +2984,11 @@ class CabBookingScreen extends StatelessWidget { ), textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle( - fontSize: 14, + fontSize: 12.sp, color: isDark - ? AppThemeData.primary300 - : AppThemeData.primary300, + ? AppThemeData.mainColor + : AppThemeData.mainColor, ), ), ], @@ -3082,7 +2996,7 @@ class CabBookingScreen extends StatelessWidget { ) : Expanded( child: Text( - value.name.capitalizeString(), + value.name == "cod" ? "Наличными" : value.name.capitalizeString(), textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle( fontSize: 16, @@ -3099,8 +3013,8 @@ class CabBookingScreen extends StatelessWidget { groupValue: controller.selectedPaymentMethod.value, activeColor: isDark - ? AppThemeData.primary300 - : AppThemeData.primary300, + ? AppThemeData.mainColor + : AppThemeData.mainColor, onChanged: (value) { controller.selectedPaymentMethod.value = value.toString(); }, diff --git a/lib/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart b/lib/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart index be02e11..0c2af9d 100644 --- a/lib/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart +++ b/lib/screen_ui/multi_vendor_service/wallet_screen/wallet_screen.dart @@ -266,4 +266,4 @@ class WalletScreen extends StatelessWidget { } } -enum PaymentGateway { payFast, mercadoPago, paypal, stripe, flutterWave, payStack, razorpay, cod, wallet, midTrans, orangeMoney, xendit } +enum PaymentGateway {payme, click, payFast, mercadoPago, paypal, stripe, flutterWave, payStack, razorpay, cod, wallet, midTrans, orangeMoney, xendit }