BASE: Update The UI Until The Waiting For Driver Section.
This commit is contained in:
@@ -714,9 +714,9 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
) {
|
) {
|
||||||
return Positioned.fill(
|
return Positioned.fill(
|
||||||
child: DraggableScrollableSheet(
|
child: DraggableScrollableSheet(
|
||||||
initialChildSize: 0.70,
|
initialChildSize: 0.5,
|
||||||
minChildSize: 0.30,
|
minChildSize: 0.5,
|
||||||
maxChildSize: 0.8,
|
maxChildSize: 0.5,
|
||||||
expand: false,
|
expand: false,
|
||||||
builder: (context, scrollController) {
|
builder: (context, scrollController) {
|
||||||
return Container(
|
return Container(
|
||||||
@@ -732,13 +732,13 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Select Payment Method".tr,
|
"Select Payment Method",
|
||||||
style: AppThemeData.mediumTextStyle(
|
style: AppThemeData.boldTextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18.sp,
|
||||||
color:
|
color:
|
||||||
isDark
|
isDark
|
||||||
? AppThemeData.greyDark900
|
? AppThemeData.greyDark900
|
||||||
: AppThemeData.grey900,
|
: AppThemeData.darkGrey,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
@@ -761,235 +761,146 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
// Text(
|
||||||
"Preferred Payment".tr,
|
// "Preferred Payment".tr,
|
||||||
textAlign: TextAlign.start,
|
// textAlign: TextAlign.start,
|
||||||
style: AppThemeData.boldTextStyle(
|
// style: AppThemeData.boldTextStyle(
|
||||||
fontSize: 15,
|
// fontSize: 15,
|
||||||
color:
|
// color:
|
||||||
isDark
|
// isDark
|
||||||
? AppThemeData.greyDark500
|
// ? AppThemeData.greyDark500
|
||||||
: AppThemeData.grey500,
|
// : 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),
|
Divider(color: AppThemeData.cardColor, thickness: 1.3.r),
|
||||||
if (controller.walletSettingModel.value.isEnabled ==
|
Visibility(
|
||||||
true ||
|
visible:
|
||||||
controller
|
controller
|
||||||
.cashOnDeliverySettingModel
|
.cashOnDeliverySettingModel
|
||||||
.value
|
.value
|
||||||
.isEnabled ==
|
.isEnabled ==
|
||||||
true)
|
true,
|
||||||
Container(
|
child: cardDecoration(
|
||||||
decoration: BoxDecoration(
|
controller,
|
||||||
borderRadius: BorderRadius.circular(15),
|
PaymentGateway.cod,
|
||||||
color:
|
isDark,
|
||||||
isDark
|
"assets/images/ic_cash.png",
|
||||||
? 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 ||
|
Divider(color: AppThemeData.cardColor, thickness: 1.3.r),
|
||||||
controller
|
Visibility(
|
||||||
.cashOnDeliverySettingModel
|
visible: true,
|
||||||
.value
|
child: cardDecoration(
|
||||||
.isEnabled ==
|
controller,
|
||||||
true)
|
PaymentGateway.payme,
|
||||||
Column(
|
isDark,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
"assets/images/payme_logo.png",
|
||||||
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),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Container(
|
),
|
||||||
decoration: BoxDecoration(
|
Divider(color: AppThemeData.cardColor, thickness: 1.3.r),
|
||||||
borderRadius: BorderRadius.circular(15),
|
Visibility(
|
||||||
color:
|
visible:
|
||||||
isDark
|
// controller.payPalModel.value.isEnabled ==
|
||||||
? AppThemeData.greyDark100
|
true,
|
||||||
: AppThemeData.grey50,
|
child: cardDecoration(
|
||||||
border: Border.all(
|
controller,
|
||||||
color:
|
PaymentGateway.click,
|
||||||
isDark
|
isDark,
|
||||||
? AppThemeData.greyDark200
|
"assets/images/click_logo.png",
|
||||||
: 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",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
@@ -999,8 +910,8 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Continue".tr,
|
title: "Continue".tr,
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.mainColor,
|
||||||
textColor: AppThemeData.grey900,
|
textColor: AppThemeData.grey50,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
if (controller.selectedPaymentMethod.value.isEmpty) {
|
if (controller.selectedPaymentMethod.value.isEmpty) {
|
||||||
ShowToastDialog.showToast(
|
ShowToastDialog.showToast(
|
||||||
@@ -1865,9 +1776,9 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
isDark,
|
isDark,
|
||||||
"assets/images/razorpay.png",
|
"assets/images/razorpay.png",
|
||||||
),
|
),
|
||||||
SizedBox(width: 22),
|
SizedBox(width: 10.w),
|
||||||
Text(
|
Text(
|
||||||
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,
|
||||||
@@ -1889,8 +1800,8 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
onPress: () async {
|
onPress: () async {
|
||||||
controller.placeOrder();
|
controller.placeOrder();
|
||||||
},
|
},
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.mainColor,
|
||||||
textColor: AppThemeData.grey900,
|
textColor: AppThemeData.grey50,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1942,16 +1853,19 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
SizedBox(height: 30),
|
SizedBox(height: 30),
|
||||||
Text(
|
Text(
|
||||||
"Waiting for driver....".tr,
|
"Waiting for driver....".tr,
|
||||||
style: AppThemeData.mediumTextStyle(
|
style: AppThemeData.boldTextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18.sp,
|
||||||
color: AppThemeData.grey900,
|
color:
|
||||||
),
|
isDark
|
||||||
|
? AppThemeData.greyDark900
|
||||||
|
: AppThemeData.darkGrey,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Image.asset('assets/loader.gif', width: 250),
|
Image.asset('assets/loader.gif', width: 250),
|
||||||
RoundedButtonFill(
|
RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: "Cancel Ride".tr,
|
title: "Cancel Ride".tr,
|
||||||
color: AppThemeData.danger300,
|
color: AppThemeData.mainColor,
|
||||||
textColor: AppThemeData.surface,
|
textColor: AppThemeData.surface,
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
try {
|
try {
|
||||||
@@ -3021,8 +2935,8 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 50,
|
width: 42.r,
|
||||||
height: 50,
|
height: 42.r,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: const BorderSide(
|
side: const BorderSide(
|
||||||
@@ -3032,7 +2946,7 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: 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,
|
||||||
),
|
),
|
||||||
@@ -3070,11 +2984,11 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: AppThemeData.semiBoldTextStyle(
|
style: AppThemeData.semiBoldTextStyle(
|
||||||
fontSize: 14,
|
fontSize: 12.sp,
|
||||||
color:
|
color:
|
||||||
isDark
|
isDark
|
||||||
? AppThemeData.primary300
|
? AppThemeData.mainColor
|
||||||
: AppThemeData.primary300,
|
: AppThemeData.mainColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -3082,7 +2996,7 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: Expanded(
|
: Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
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,
|
||||||
@@ -3099,8 +3013,8 @@ class CabBookingScreen extends StatelessWidget {
|
|||||||
groupValue: controller.selectedPaymentMethod.value,
|
groupValue: controller.selectedPaymentMethod.value,
|
||||||
activeColor:
|
activeColor:
|
||||||
isDark
|
isDark
|
||||||
? AppThemeData.primary300
|
? AppThemeData.mainColor
|
||||||
: AppThemeData.primary300,
|
: AppThemeData.mainColor,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
controller.selectedPaymentMethod.value = value.toString();
|
controller.selectedPaymentMethod.value = value.toString();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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 }
|
||||||
|
|||||||
Reference in New Issue
Block a user