BASE: Update Icons & Name Of The App.

This commit is contained in:
2025-12-04 10:23:59 +05:00
parent b04050384d
commit e602782edd
228 changed files with 34364 additions and 7905 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:flutter_map/flutter_map.dart' as flutterMap;
import 'package:latlong2/latlong.dart' as latlong;
@@ -668,21 +668,16 @@ class CabBookingScreen extends StatelessWidget {
child: Obx(
() => RoundedButtonFill(
borderRadius: 10.r,
title: 'pay_amount'.trParams({
'amount':
controller.selectedVehicleType.value.id == null
? Constant.amountShow(amount: "0.0")
: Constant.amountShow(
amount:
controller
.getAmount(
controller
.selectedVehicleType
.value,
)
.toString(),
),
}),
title: 'pay_amount'.tr(namedArgs: {
'amount': controller.selectedVehicleType.value.id == null
? Constant.amountShow(amount: "0.0")
: Constant.amountShow(
amount: controller
.getAmount(controller.selectedVehicleType.value)
.toString(),
),
}),
onPress: () async {
if (controller.selectedVehicleType.value.id != null) {
controller.calculateTotalAmount();
@@ -1927,7 +1922,9 @@ class CabBookingScreen extends StatelessWidget {
);
cabDashboardController.selectedIndex.value = 0;
} catch (e) {
ShowToastDialog.showToast(ConstTexts.failedToCancel.tr());
ShowToastDialog.showToast(
ConstTexts.failedToCancel.tr(),
);
}
},
),
@@ -2069,7 +2066,8 @@ class CabBookingScreen extends StatelessWidget {
.value,
// backgroundColor: AppThemeData.grey50,
// borderColor: AppThemeData.grey50,
hintText: ConstTexts.destinationLocation.tr(),
hintText:
ConstTexts.destinationLocation.tr(),
enable: false,
readOnly: true,
prefix: const Padding(
@@ -2282,7 +2280,7 @@ class CabBookingScreen extends StatelessWidget {
InkWell(
onTap: () async {
ShowToastDialog.showLoader(
ConstTexts.pleaseWait.tr(),
ConstTexts.pleaseWait.tr(),
);
UserModel? customer =
@@ -2621,8 +2619,7 @@ class CabBookingScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
'${taxModel.title} (${taxModel.tax} ${taxModel.type == "Fixed" ? Constant.currencyData!.code : "%"})'
,
'${taxModel.title} (${taxModel.tax} ${taxModel.type == "Fixed" ? Constant.currencyData!.code : "%"})',
textAlign: TextAlign.start,
style: AppThemeData.mediumTextStyle(
fontSize: 14,
@@ -2720,7 +2717,9 @@ class CabBookingScreen extends StatelessWidget {
isCenter: true,
icon: const Icon(Icons.call, color: Colors.white),
onPress: () async {
ShowToastDialog.showLoader(ConstTexts.pleaseWait.tr());
ShowToastDialog.showLoader(
ConstTexts.pleaseWait.tr(),
);
LocationData location =
await controller.currentLocation.value
@@ -2741,8 +2740,7 @@ class CabBookingScreen extends StatelessWidget {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
ConstTexts.yourSosRequest.tr()
ConstTexts.yourSosRequest.tr(),
),
backgroundColor: Colors.green,
duration: Duration(seconds: 3),
@@ -2754,7 +2752,9 @@ class CabBookingScreen extends StatelessWidget {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
ConstTexts.yourSosrequestAlreadySubmitted.tr()
ConstTexts
.yourSosrequestAlreadySubmitted
.tr(),
),
backgroundColor: Colors.red,
duration: Duration(seconds: 3),
@@ -2822,7 +2822,8 @@ class CabBookingScreen extends StatelessWidget {
Constant.userModel!.walletAmount! <
controller.totalAmount.value) {
ShowToastDialog.showToast(
ConstTexts.youDoNothaveSufficientwalletBalance.tr()
ConstTexts.youDoNothaveSufficientwalletBalance
.tr(),
);
} else {
controller.completeOrder();
@@ -2858,8 +2859,7 @@ class CabBookingScreen extends StatelessWidget {
if (value == null) {
Get.back();
ShowToastDialog.showToast(
ConstTexts.somethingWentWrong.tr()
ConstTexts.somethingWentWrong.tr(),
);
} else {
CreateRazorPayOrderModel result = value;
@@ -2873,7 +2873,7 @@ class CabBookingScreen extends StatelessWidget {
});
} else {
ShowToastDialog.showToast(
ConstTexts.plsSelectPaymentMethod.tr(),
ConstTexts.plsSelectPaymentMethod.tr(),
);
}
},

View File

@@ -9,7 +9,7 @@ import 'package:customer/widget/my_separator.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
class CabCouponCodeScreen extends StatelessWidget {
const CabCouponCodeScreen({super.key});
@@ -34,12 +34,30 @@ class CabCouponCodeScreen extends StatelessWidget {
child: Container(
height: 42,
width: 42,
decoration: BoxDecoration(shape: BoxShape.circle, color: AppThemeData.grey50),
child: Center(child: Padding(padding: const EdgeInsets.only(left: 5), child: Icon(Icons.arrow_back_ios, color: AppThemeData.grey900, size: 20))),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppThemeData.grey50,
),
child: Center(
child: Padding(
padding: const EdgeInsets.only(left: 5),
child: Icon(
Icons.arrow_back_ios,
color: AppThemeData.grey900,
size: 20,
),
),
),
),
),
const SizedBox(width: 10),
Text(ConstTexts.coupon.tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
Text(
ConstTexts.coupon.tr(),
style: AppThemeData.boldTextStyle(
fontSize: 18,
color: AppThemeData.grey900,
),
),
],
),
),
@@ -48,24 +66,44 @@ class CabCouponCodeScreen extends StatelessWidget {
controller.isLoading.value
? Constant.loader()
: controller.cabCouponList.isEmpty
? Constant.showEmptyView(message: ConstTexts.couponNotFound.tr())
? Constant.showEmptyView(
message: ConstTexts.couponNotFound.tr(),
)
: ListView.builder(
shrinkWrap: true,
itemCount: controller.cabCouponList.length,
itemBuilder: (context, index) {
CouponModel couponModel = controller.cabCouponList[index];
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 10,
),
child: Container(
height: Responsive.height(16, context),
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10))),
decoration: ShapeDecoration(
color:
isDark
? AppThemeData.grey900
: AppThemeData.grey50,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
child: Row(
children: [
ClipRRect(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)),
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),
),
child: Stack(
children: [
Image.asset("assets/images/ic_coupon_image.png", height: Responsive.height(16, context), fit: BoxFit.fill),
Image.asset(
"assets/images/ic_coupon_image.png",
height: Responsive.height(16, context),
fit: BoxFit.fill,
),
Padding(
padding: const EdgeInsets.only(left: 10),
child: Align(
@@ -75,7 +113,14 @@ class CabCouponCodeScreen extends StatelessWidget {
child: Text(
"${couponModel.discountType == "Fix Price" ? Constant.amountShow(amount: couponModel.discount) : "${couponModel.discount}%"} ${'Off'.tr}",
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),
style: TextStyle(
fontFamily: AppThemeData.semiBold,
fontSize: 16,
color:
isDark
? AppThemeData.grey50
: AppThemeData.grey50,
),
),
),
),
@@ -85,24 +130,53 @@ class CabCouponCodeScreen extends StatelessWidget {
),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18),
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 18,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [
DottedBorder(
options: RoundedRectDottedBorderOptions(strokeWidth: 1, radius: const Radius.circular(6), color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
options:
RoundedRectDottedBorderOptions(
strokeWidth: 1,
radius: const Radius.circular(
6,
),
color:
isDark
? AppThemeData.grey400
: AppThemeData
.grey500,
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
padding:
const EdgeInsets.symmetric(
horizontal: 16,
),
child: Text(
"${couponModel.code}",
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
style: TextStyle(
fontFamily:
AppThemeData.semiBold,
fontSize: 16,
color:
isDark
? AppThemeData.grey400
: AppThemeData
.grey500,
),
),
),
),
const Expanded(child: SizedBox(height: 10)),
const Expanded(
child: SizedBox(height: 10),
),
InkWell(
onTap: () {
Get.back(result: couponModel);
@@ -110,18 +184,38 @@ class CabCouponCodeScreen extends StatelessWidget {
child: Text(
ConstTexts.tapToApply.tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
style: TextStyle(
fontFamily: AppThemeData.medium,
color:
isDark
? AppThemeData
.primary300
: AppThemeData
.primary300,
),
),
),
],
),
const SizedBox(height: 20),
MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200),
MySeparator(
color:
isDark
? AppThemeData.grey700
: AppThemeData.grey200,
),
const SizedBox(height: 20),
Text(
"${couponModel.description}",
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
style: TextStyle(
fontFamily: AppThemeData.medium,
fontSize: 16,
color:
isDark
? AppThemeData.grey50
: AppThemeData.grey900,
),
),
],
),

View File

@@ -7,7 +7,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
class CabDashboardScreen extends StatelessWidget {
const CabDashboardScreen({super.key});

View File

@@ -10,7 +10,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
import 'Intercity_home_screen.dart';
import 'cab_booking_screen.dart';
@@ -123,7 +123,7 @@ class CabHomeScreen extends HookWidget {
CrossAxisAlignment.start,
children: [
Text(
ConstTexts.everyRideVerified.tr(),
ConstTexts.everyRideVerified.tr(),
style: AppThemeData.boldTextStyle(
color:
isDark
@@ -133,8 +133,7 @@ class CabHomeScreen extends HookWidget {
),
),
Text(
ConstTexts.allDriversIDCheck
.tr(),
ConstTexts.allDriversIDCheck.tr(),
style: AppThemeData.mediumTextStyle(
color:
isDark

View File

@@ -4,7 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
import '../../constant/constant.dart';
import '../../controllers/cab_order_details_controller.dart';
import '../../controllers/theme_controller.dart';

View File

@@ -4,7 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' hide Trans;
import '../../constant/constant.dart';
import '../../controllers/theme_controller.dart';
import '../../themes/app_them_data.dart';

View File

@@ -2,7 +2,7 @@ import 'package:customer/constant/const_texts.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';
import 'package:get/get.dart' hide Trans;
import '../../controllers/complain_controller.dart';
import '../../controllers/theme_controller.dart';
import '../../themes/app_them_data.dart';
@@ -35,12 +35,27 @@ class ComplainScreen extends StatelessWidget {
child: Container(
height: 42,
width: 42,
decoration: BoxDecoration(shape: BoxShape.circle, color: AppThemeData.grey50),
child: const Center(child: Icon(Icons.arrow_back_ios, color: AppThemeData.grey900, size: 20)),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppThemeData.grey50,
),
child: const Center(
child: Icon(
Icons.arrow_back_ios,
color: AppThemeData.grey900,
size: 20,
),
),
),
),
const SizedBox(width: 10),
Text(ConstTexts.complain.tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
Text(
ConstTexts.complain.tr(),
style: AppThemeData.boldTextStyle(
fontSize: 18,
color: AppThemeData.grey900,
),
),
],
),
),
@@ -52,11 +67,30 @@ class ComplainScreen extends StatelessWidget {
padding: const EdgeInsets.all(16),
child: Column(
children: [
Obx(() => TextFieldWidget(title: ConstTexts.title.tr(), hintText: ConstTexts.title.tr(), controller: controller.title.value)),
Obx(
() => TextFieldWidget(
title: ConstTexts.title.tr(),
hintText: ConstTexts.title.tr(),
controller: controller.title.value,
),
),
const SizedBox(height: 10),
Obx(() => TextFieldWidget(title:ConstTexts.complain.tr(), hintText: ConstTexts.typeDescription.tr(), controller: controller.comment.value, maxLine: 8)),
Obx(
() => TextFieldWidget(
title: ConstTexts.complain.tr(),
hintText: ConstTexts.typeDescription.tr(),
controller: controller.comment.value,
maxLine: 8,
),
),
const SizedBox(height: 20),
RoundedButtonFill( borderRadius: 10.r,title: ConstTexts.save.tr(), color: AppThemeData.primary300, textColor: AppThemeData.grey50, onPress: () => controller.submitComplain()),
RoundedButtonFill(
borderRadius: 10.r,
title: ConstTexts.save.tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
onPress: () => controller.submitComplain(),
),
],
),
),

View File

@@ -9,7 +9,7 @@ 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';
import 'package:get/get.dart' hide Trans;
import '../../constant/constant.dart';
import '../../controllers/my_cab_booking_controller.dart';
import '../../controllers/theme_controller.dart';
@@ -33,14 +33,27 @@ class MyCabBookingScreen extends StatelessWidget {
// length: controller.tabTitles.length,
// initialIndex: controller.tabTitles.indexOf(controller.selectedTab.value),
length: controller.tabKeys.length,
initialIndex: controller.tabKeys.indexOf(controller.selectedTab.value),
initialIndex: controller.tabKeys.indexOf(
controller.selectedTab.value,
),
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: AppThemeData.primary300,
title: Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Row(children: [const SizedBox(width: 10), Text(ConstTexts.rideHistory.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(
preferredSize: const Size.fromHeight(48),
@@ -53,7 +66,9 @@ class MyCabBookingScreen extends StatelessWidget {
labelColor: AppThemeData.taxiBooking500,
unselectedLabelColor: AppThemeData.taxiBooking500,
labelStyle: AppThemeData.boldTextStyle(fontSize: 14),
unselectedLabelStyle: AppThemeData.mediumTextStyle(fontSize: 14),
unselectedLabelStyle: AppThemeData.mediumTextStyle(
fontSize: 14,
),
tabs:
controller.tabKeys
.map(
@@ -63,7 +78,9 @@ class MyCabBookingScreen extends StatelessWidget {
child: Text(
controller.getLocalizedTabTitle(key),
textAlign: TextAlign.center,
overflow: TextOverflow.visible, // 👈 show full text
overflow:
TextOverflow
.visible, // 👈 show full text
),
),
),
@@ -83,16 +100,33 @@ class MyCabBookingScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(ConstTexts.plsLoginToAcc.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(
ConstTexts.youAreNotLoggedIn.tr(),
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),
RoundedButtonFill(
borderRadius: 10.r,
borderRadius: 10.r,
title: ConstTexts.login.tr(),
width: 55,
height: 5.5,
@@ -111,7 +145,17 @@ class MyCabBookingScreen extends StatelessWidget {
final orders = controller.getOrdersForTab(title);
if (orders.isEmpty) {
return Center(child: Text(ConstTexts.noOrderfound.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(
@@ -121,74 +165,150 @@ class MyCabBookingScreen extends StatelessWidget {
CabOrderModel order = orders[index];
return GestureDetector(
onTap: () {
Get.to(() => CabOrderDetails(), arguments: {"cabOrderModel": order});
Get.to(
() => CabOrderDetails(),
arguments: {"cabOrderModel": order},
);
},
child: Container(
margin: const EdgeInsets.only(bottom: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: isDark ? AppThemeData.greyDark50 : AppThemeData.grey50,
color:
isDark
? AppThemeData.greyDark50
: AppThemeData.grey50,
borderRadius: BorderRadius.circular(15),
border: Border.all(color: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200),
border: Border.all(
color:
isDark
? AppThemeData.greyDark200
: AppThemeData.grey200,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${'Booking Date:'.tr} ${controller.formatDate(order.scheduleDateTime!)}",
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,
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Column(
children: [
Icon(Icons.stop_circle_outlined, color: Colors.green),
DottedBorder(
options: CustomPathDottedBorderOptions(
color: Colors.grey.shade400,
strokeWidth: 2,
dashPattern: [4, 4],
customPath:
(size) =>
Path()
..moveTo(size.width / 2, 0)
..lineTo(size.width / 2, size.height),
),
child: const SizedBox(width: 20, height: 55),
Icon(
Icons.stop_circle_outlined,
color: Colors.green,
),
DottedBorder(
options:
CustomPathDottedBorderOptions(
color:
Colors
.grey
.shade400,
strokeWidth: 2,
dashPattern: [4, 4],
customPath:
(size) =>
Path()
..moveTo(
size.width /
2,
0,
)
..lineTo(
size.width /
2,
size.height,
),
),
child: const SizedBox(
width: 20,
height: 55,
),
),
Icon(
Icons.radio_button_checked,
color: Colors.red,
),
Icon(Icons.radio_button_checked, color: Colors.red),
],
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [
// Source Location Name
Expanded(
child: Text(
order.sourceLocationName.toString(),
style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
order
.sourceLocationName
.toString(),
style: AppThemeData.semiBoldTextStyle(
fontSize: 16,
color:
isDark
? AppThemeData
.greyDark900
: AppThemeData
.grey900,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
overflow:
TextOverflow
.ellipsis,
),
),
const SizedBox(width: 8),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(color: AppThemeData.warning300, width: 1),
color: AppThemeData.warning50,
borderRadius:
BorderRadius.circular(
10,
),
border: Border.all(
color:
AppThemeData
.warning300,
width: 1,
),
color:
AppThemeData
.warning50,
),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
padding:
const EdgeInsets.symmetric(
vertical: 8,
horizontal: 12,
),
child: Text(
order.status.toString(),
style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.warning500),
overflow: TextOverflow.ellipsis,
order.status
.toString(),
style: AppThemeData.boldTextStyle(
fontSize: 14,
color:
AppThemeData
.warning500,
),
overflow:
TextOverflow
.ellipsis,
),
),
],
@@ -196,46 +316,114 @@ class MyCabBookingScreen extends StatelessWidget {
SizedBox(height: 15),
DottedBorder(
options: CustomPathDottedBorderOptions(
color: Colors.grey.shade400,
color:
Colors.grey.shade400,
strokeWidth: 2,
dashPattern: [4, 4],
customPath:
(size) =>
Path()
..moveTo(0, size.height / 2) // start from left center
..lineTo(size.width, size.height / 2), // draw to right center
..moveTo(
0,
size.height /
2,
) // start from left center
..lineTo(
size.width,
size.height /
2,
), // draw to right center
),
child: const SizedBox(
width: 295,
height: 3,
),
child: const SizedBox(width: 295, height: 3),
),
SizedBox(height: 15),
Text(
order.destinationLocationName.toString(),
style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
order
.destinationLocationName
.toString(),
style:
AppThemeData.semiBoldTextStyle(
fontSize: 16,
color:
isDark
? AppThemeData
.greyDark900
: AppThemeData
.grey900,
),
),
],
),
),
],
),
if (Constant.isEnableOTPTripStart == true)
if (Constant.isEnableOTPTripStart ==
true)
Row(
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text("Otp :", 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)),
Text(
order.otpCode ?? '',
style:
AppThemeData.semiBoldTextStyle(
fontSize: 16,
color:
isDark
? AppThemeData
.greyDark900
: AppThemeData
.grey900,
),
),
],
),
if (order.status == Constant.orderInTransit && order.paymentStatus == false) SizedBox(height: 14),
order.status == Constant.orderInTransit && order.paymentStatus == false
if (order.status ==
Constant.orderInTransit &&
order.paymentStatus == false)
SizedBox(height: 14),
order.status ==
Constant.orderInTransit &&
order.paymentStatus == false
? RoundedButtonFill(
borderRadius: 10.r,
borderRadius: 10.r,
title: ConstTexts.payNow.tr(),
onPress: () async {
controller.selectedPaymentMethod.value = order.paymentMethod.toString();
controller.calculateTotalAmount(order);
Get.bottomSheet(paymentBottomSheet(context, controller, isDark), isScrollControlled: true, backgroundColor: Colors.transparent);
controller
.selectedPaymentMethod
.value = order.paymentMethod
.toString();
controller.calculateTotalAmount(
order,
);
Get.bottomSheet(
paymentBottomSheet(
context,
controller,
isDark,
),
isScrollControlled: true,
backgroundColor:
Colors.transparent,
);
},
color: AppThemeData.primary300,
textColor: AppThemeData.grey900,
@@ -255,7 +443,11 @@ class MyCabBookingScreen extends StatelessWidget {
);
}
Widget paymentBottomSheet(BuildContext context, MyCabBookingController controller, bool isDark) {
Widget paymentBottomSheet(
BuildContext context,
MyCabBookingController controller,
bool isDark,
) {
return DraggableScrollableSheet(
initialChildSize: 0.70,
// Start height
@@ -268,14 +460,26 @@ class MyCabBookingScreen extends StatelessWidget {
builder: (context, scrollController) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
decoration: BoxDecoration(color: isDark ? AppThemeData.grey500 : Colors.white, borderRadius: BorderRadius.vertical(top: Radius.circular(24))),
decoration: BoxDecoration(
color: isDark ? AppThemeData.grey500 : Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(ConstTexts.selectPaymentMethod.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(
onTap: () {
Get.back();
@@ -290,40 +494,88 @@ class MyCabBookingScreen extends StatelessWidget {
padding: EdgeInsets.zero,
controller: scrollController,
children: [
Text(ConstTexts.prefferedPayment.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),
if (controller.walletSettingModel.value.isEnabled == true || controller.cashOnDeliverySettingModel.value.isEnabled == true)
if (controller.walletSettingModel.value.isEnabled == true ||
controller.cashOnDeliverySettingModel.value.isEnabled ==
true)
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: isDark ? AppThemeData.greyDark50 : AppThemeData.grey50,
border: Border.all(color: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200),
color:
isDark
? AppThemeData.greyDark50
: 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"),
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"),
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)
if (controller.walletSettingModel.value.isEnabled == true ||
controller.cashOnDeliverySettingModel.value.isEnabled ==
true)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 10),
Text(
ConstTexts.otherPaymentOptions.tr(),
ConstTexts.otherPaymentOptions.tr(),
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,
),
),
const SizedBox(height: 10),
],
@@ -331,32 +583,129 @@ class MyCabBookingScreen extends StatelessWidget {
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: isDark ? AppThemeData.greyDark50 : AppThemeData.grey50,
border: Border.all(color: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200),
color:
isDark
? AppThemeData.greyDark50
: 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"),
visible:
controller.stripeModel.value.isEnabled ==
true,
child: cardDecoration(
controller,
PaymentGateway.stripe,
isDark,
"assets/images/stripe.png",
),
),
Visibility(
visible: controller.flutterWaveModel.value.isEnable == true,
child: cardDecoration(controller, PaymentGateway.flutterWave, isDark, "assets/images/flutterwave_logo.png"),
visible:
controller.payPalModel.value.isEnabled ==
true,
child: cardDecoration(
controller,
PaymentGateway.paypal,
isDark,
"assets/images/paypal.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"),
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",
),
),
Visibility(visible: controller.xenditModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.xendit, isDark, "assets/images/xendit.png")),
],
),
),
@@ -366,52 +715,109 @@ class MyCabBookingScreen extends StatelessWidget {
),
),
RoundedButtonFill(
borderRadius: 10.r,
borderRadius: 10.r,
title: ConstTexts.continueT.tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey900,
onPress: () async {
if (controller.selectedPaymentMethod.value.isEmpty) {
ShowToastDialog.showToast(ConstTexts.plsSelectPaymentMethod.tr());
ShowToastDialog.showToast(
ConstTexts.plsSelectPaymentMethod.tr(),
);
} else {
if (controller.selectedPaymentMethod.value == PaymentGateway.stripe.name) {
controller.stripeMakePayment(amount: controller.totalAmount.value.toString());
} else if (controller.selectedPaymentMethod.value == PaymentGateway.paypal.name) {
controller.paypalPaymentSheet(controller.totalAmount.value.toString(), context);
} else if (controller.selectedPaymentMethod.value == PaymentGateway.payStack.name) {
controller.payStackPayment(controller.totalAmount.value.toString());
} else if (controller.selectedPaymentMethod.value == PaymentGateway.mercadoPago.name) {
controller.mercadoPagoMakePayment(context: context, amount: controller.totalAmount.value.toString());
} else if (controller.selectedPaymentMethod.value == PaymentGateway.flutterWave.name) {
controller.flutterWaveInitiatePayment(context: context, amount: controller.totalAmount.value.toString());
} else if (controller.selectedPaymentMethod.value == PaymentGateway.payFast.name) {
controller.payFastPayment(context: context, amount: controller.totalAmount.value.toString());
} else if (controller.selectedPaymentMethod.value == PaymentGateway.cod.name) {
if (controller.selectedPaymentMethod.value ==
PaymentGateway.stripe.name) {
controller.stripeMakePayment(
amount: controller.totalAmount.value.toString(),
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.paypal.name) {
controller.paypalPaymentSheet(
controller.totalAmount.value.toString(),
context,
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.payStack.name) {
controller.payStackPayment(
controller.totalAmount.value.toString(),
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.mercadoPago.name) {
controller.mercadoPagoMakePayment(
context: context,
amount: controller.totalAmount.value.toString(),
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.flutterWave.name) {
controller.flutterWaveInitiatePayment(
context: context,
amount: controller.totalAmount.value.toString(),
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.payFast.name) {
controller.payFastPayment(
context: context,
amount: controller.totalAmount.value.toString(),
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.cod.name) {
controller.completeOrder();
} else if (controller.selectedPaymentMethod.value == PaymentGateway.wallet.name) {
if (Constant.userModel!.walletAmount == null || Constant.userModel!.walletAmount! < controller.totalAmount.value) {
ShowToastDialog.showToast(ConstTexts.youDoNothaveSufficientwalletBalance.tr());
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.wallet.name) {
if (Constant.userModel!.walletAmount == null ||
Constant.userModel!.walletAmount! <
controller.totalAmount.value) {
ShowToastDialog.showToast(
ConstTexts.youDoNothaveSufficientwalletBalance.tr(),
);
} else {
controller.completeOrder();
}
} else if (controller.selectedPaymentMethod.value == PaymentGateway.midTrans.name) {
controller.midtransMakePayment(context: context, amount: controller.totalAmount.value.toString());
} else if (controller.selectedPaymentMethod.value == PaymentGateway.orangeMoney.name) {
controller.orangeMakePayment(context: context, amount: controller.totalAmount.value.toString());
} else if (controller.selectedPaymentMethod.value == PaymentGateway.xendit.name) {
controller.xenditPayment(context, controller.totalAmount.value.toString());
} else if (controller.selectedPaymentMethod.value == PaymentGateway.razorpay.name) {
RazorPayController().createOrderRazorPay(amount: double.parse(controller.totalAmount.value.toString()), razorpayModel: controller.razorPayModel.value).then((value) {
if (value == null) {
Get.back();
ShowToastDialog.showToast(ConstTexts.somethingWentWrong.tr());
} else {
CreateRazorPayOrderModel result = value;
controller.openCheckout(amount: controller.totalAmount.value.toString(), orderId: result.id);
}
});
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.midTrans.name) {
controller.midtransMakePayment(
context: context,
amount: controller.totalAmount.value.toString(),
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.orangeMoney.name) {
controller.orangeMakePayment(
context: context,
amount: controller.totalAmount.value.toString(),
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.xendit.name) {
controller.xenditPayment(
context,
controller.totalAmount.value.toString(),
);
} else if (controller.selectedPaymentMethod.value ==
PaymentGateway.razorpay.name) {
RazorPayController()
.createOrderRazorPay(
amount: double.parse(
controller.totalAmount.value.toString(),
),
razorpayModel: controller.razorPayModel.value,
)
.then((value) {
if (value == null) {
Get.back();
ShowToastDialog.showToast(
ConstTexts.somethingWentWrong.tr(),
);
} else {
CreateRazorPayOrderModel result = value;
controller.openCheckout(
amount: controller.totalAmount.value.toString(),
orderId: result.id,
);
}
});
} else {
ShowToastDialog.showToast(ConstTexts.plsSelectPaymentMethod.tr());
ShowToastDialog.showToast(
ConstTexts.plsSelectPaymentMethod.tr(),
);
}
}
},
@@ -423,7 +829,12 @@ class MyCabBookingScreen extends StatelessWidget {
);
}
Obx cardDecoration(MyCabBookingController controller, PaymentGateway value, isDark, String image) {
Obx cardDecoration(
MyCabBookingController controller,
PaymentGateway value,
isDark,
String image,
) {
return Obx(
() => Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
@@ -438,8 +849,21 @@ class MyCabBookingScreen extends StatelessWidget {
Container(
width: 50,
height: 50,
decoration: ShapeDecoration(shape: RoundedRectangleBorder(side: const BorderSide(width: 1, color: Color(0xFFE5E7EB)), borderRadius: BorderRadius.circular(8))),
child: Padding(padding: EdgeInsets.all(value.name == "payFast" ? 0 : 8.0), child: Image.asset(image)),
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: const BorderSide(
width: 1,
color: Color(0xFFE5E7EB),
),
borderRadius: BorderRadius.circular(8),
),
),
child: Padding(
padding: EdgeInsets.all(
value.name == "payFast" ? 0 : 8.0,
),
child: Image.asset(image),
),
),
const SizedBox(width: 10),
value.name == "wallet"
@@ -450,12 +874,30 @@ class MyCabBookingScreen extends StatelessWidget {
Text(
value.name.capitalizeString(),
textAlign: TextAlign.start,
style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
style: AppThemeData.semiBoldTextStyle(
fontSize: 16,
color:
isDark
? AppThemeData.grey50
: AppThemeData.grey900,
),
),
Text(
Constant.amountShow(amount: Constant.userModel!.walletAmount == null ? '0.0' : Constant.userModel!.walletAmount.toString()),
Constant.amountShow(
amount:
Constant.userModel!.walletAmount == null
? '0.0'
: Constant.userModel!.walletAmount
.toString(),
),
textAlign: TextAlign.start,
style: AppThemeData.semiBoldTextStyle(fontSize: 14, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
style: AppThemeData.semiBoldTextStyle(
fontSize: 14,
color:
isDark
? AppThemeData.primary300
: AppThemeData.primary300,
),
),
],
),
@@ -464,14 +906,23 @@ class MyCabBookingScreen extends StatelessWidget {
child: Text(
value.name.capitalizeString(),
textAlign: TextAlign.start,
style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
style: AppThemeData.semiBoldTextStyle(
fontSize: 16,
color:
isDark
? AppThemeData.grey50
: AppThemeData.grey900,
),
),
),
const Expanded(child: SizedBox()),
Radio(
value: value.name,
groupValue: controller.selectedPaymentMethod.value,
activeColor: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
activeColor:
isDark
? AppThemeData.primary300
: AppThemeData.primary300,
onChanged: (value) {
controller.selectedPaymentMethod.value = value.toString();
},