12/22/2
This commit is contained in:
@@ -13,215 +13,249 @@ import '../../../widgets/elevated_btn.dart';
|
||||
|
||||
GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
return GetBuilder<MapDriverController>(
|
||||
builder: (mapDriverController) => mapDriverController.isRideStarted
|
||||
? Positioned(
|
||||
left: 5,
|
||||
top: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? mapDriverController.driverEndPage = 190
|
||||
: mapDriverController.carType == 'Mishwar Vip'
|
||||
? 120
|
||||
: 170,
|
||||
// width: 240,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
mapDriverController.carType != 'Mishwar Vip'
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
const Icon(Icons.social_distance),
|
||||
Text(
|
||||
'${mapDriverController.distance} ${'KM'.tr}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
const Icon(Icons.timelapse),
|
||||
Text(
|
||||
mapDriverController.hours > 1
|
||||
? '${'${mapDriverController.hours}${' H and'.tr}'} ${mapDriverController.minutes} m'
|
||||
: '${mapDriverController.minutes} ${'m'.tr}',
|
||||
style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
const Icon(Icons.money_sharp),
|
||||
Text(
|
||||
'${mapDriverController.paymentAmount} ${'\$'.tr}',
|
||||
style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
: const SizedBox(),
|
||||
mapDriverController.carType != 'Speed' &&
|
||||
mapDriverController.carType != 'Awfar Car' &&
|
||||
mapDriverController.carType != 'Scooter'
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .2,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.timer),
|
||||
Text(
|
||||
mapDriverController
|
||||
.stringRemainingTimeRideBegin1,
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
width: Get.width * .2,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.location_on),
|
||||
Text(
|
||||
'${mapDriverController.recentDistanceToDash.toStringAsFixed(0)} ${'KM'.tr}',
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: Get.width * .2,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.attach_money),
|
||||
Text(
|
||||
mapDriverController.price
|
||||
.toStringAsFixed(2),
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: const SizedBox(),
|
||||
// (mapDriverController.carType == 'Mashwari' ||
|
||||
// mapDriverController.carType == 'Comfort' ||
|
||||
// mapDriverController.carType == 'lady') &&
|
||||
// mapDriverController.remainingTimeTimerRideBegin > 60
|
||||
// ? Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// children: [
|
||||
// MyElevatedButton(
|
||||
// title: 'End Ride'.tr,
|
||||
// onPressed: () {
|
||||
// mapDriverController.finishRideFromDriver();
|
||||
// },
|
||||
// kolor: AppColor.redColor,
|
||||
// ),
|
||||
// Container(
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
// child: Text(
|
||||
// mapDriverController.carType,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// )
|
||||
// :
|
||||
builder: (mapDriverController) => mapDriverController.isRideStarted
|
||||
? Positioned(
|
||||
left: 5,
|
||||
top: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1.copyWith(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? mapDriverController.driverEndPage = 190
|
||||
: mapDriverController.carType == 'Mishwar Vip'
|
||||
? 120
|
||||
: 170,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
if (mapDriverController.carType != 'Mishwar Vip')
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
_buildInfoColumn(
|
||||
icon: Icons.social_distance,
|
||||
text: '${mapDriverController.distance} ${'KM'.tr}',
|
||||
),
|
||||
_buildInfoColumn(
|
||||
icon: Icons.timelapse,
|
||||
text: mapDriverController.hours > 1
|
||||
? '${mapDriverController.hours} ${'H and'.tr} ${mapDriverController.minutes} m'
|
||||
: '${mapDriverController.minutes} ${'m'.tr}',
|
||||
),
|
||||
_buildInfoColumn(
|
||||
icon: Icons.money_sharp,
|
||||
text:
|
||||
'${mapDriverController.paymentAmount} ${'\$'.tr}',
|
||||
),
|
||||
],
|
||||
),
|
||||
if (mapDriverController.carType != 'Speed' &&
|
||||
mapDriverController.carType != 'Awfar Car' &&
|
||||
mapDriverController.carType != 'Scooter')
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
// mapDriverController.remainingTimeTimerRideBegin <
|
||||
// 60
|
||||
// ?
|
||||
SlideAction(
|
||||
text: 'End Ride'.tr,
|
||||
textStyle: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
outerColor: AppColor.redColor,
|
||||
innerColor: Colors.white,
|
||||
sliderButtonIcon: const Icon(
|
||||
Icons.arrow_forward,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
onSubmit: () {
|
||||
mapDriverController.finishRideFromDriver();
|
||||
},
|
||||
_buildInfoBox(
|
||||
icon: Icons.timer,
|
||||
text:
|
||||
mapDriverController.stringRemainingTimeRideBegin1,
|
||||
),
|
||||
_buildInfoBox(
|
||||
icon: Icons.location_on,
|
||||
text:
|
||||
'${mapDriverController.recentDistanceToDash.toStringAsFixed(0)} ${'KM'.tr}',
|
||||
),
|
||||
_buildInfoBox(
|
||||
icon: Icons.attach_money,
|
||||
text: mapDriverController.price.toStringAsFixed(2),
|
||||
),
|
||||
// MyElevatedButton(
|
||||
// title: 'End Ride'.tr,
|
||||
// onPressed: () {
|
||||
// mapDriverController.finishRideFromDriver();
|
||||
// },
|
||||
// kolor: AppColor.redColor,
|
||||
// ),
|
||||
// : const SizedBox(),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
mapDriverController.carType,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
mapDriverController.carType != 'Comfort' &&
|
||||
mapDriverController.carType != 'Mishwar Vip' &&
|
||||
mapDriverController.carType != 'Lady'
|
||||
? Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .9,
|
||||
child: Center(
|
||||
child: LinearProgressIndicator(
|
||||
backgroundColor: AppColor.greyColor,
|
||||
color: mapDriverController
|
||||
.remainingTimeTimerRideBegin <
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 25,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
value: mapDriverController
|
||||
.progressTimerRideBegin
|
||||
.toDouble(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
mapDriverController
|
||||
.stringRemainingTimeRideBegin,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
_builtTimerAndCarType(),
|
||||
Container(
|
||||
width: Get.width * 0.8,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.redColor.withOpacity(0.3),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: SlideAction(
|
||||
height: 50,
|
||||
borderRadius: 15,
|
||||
elevation: 4,
|
||||
text: 'Slide to End Trip'.tr,
|
||||
textStyle: AppStyle.title.copyWith(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
outerColor: AppColor.redColor,
|
||||
innerColor: Colors.white,
|
||||
sliderButtonIcon: const Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: AppColor.redColor,
|
||||
size: 24,
|
||||
),
|
||||
sliderRotate: false,
|
||||
onSubmit: () {
|
||||
HapticFeedback.mediumImpact();
|
||||
mapDriverController.finishRideFromDriver();
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
);
|
||||
}
|
||||
|
||||
class _builtTimerAndCarType extends StatelessWidget {
|
||||
const _builtTimerAndCarType({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final mapDriverController = Get.find<MapDriverController>();
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1.copyWith(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor.withOpacity(0.2),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Text(
|
||||
mapDriverController.carType,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
if (mapDriverController.carType != 'Comfort' &&
|
||||
mapDriverController.carType != 'Mishwar Vip' &&
|
||||
mapDriverController.carType != 'Lady')
|
||||
Container(
|
||||
width: Get.width * 0.6,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? AppColor.redColor.withOpacity(0.8)
|
||||
: AppColor.greenColor.withOpacity(0.8),
|
||||
mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: (mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor)
|
||||
.withOpacity(0.3),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
))
|
||||
: const SizedBox());
|
||||
],
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: Colors.white.withOpacity(0.2),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
Colors.white.withOpacity(0.5),
|
||||
),
|
||||
minHeight: 40,
|
||||
value:
|
||||
mapDriverController.progressTimerRideBegin.toDouble(),
|
||||
),
|
||||
Center(
|
||||
child: AnimatedDefaultTextStyle(
|
||||
duration: Duration(milliseconds: 300),
|
||||
style: AppStyle.title.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize:
|
||||
mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? 18
|
||||
: 16,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: Colors.black26,
|
||||
offset: Offset(0, 2),
|
||||
blurRadius: 4,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
mapDriverController.stringRemainingTimeRideBegin,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildInfoColumn({required IconData icon, required String text}) {
|
||||
return Column(
|
||||
children: [
|
||||
Icon(icon),
|
||||
Text(
|
||||
text,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoBox({required IconData icon, required String text}) {
|
||||
return Container(
|
||||
width: Get.width * .2,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
text,
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
GetBuilder<MapDriverController> speedCircle() {
|
||||
|
||||
@@ -452,9 +452,12 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
kolor: AppColor.greenColor,
|
||||
onPressed: () {
|
||||
MyDialog().getDialog(
|
||||
"Is the Passenger in your Car ?"
|
||||
.tr,
|
||||
"Don't start trip if not".tr,
|
||||
"Is the Passenger in your Car?"
|
||||
.tr, // "هل الراكب في سيارتك؟"
|
||||
|
||||
"Don't start trip if passenger not in your car"
|
||||
.tr, // "لا تبدأ الرحلة إذا لم يكن الراكب في سيارتك"
|
||||
|
||||
() async {
|
||||
await controller
|
||||
.startRideFromDriver();
|
||||
|
||||
Reference in New Issue
Block a user