BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -6,7 +6,7 @@ import 'package:customer/screen_ui/rental_service/rental_order_details_screen.da
|
||||
import 'package:customer/themes/round_button_fill.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;
|
||||
import '../../constant/constant.dart';
|
||||
import '../../controllers/my_rental_booking_controller.dart';
|
||||
import '../../controllers/theme_controller.dart';
|
||||
@@ -25,14 +25,27 @@ class MyRentalBookingScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return DefaultTabController(
|
||||
length: controller.tabTitles.length,
|
||||
initialIndex: controller.tabTitles.indexOf(controller.selectedTab.value),
|
||||
initialIndex: controller.tabTitles.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("Rental History".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900))]),
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"Rental History".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 18,
|
||||
color: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottom: TabBar(
|
||||
onTap: (index) {
|
||||
@@ -42,8 +55,13 @@ class MyRentalBookingScreen extends StatelessWidget {
|
||||
labelColor: AppThemeData.parcelService500,
|
||||
unselectedLabelColor: AppThemeData.parcelService500,
|
||||
labelStyle: AppThemeData.boldTextStyle(fontSize: 13),
|
||||
unselectedLabelStyle: AppThemeData.mediumTextStyle(fontSize: 13),
|
||||
tabs: controller.tabTitles.map((title) => Tab(child: Center(child: Text(title)))).toList(),
|
||||
unselectedLabelStyle: AppThemeData.mediumTextStyle(
|
||||
fontSize: 13,
|
||||
),
|
||||
tabs:
|
||||
controller.tabTitles
|
||||
.map((title) => Tab(child: Center(child: Text(title))))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
body:
|
||||
@@ -56,12 +74,30 @@ class MyRentalBookingScreen 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(
|
||||
"Please Log In to Continue".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(),
|
||||
"You’re not logged in. Please sign in to access your account and explore all features."
|
||||
.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(
|
||||
@@ -80,71 +116,154 @@ class MyRentalBookingScreen extends StatelessWidget {
|
||||
: TabBarView(
|
||||
children:
|
||||
controller.tabTitles.map((title) {
|
||||
List<RentalOrderModel> orders = controller.getOrdersForTab(title);
|
||||
List<RentalOrderModel> orders = controller
|
||||
.getOrdersForTab(title);
|
||||
|
||||
if (orders.isEmpty) {
|
||||
return Center(child: Text("No orders found".tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)));
|
||||
return Center(
|
||||
child: Text(
|
||||
"No orders found".tr(),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: orders.length,
|
||||
itemBuilder: (context, index) {
|
||||
RentalOrderModel order = orders[index]; //use this
|
||||
RentalOrderModel order =
|
||||
orders[index]; //use this
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(() => RentalOrderDetailsScreen(), arguments: order);
|
||||
Get.to(
|
||||
() => RentalOrderDetailsScreen(),
|
||||
arguments: order,
|
||||
);
|
||||
},
|
||||
child: 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,
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(padding: const EdgeInsets.only(top: 5), child: Image.asset("assets/icons/pickup.png", height: 18, width: 18)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 5,
|
||||
),
|
||||
child: Image.asset(
|
||||
"assets/icons/pickup.png",
|
||||
height: 18,
|
||||
width: 18,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
//prevents overflow
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Expanded(
|
||||
//text wraps if too long
|
||||
child: Text(
|
||||
order.sourceLocationName ?? "-",
|
||||
style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
overflow: TextOverflow.ellipsis, //safe cutoff
|
||||
order.sourceLocationName ??
|
||||
"-",
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark900
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
),
|
||||
overflow:
|
||||
TextOverflow
|
||||
.ellipsis, //safe cutoff
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
if (order.status != null) ...[
|
||||
const SizedBox(width: 8),
|
||||
if (order.status !=
|
||||
null) ...[
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
vertical: 6,
|
||||
horizontal: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppThemeData.info50,
|
||||
border: Border.all(color: AppThemeData.info300),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color:
|
||||
AppThemeData
|
||||
.info50,
|
||||
border: Border.all(
|
||||
color:
|
||||
AppThemeData
|
||||
.info300,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
order.status ?? '',
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
AppThemeData
|
||||
.info500,
|
||||
),
|
||||
),
|
||||
child: Text(order.status ?? '', style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.info500)),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
if (order.bookingDateTime != null)
|
||||
if (order.bookingDateTime !=
|
||||
null)
|
||||
Text(
|
||||
Constant.timestampToDateTime(order.bookingDateTime!),
|
||||
style: AppThemeData.mediumTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||
Constant.timestampToDateTime(
|
||||
order.bookingDateTime!,
|
||||
),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark600
|
||||
: AppThemeData
|
||||
.grey600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -152,41 +271,112 @@ class MyRentalBookingScreen extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text("Vehicle Type :".tr(), style: AppThemeData.boldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||
Text(
|
||||
"Vehicle Type :".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
//borderRadius: BorderRadius.circular(10),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: order.rentalVehicleType!.rentalVehicleIcon.toString(),
|
||||
imageUrl:
|
||||
order
|
||||
.rentalVehicleType!
|
||||
.rentalVehicleIcon
|
||||
.toString(),
|
||||
height: 60,
|
||||
width: 60,
|
||||
imageBuilder:
|
||||
(context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), image: DecorationImage(image: imageProvider, fit: BoxFit.cover)),
|
||||
(
|
||||
context,
|
||||
imageProvider,
|
||||
) => Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
10,
|
||||
),
|
||||
image: DecorationImage(
|
||||
image:
|
||||
imageProvider,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
placeholder:
|
||||
(context, url) => Center(
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation(
|
||||
AppThemeData
|
||||
.primary300,
|
||||
),
|
||||
),
|
||||
),
|
||||
errorWidget:
|
||||
(
|
||||
context,
|
||||
url,
|
||||
error,
|
||||
) => Image.network(
|
||||
Constant
|
||||
.placeHolderImage,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
placeholder: (context, url) => Center(child: CircularProgressIndicator.adaptive(valueColor: AlwaysStoppedAnimation(AppThemeData.primary300))),
|
||||
errorWidget: (context, url, error) => Image.network(Constant.placeHolderImage, fit: BoxFit.cover),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Text(
|
||||
"${order.rentalVehicleType!.name}",
|
||||
style: AppThemeData.semiBoldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark900
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 2.0),
|
||||
padding:
|
||||
const EdgeInsets.only(
|
||||
top: 2.0,
|
||||
),
|
||||
child: Text(
|
||||
"${order.rentalVehicleType!.shortDescription}",
|
||||
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark600
|
||||
: AppThemeData
|
||||
.grey600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -196,60 +386,143 @@ class MyRentalBookingScreen extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
Text("Package info :".tr(), style: AppThemeData.boldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||
Text(
|
||||
"Package info :".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
order.rentalPackageModel!.name.toString(),
|
||||
style: AppThemeData.semiBoldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
order
|
||||
.rentalPackageModel!
|
||||
.name
|
||||
.toString(),
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark900
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
order.rentalPackageModel!.description.toString(),
|
||||
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||
order
|
||||
.rentalPackageModel!
|
||||
.description
|
||||
.toString(),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark600
|
||||
: AppThemeData
|
||||
.grey600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
Constant.amountShow(amount: order.rentalPackageModel!.baseFare.toString()),
|
||||
style: AppThemeData.boldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
order
|
||||
.rentalPackageModel!
|
||||
.baseFare
|
||||
.toString(),
|
||||
),
|
||||
style:
|
||||
AppThemeData.boldTextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark900
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (Constant.isEnableOTPTripStartForRental == true)
|
||||
Text("${'OTP :'.tr()} ${order.otpCode}", style: AppThemeData.boldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||
if (Constant
|
||||
.isEnableOTPTripStartForRental ==
|
||||
true)
|
||||
Text(
|
||||
"${'OTP :'.tr()} ${order.otpCode}",
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
order.status == Constant.orderInTransit && order.paymentStatus == false
|
||||
order.status ==
|
||||
Constant
|
||||
.orderInTransit &&
|
||||
order.paymentStatus == false
|
||||
? Expanded(
|
||||
child: RoundedButtonFill(
|
||||
title: "Pay Now",
|
||||
onPress: () {
|
||||
Get.to(() => RentalOrderDetailsScreen(), arguments: order);
|
||||
Get.to(
|
||||
() =>
|
||||
RentalOrderDetailsScreen(),
|
||||
arguments: order,
|
||||
);
|
||||
},
|
||||
color: AppThemeData.primary300,
|
||||
textColor: AppThemeData.grey900,
|
||||
color:
|
||||
AppThemeData.primary300,
|
||||
textColor:
|
||||
AppThemeData.grey900,
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
order.status == Constant.orderPlaced || order.status == Constant.driverAccepted
|
||||
order.status ==
|
||||
Constant.orderPlaced ||
|
||||
order.status ==
|
||||
Constant.driverAccepted
|
||||
? Expanded(
|
||||
child: RoundedButtonFill(
|
||||
title: "Cancel Booking",
|
||||
onPress: () => controller.cancelRentalRequest(order, taxList: order.taxSetting),
|
||||
color: AppThemeData.danger300,
|
||||
textColor: AppThemeData.surface,
|
||||
onPress:
|
||||
() => controller
|
||||
.cancelRentalRequest(
|
||||
order,
|
||||
taxList:
|
||||
order
|
||||
.taxSetting,
|
||||
),
|
||||
color:
|
||||
AppThemeData.danger300,
|
||||
textColor:
|
||||
AppThemeData.surface,
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
@@ -269,7 +542,12 @@ class MyRentalBookingScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Obx cardDecoration(MyRentalBookingController controller, PaymentGateway value, isDark, String image) {
|
||||
Obx cardDecoration(
|
||||
MyRentalBookingController controller,
|
||||
PaymentGateway value,
|
||||
isDark,
|
||||
String image,
|
||||
) {
|
||||
return Obx(
|
||||
() => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
@@ -284,8 +562,21 @@ class MyRentalBookingScreen 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"
|
||||
@@ -296,12 +587,30 @@ class MyRentalBookingScreen 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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -310,14 +619,23 @@ class MyRentalBookingScreen 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();
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../controllers/rental_conformation_controller.dart';
|
||||
import '../../controllers/theme_controller.dart';
|
||||
import '../../themes/app_them_data.dart';
|
||||
@@ -38,12 +38,30 @@ class RentalConformationScreen 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("Confirm Rent a Car".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
|
||||
Text(
|
||||
"Confirm Rent a Car".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 18,
|
||||
color: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -61,26 +79,56 @@ class RentalConformationScreen 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,
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Image.asset("assets/icons/pickup.png", height: 15, width: 15),
|
||||
Image.asset(
|
||||
"assets/icons/pickup.png",
|
||||
height: 15,
|
||||
width: 15,
|
||||
),
|
||||
SizedBox(width: 15),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"${controller.rentalOrderModel.value.sourceLocationName}",
|
||||
style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.timestampToDate(controller.rentalOrderModel.value.bookingDateTime!),
|
||||
style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||
Constant.timestampToDate(
|
||||
controller
|
||||
.rentalOrderModel
|
||||
.value
|
||||
.bookingDateTime!,
|
||||
),
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark600
|
||||
: AppThemeData.grey600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -92,38 +140,96 @@ class RentalConformationScreen 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,
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Your Preference".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
|
||||
Text(
|
||||
"Your Preference".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark500
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
controller.rentalOrderModel.value.rentalPackageModel!.name.toString(),
|
||||
style: AppThemeData.semiBoldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
controller
|
||||
.rentalOrderModel
|
||||
.value
|
||||
.rentalPackageModel!
|
||||
.name
|
||||
.toString(),
|
||||
style:
|
||||
AppThemeData.semiBoldTextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark900
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
controller.rentalOrderModel.value.rentalPackageModel!.description.toString(),
|
||||
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||
controller
|
||||
.rentalOrderModel
|
||||
.value
|
||||
.rentalPackageModel!
|
||||
.description
|
||||
.toString(),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark600
|
||||
: AppThemeData.grey600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
Constant.amountShow(amount: controller.rentalOrderModel.value.rentalPackageModel!.baseFare.toString()),
|
||||
style: AppThemeData.boldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller
|
||||
.rentalOrderModel
|
||||
.value
|
||||
.rentalPackageModel!
|
||||
.baseFare
|
||||
.toString(),
|
||||
),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -134,35 +240,81 @@ class RentalConformationScreen 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,
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Vehicle Type".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
|
||||
Text(
|
||||
"Vehicle Type".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark500
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadiusGeometry.circular(10),
|
||||
child: NetworkImageWidget(imageUrl: controller.rentalOrderModel.value.rentalVehicleType!.rentalVehicleIcon.toString(), height: 50, width: 50, borderRadius: 10),
|
||||
borderRadius:
|
||||
BorderRadiusGeometry.circular(10),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl:
|
||||
controller
|
||||
.rentalOrderModel
|
||||
.value
|
||||
.rentalVehicleType!
|
||||
.rentalVehicleIcon
|
||||
.toString(),
|
||||
height: 50,
|
||||
width: 50,
|
||||
borderRadius: 10,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"${controller.rentalOrderModel.value.rentalVehicleType!.name}",
|
||||
style: AppThemeData.semiBoldTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
style:
|
||||
AppThemeData.semiBoldTextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.greyDark900
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${controller.rentalOrderModel.value.rentalVehicleType!.shortDescription}",
|
||||
style: AppThemeData.mediumTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark600
|
||||
: AppThemeData.grey600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -176,24 +328,53 @@ class RentalConformationScreen extends StatelessWidget {
|
||||
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: Text("Coupons".tr(), style: AppThemeData.boldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900))),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Coupons".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.to(RentalCouponScreen())!.then((value) {
|
||||
if (value != null) {
|
||||
double couponAmount = Constant.calculateDiscount(amount: controller.subTotal.value.toString(), offerModel: value);
|
||||
if (couponAmount < controller.subTotal.value) {
|
||||
controller.selectedCouponModel.value = value;
|
||||
double couponAmount =
|
||||
Constant.calculateDiscount(
|
||||
amount:
|
||||
controller.subTotal.value
|
||||
.toString(),
|
||||
offerModel: value,
|
||||
);
|
||||
if (couponAmount <
|
||||
controller.subTotal.value) {
|
||||
controller.selectedCouponModel.value =
|
||||
value;
|
||||
controller.calculateAmount();
|
||||
} else {
|
||||
ShowToastDialog.showToast("This offer not eligible for this booking".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"This offer not eligible for this booking"
|
||||
.tr(),
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
"View All".tr(),
|
||||
style: AppThemeData.boldTextStyle(decoration: TextDecoration.underline, fontSize: 14, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -202,21 +383,44 @@ class RentalConformationScreen extends StatelessWidget {
|
||||
|
||||
// Coupon input
|
||||
DottedBorder(
|
||||
options: RoundedRectDottedBorderOptions(strokeWidth: 1, radius: const Radius.circular(10), color: isDark ? AppThemeData.parcelServiceDark300 : AppThemeData.primary300),
|
||||
options: RoundedRectDottedBorderOptions(
|
||||
strokeWidth: 1,
|
||||
radius: const Radius.circular(10),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.parcelServiceDark300
|
||||
: AppThemeData.primary300,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: AppThemeData.parcelService50, borderRadius: BorderRadius.circular(10)),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: AppThemeData.parcelService50,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_coupon_parcel.svg", height: 28, width: 28),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_coupon_parcel.svg",
|
||||
height: 28,
|
||||
width: 28,
|
||||
),
|
||||
SizedBox(width: 15),
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
controller: controller.couponController.value,
|
||||
style: AppThemeData.semiBoldTextStyle(color: AppThemeData.grey900),
|
||||
controller:
|
||||
controller.couponController.value,
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
color: AppThemeData.grey900,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: "Write coupon code".tr(),
|
||||
hintStyle: AppThemeData.mediumTextStyle(fontSize: 16, color: AppThemeData.parcelService500),
|
||||
hintStyle: AppThemeData.mediumTextStyle(
|
||||
fontSize: 16,
|
||||
color: AppThemeData.parcelService500,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
),
|
||||
),
|
||||
@@ -224,22 +428,61 @@ class RentalConformationScreen extends StatelessWidget {
|
||||
RoundedButtonFill(
|
||||
title: "Redeem now".tr(),
|
||||
onPress: () {
|
||||
if (controller.couponList.where((element) => element.code!.toLowerCase() == controller.couponController.value.text.toLowerCase()).isNotEmpty) {
|
||||
CouponModel couponModel = controller.couponList.firstWhere((p0) => p0.code!.toLowerCase() == controller.couponController.value.text.toLowerCase());
|
||||
if (couponModel.expiresAt!.toDate().isAfter(DateTime.now())) {
|
||||
double couponAmount = Constant.calculateDiscount(amount: controller.subTotal.value.toString(), offerModel: couponModel);
|
||||
if (couponAmount < controller.subTotal.value) {
|
||||
controller.selectedCouponModel.value = couponModel;
|
||||
if (controller.couponList
|
||||
.where(
|
||||
(element) =>
|
||||
element.code!.toLowerCase() ==
|
||||
controller
|
||||
.couponController
|
||||
.value
|
||||
.text
|
||||
.toLowerCase(),
|
||||
)
|
||||
.isNotEmpty) {
|
||||
CouponModel couponModel = controller
|
||||
.couponList
|
||||
.firstWhere(
|
||||
(p0) =>
|
||||
p0.code!.toLowerCase() ==
|
||||
controller
|
||||
.couponController
|
||||
.value
|
||||
.text
|
||||
.toLowerCase(),
|
||||
);
|
||||
if (couponModel.expiresAt!
|
||||
.toDate()
|
||||
.isAfter(DateTime.now())) {
|
||||
double couponAmount =
|
||||
Constant.calculateDiscount(
|
||||
amount:
|
||||
controller.subTotal.value
|
||||
.toString(),
|
||||
offerModel: couponModel,
|
||||
);
|
||||
if (couponAmount <
|
||||
controller.subTotal.value) {
|
||||
controller
|
||||
.selectedCouponModel
|
||||
.value = couponModel;
|
||||
controller.calculateAmount();
|
||||
controller.update();
|
||||
} else {
|
||||
ShowToastDialog.showToast("This offer not eligible for this booking".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"This offer not eligible for this booking"
|
||||
.tr(),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast("This coupon code has been expired".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"This coupon code has been expired"
|
||||
.tr(),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast("Invalid coupon code".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Invalid coupon code".tr(),
|
||||
);
|
||||
}
|
||||
},
|
||||
borderRadius: 10,
|
||||
@@ -257,45 +500,104 @@ class RentalConformationScreen 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,
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Order Summary".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey500)),
|
||||
Text(
|
||||
"Order Summary".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 14,
|
||||
color: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// Subtotal
|
||||
_summaryTile("Subtotal".tr(), Constant.amountShow(amount: controller.subTotal.value.toString()), isDark, null),
|
||||
_summaryTile(
|
||||
"Subtotal".tr(),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller.subTotal.value.toString(),
|
||||
),
|
||||
isDark,
|
||||
null,
|
||||
),
|
||||
|
||||
// Discount
|
||||
_summaryTile("Discount".tr(), Constant.amountShow(amount: controller.discount.value.toString()), isDark, AppThemeData.dangerDark300),
|
||||
_summaryTile(
|
||||
"Discount".tr(),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller.discount.value.toString(),
|
||||
),
|
||||
isDark,
|
||||
AppThemeData.dangerDark300,
|
||||
),
|
||||
|
||||
// Tax List
|
||||
...List.generate(controller.rentalOrderModel.value.taxSetting!.length, (index) {
|
||||
final taxModel = controller.rentalOrderModel.value.taxSetting![index];
|
||||
final taxTitle = "${taxModel.title} ${taxModel.type == 'fix' ? '(${Constant.amountShow(amount: taxModel.tax)})' : '(${taxModel.tax}%)'}";
|
||||
...List.generate(
|
||||
controller
|
||||
.rentalOrderModel
|
||||
.value
|
||||
.taxSetting!
|
||||
.length,
|
||||
(index) {
|
||||
final taxModel =
|
||||
controller
|
||||
.rentalOrderModel
|
||||
.value
|
||||
.taxSetting![index];
|
||||
final taxTitle =
|
||||
"${taxModel.title} ${taxModel.type == 'fix' ? '(${Constant.amountShow(amount: taxModel.tax)})' : '(${taxModel.tax}%)'}";
|
||||
|
||||
return _summaryTile(
|
||||
taxTitle,
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
Constant.getTaxValue(
|
||||
amount: (controller.subTotal.value - controller.discount.value).toString(),
|
||||
taxModel: controller.rentalOrderModel.value.taxSetting![index],
|
||||
).toString(),
|
||||
),
|
||||
isDark,
|
||||
null,
|
||||
);
|
||||
}),
|
||||
return _summaryTile(
|
||||
taxTitle,
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
Constant.getTaxValue(
|
||||
amount:
|
||||
(controller.subTotal.value -
|
||||
controller
|
||||
.discount
|
||||
.value)
|
||||
.toString(),
|
||||
taxModel:
|
||||
controller
|
||||
.rentalOrderModel
|
||||
.value
|
||||
.taxSetting![index],
|
||||
).toString(),
|
||||
),
|
||||
isDark,
|
||||
null,
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
|
||||
// Total
|
||||
_summaryTile("Order Total".tr(), Constant.amountShow(amount: controller.totalAmount.value.toString()), isDark, null),
|
||||
_summaryTile(
|
||||
"Order Total".tr(),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller.totalAmount.value.toString(),
|
||||
),
|
||||
isDark,
|
||||
null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -324,8 +626,22 @@ class RentalConformationScreen extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(title, style: AppThemeData.mediumTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
|
||||
Text(value, style: AppThemeData.semiBoldTextStyle(fontSize: title == "Order Total" ? 18 : 16, color: colors ?? (isDark ? AppThemeData.greyDark900 : AppThemeData.grey900))),
|
||||
Text(
|
||||
title,
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
value,
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
fontSize: title == "Order Total" ? 18 : 16,
|
||||
color:
|
||||
colors ??
|
||||
(isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -8,7 +8,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 RentalCouponScreen extends StatelessWidget {
|
||||
const RentalCouponScreen({super.key});
|
||||
@@ -33,12 +33,30 @@ class RentalCouponScreen 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("Coupon".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
|
||||
Text(
|
||||
"Coupon".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 18,
|
||||
color: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -54,17 +72,35 @@ class RentalCouponScreen extends StatelessWidget {
|
||||
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(
|
||||
@@ -74,7 +110,14 @@ class RentalCouponScreen 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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -84,24 +127,53 @@ class RentalCouponScreen 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);
|
||||
@@ -109,18 +181,38 @@ class RentalCouponScreen extends StatelessWidget {
|
||||
child: Text(
|
||||
"Tap To Apply".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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../controllers/cab_rental_dashboard_controllers.dart';
|
||||
|
||||
class RentalDashboardScreen extends StatelessWidget {
|
||||
@@ -26,12 +26,19 @@ class RentalDashboardScreen extends StatelessWidget {
|
||||
showUnselectedLabels: true,
|
||||
showSelectedLabels: true,
|
||||
selectedFontSize: 12,
|
||||
selectedLabelStyle: const TextStyle(fontFamily: AppThemeData.bold),
|
||||
unselectedLabelStyle: const TextStyle(fontFamily: AppThemeData.bold),
|
||||
selectedLabelStyle: const TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
unselectedLabelStyle: const TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
currentIndex: controller.selectedIndex.value,
|
||||
backgroundColor: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
selectedItemColor: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
unselectedItemColor: isDark ? AppThemeData.grey300 : AppThemeData.grey600,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
selectedItemColor:
|
||||
isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
unselectedItemColor:
|
||||
isDark ? AppThemeData.grey300 : AppThemeData.grey600,
|
||||
onTap: (int index) {
|
||||
if (index == 0) {
|
||||
Get.put(CabDashboardController());
|
||||
@@ -41,15 +48,57 @@ class RentalDashboardScreen extends StatelessWidget {
|
||||
items:
|
||||
Constant.walletSetting == false
|
||||
? [
|
||||
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home_cab.svg", label: 'Home'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_booking_cab.svg", label: 'My Bookings'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr(), controller: controller),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 0,
|
||||
assetIcon: "assets/icons/ic_home_cab.svg",
|
||||
label: 'Home'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 1,
|
||||
assetIcon: "assets/icons/ic_booking_cab.svg",
|
||||
label: 'My Bookings'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 2,
|
||||
assetIcon: "assets/icons/ic_profile.svg",
|
||||
label: 'Profile'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
]
|
||||
: [
|
||||
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home_cab.svg", label: 'Home'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_booking_cab.svg", label: 'My Bookings'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_wallet_cab.svg", label: 'Wallet'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr(), controller: controller),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 0,
|
||||
assetIcon: "assets/icons/ic_home_cab.svg",
|
||||
label: 'Home'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 1,
|
||||
assetIcon: "assets/icons/ic_booking_cab.svg",
|
||||
label: 'My Bookings'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 2,
|
||||
assetIcon: "assets/icons/ic_wallet_cab.svg",
|
||||
label: 'Wallet'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 3,
|
||||
assetIcon: "assets/icons/ic_profile.svg",
|
||||
label: 'Profile'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -58,7 +107,13 @@ class RentalDashboardScreen extends StatelessWidget {
|
||||
});
|
||||
}
|
||||
|
||||
BottomNavigationBarItem navigationBarItem(isDark, {required int index, required String label, required String assetIcon, required CabRentalDashboardControllers controller}) {
|
||||
BottomNavigationBarItem navigationBarItem(
|
||||
isDark, {
|
||||
required int index,
|
||||
required String label,
|
||||
required String assetIcon,
|
||||
required CabRentalDashboardControllers controller,
|
||||
}) {
|
||||
return BottomNavigationBarItem(
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../constant/constant.dart';
|
||||
import '../../controllers/rental_review_controller.dart';
|
||||
import '../../controllers/theme_controller.dart';
|
||||
@@ -28,11 +28,19 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
backgroundColor: AppThemeData.primary300,
|
||||
leading: GestureDetector(
|
||||
onTap: () => Get.back(),
|
||||
child: Icon(Icons.arrow_back_ios, color: isDark ? Colors.white : Colors.black),
|
||||
child: Icon(
|
||||
Icons.arrow_back_ios,
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
controller.ratingModel.value != null ? "Update Review".tr() : "Add Review".tr(),
|
||||
style: TextStyle(color: isDark ? Colors.white : Colors.black, fontSize: 16),
|
||||
controller.ratingModel.value != null
|
||||
? "Update Review".tr()
|
||||
: "Add Review".tr(),
|
||||
style: TextStyle(
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Obx(
|
||||
@@ -44,11 +52,21 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20, right: 20, top: 50, bottom: 20),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 50,
|
||||
bottom: 20,
|
||||
),
|
||||
child: Card(
|
||||
elevation: 2,
|
||||
color: isDark ? AppThemeData.greyDark50 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark50
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 65),
|
||||
@@ -56,11 +74,18 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
children: [
|
||||
// Driver Name
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
padding: const EdgeInsets.only(
|
||||
top: 8.0,
|
||||
),
|
||||
child: Text(
|
||||
controller.order.value!.driver?.fullName() ?? "",
|
||||
controller.order.value!.driver
|
||||
?.fullName() ??
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: isDark ? Colors.white : Colors.black87,
|
||||
color:
|
||||
isDark
|
||||
? Colors.white
|
||||
: Colors.black87,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 18,
|
||||
),
|
||||
@@ -68,12 +93,21 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
),
|
||||
// Car info
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
controller.driverUser.value?.carNumber?.toUpperCase() ?? '',
|
||||
controller
|
||||
.driverUser
|
||||
.value
|
||||
?.carNumber
|
||||
?.toUpperCase() ??
|
||||
'',
|
||||
style: TextStyle(
|
||||
color: isDark ? Colors.white : Colors.black87,
|
||||
color:
|
||||
isDark
|
||||
? Colors.white
|
||||
: Colors.black87,
|
||||
fontFamily: AppThemeData.medium,
|
||||
),
|
||||
),
|
||||
@@ -81,14 +115,22 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
Text(
|
||||
"${controller.driverUser.value?.carName} ${controller.driverUser.value?.carMakes}",
|
||||
style: TextStyle(
|
||||
color: isDark ? Colors.white : Colors.black38,
|
||||
color:
|
||||
isDark
|
||||
? Colors.white
|
||||
: Colors.black38,
|
||||
fontFamily: AppThemeData.medium,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const Padding(padding: EdgeInsets.symmetric(vertical: 12), child: Divider(color: Colors.grey)),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 12,
|
||||
),
|
||||
child: Divider(color: Colors.grey),
|
||||
),
|
||||
|
||||
// Title
|
||||
Padding(
|
||||
@@ -97,7 +139,10 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
'How is your trip?'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
color:
|
||||
isDark
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
@@ -106,10 +151,16 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
'Your feedback will help us improve \n driving experience better'.tr(),
|
||||
'Your feedback will help us improve \n driving experience better'
|
||||
.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: isDark ? Colors.white : Colors.black.withOpacity(0.60),
|
||||
color:
|
||||
isDark
|
||||
? Colors.white
|
||||
: Colors.black.withOpacity(
|
||||
0.60,
|
||||
),
|
||||
letterSpacing: 0.8,
|
||||
),
|
||||
),
|
||||
@@ -122,7 +173,12 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
'Rate for'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? Colors.white : Colors.black.withOpacity(0.60),
|
||||
color:
|
||||
isDark
|
||||
? Colors.white
|
||||
: Colors.black.withOpacity(
|
||||
0.60,
|
||||
),
|
||||
letterSpacing: 0.8,
|
||||
),
|
||||
),
|
||||
@@ -130,10 +186,15 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
controller.order.value!.driver?.fullName() ?? "",
|
||||
controller.order.value!.driver
|
||||
?.fullName() ??
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
color:
|
||||
isDark
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
@@ -142,14 +203,25 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: RatingBar.builder(
|
||||
initialRating: controller.ratings.value,
|
||||
initialRating:
|
||||
controller.ratings.value,
|
||||
minRating: 1,
|
||||
direction: Axis.horizontal,
|
||||
allowHalfRating: true,
|
||||
itemCount: 5,
|
||||
itemBuilder: (context, _) => const Icon(Icons.star, color: Colors.amber),
|
||||
unratedColor: isDark ? AppThemeData.greyDark400 : AppThemeData.grey400,
|
||||
onRatingUpdate: (rating) => controller.ratings.value = rating,
|
||||
itemBuilder:
|
||||
(context, _) => const Icon(
|
||||
Icons.star,
|
||||
color: Colors.amber,
|
||||
),
|
||||
unratedColor:
|
||||
isDark
|
||||
? AppThemeData.greyDark400
|
||||
: AppThemeData.grey400,
|
||||
onRatingUpdate:
|
||||
(rating) =>
|
||||
controller.ratings.value =
|
||||
rating,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -167,9 +239,16 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: RoundedButtonFill(
|
||||
title: controller.ratingModel.value != null ? "Update Review" : "Add Review",
|
||||
title:
|
||||
controller.ratingModel.value !=
|
||||
null
|
||||
? "Update Review"
|
||||
: "Add Review",
|
||||
color: AppThemeData.primary300,
|
||||
textColor: isDark ? Colors.white : Colors.black,
|
||||
textColor:
|
||||
isDark
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
onPress: controller.submitReview,
|
||||
),
|
||||
),
|
||||
@@ -185,12 +264,24 @@ class RentalReviewScreen extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(60),
|
||||
color: Colors.white,
|
||||
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.15), blurRadius: 8, spreadRadius: 6)],
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.15),
|
||||
blurRadius: 8,
|
||||
spreadRadius: 6,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(60),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: controller.order.value?.driver?.profilePictureURL ?? '',
|
||||
imageUrl:
|
||||
controller
|
||||
.order
|
||||
.value
|
||||
?.driver
|
||||
?.profilePictureURL ??
|
||||
'',
|
||||
fit: BoxFit.cover,
|
||||
height: 110,
|
||||
width: 110,
|
||||
|
||||
Reference in New Issue
Block a user