This commit is contained in:
Hamza-Ayed
2024-11-09 10:49:04 +02:00
parent fc81405b7a
commit 213c2724aa
44 changed files with 3009 additions and 1130 deletions

View File

@@ -27,7 +27,7 @@ class ApplyOrderWidget extends StatelessWidget {
right: 0,
child: Container(
decoration: AppStyle.boxDecoration,
height: Get.height * .35,
height: Get.height * .36,
child: ListView(
children: [
InkWell(
@@ -87,11 +87,11 @@ class ApplyOrderWidget extends StatelessWidget {
width: 10,
),
Container(
height: Get.height * .3,
height: Get.height * .34,
width: Get.width * .9,
decoration: AppStyle.boxDecoration,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
@@ -241,12 +241,13 @@ class ApplyOrderWidget extends StatelessWidget {
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
.sendNotificationToDriverMAP(
'message From passenger'.tr,
'Hello, I\'m at the agreed-upon location'
.tr,
controller.driverToken
.toString(),
[],
'ding.wav',
);
Get.back();
@@ -272,11 +273,12 @@ class ApplyOrderWidget extends StatelessWidget {
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
.sendNotificationToDriverMAP(
'message From passenger'.tr,
'My location is correct. You can search for me using the navigation app'
.tr,
controller.driverToken,
[],
'ding.wav',
);
Get.back();
@@ -302,11 +304,12 @@ class ApplyOrderWidget extends StatelessWidget {
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
.sendNotificationToDriverMAP(
'message From passenger',
'My location is correct. You can search for me using the navigation app'
.tr,
controller.driverToken,
[],
'ding.wav',
);
Get.back();
@@ -331,11 +334,12 @@ class ApplyOrderWidget extends StatelessWidget {
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
.sendNotificationToDriverMAP(
'message From passenger',
"How much longer will you be?"
.tr,
controller.driverToken,
[],
'ding.wav',
);
Get.back();
@@ -385,13 +389,14 @@ class ApplyOrderWidget extends StatelessWidget {
IconButton(
onPressed: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
.sendNotificationToDriverMAP(
'message From passenger',
controller
.messageToDriver
.text,
controller
.driverToken,
[],
'ding.wav');
controller
.messageToDriver
@@ -466,7 +471,7 @@ class DriverArrivePassengerAndWaitMinute extends StatelessWidget {
color: controller.remainingTimeDriverWaitPassenger5Minute < 60
? AppColor.redColor
: AppColor.greenColor,
minHeight: 25,
minHeight: 15,
borderRadius: BorderRadius.circular(15),
value:
controller.progressTimerDriverWaitPassenger5Minute.toDouble(),
@@ -513,7 +518,7 @@ class TimeDriverToPassenger extends StatelessWidget {
Container(
decoration: AppStyle.boxDecoration,
width: Get.width * .7,
height: 35,
height: 15,
// color: AppColor.yellowColor,
),
Stack(

View File

@@ -3,11 +3,11 @@ import 'package:get/get.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/home/map_passenger_controller.dart';
import '../../widgets/elevated_btn.dart';
GetBuilder<MapPassengerController> cancelRidePage() {
Get.put(MapPassengerController());
final List<String> reasons = [
"I don't need a ride anymore".tr,
"I was just trying the application".tr,
@@ -16,80 +16,74 @@ GetBuilder<MapPassengerController> cancelRidePage() {
"I don't have a reason".tr,
"Other".tr,
];
return GetBuilder<MapPassengerController>(
builder: (controller) => controller.isCancelRidePageShown
? Positioned(
left: Get.width * .1,
top: Get.width * .2,
right: Get.width * .1,
bottom: Get.width * .15,
left: 20,
top: Get.height * 0.15,
right: 20,
bottom: Get.height * 0.15,
child: Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: AppColor.secondaryColor,
color: Colors.white,
boxShadow: [
const BoxShadow(
color: AppColor.accentColor,
offset: Offset(2, 2),
blurRadius: 5),
BoxShadow(
color: AppColor.accentColor.withOpacity(.4),
offset: const Offset(-2, -2),
blurRadius: 5)
color: Colors.black.withOpacity(0.2),
offset: const Offset(0, 8),
blurRadius: 16,
),
],
borderRadius: const BorderRadius.all(Radius.circular(15)),
borderRadius: BorderRadius.circular(20),
),
height: Get.height * .7,
width: Get.width * .7,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
'Can we know why you want to cancel Ride ?'.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
Text(
'Can we know why you want to cancel Ride ?'.tr,
style: AppStyle.title
.copyWith(fontSize: 18, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
SizedBox(
height: 380,
width: 300,
child: ListView.builder(
const SizedBox(height: 20),
Expanded(
child: ListView.separated(
itemCount: reasons.length,
separatorBuilder: (context, index) => const Divider(),
itemBuilder: (context, index) {
return ListTile(
title: InkWell(
onTap: () {
controller.selectReason(
index,
reasons[index].toString(),
);
},
child: Text(
reasons[index],
style: AppStyle.title,
)),
title: Text(
reasons[index],
style: AppStyle.title.copyWith(fontSize: 16),
),
leading: Radio(
value: index,
groupValue: controller.selectedReason,
onChanged: (int? value) {
controller.selectReason(
value!,
reasons[index].toString(),
);
controller.selectReason(value!, reasons[index]);
},
activeColor: AppColor.primaryColor,
),
onTap: () {
controller.selectReason(index, reasons[index]);
},
);
},
),
),
const SizedBox(height: 20),
MyElevatedButton(
title: 'Cancel Ride'.tr,
onPressed: () {
if (controller.selectedReason == -1) {
Get.snackbar('You Should be select reason.'.tr, '',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: AppColor.redColor);
Get.snackbar(
'You Should be select reason.'.tr,
'',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: AppColor.redColor,
colorText: Colors.white,
);
} else {
controller.cancelRide();
}

View File

@@ -586,7 +586,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
textToSpeechController,
image: 'assets/images/freeRide.png',
text:
'Perfect for adventure seekers who want to experience something new and exciting'
"Perfect for passengers seeking the latest car models with the freedom to choose any route they desire"
.tr),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
@@ -656,8 +656,10 @@ class CarDetailsTypeToChoose extends StatelessWidget {
title: 'Next'.tr,
onPressed: () {
Get.back();
if (box.read(BoxName.gender) !=
null) {
if (box
.read(BoxName.gender)
.toString() !=
'') {
mapPassengerController
.isBottomSheetShown = false;
mapPassengerController.update();
@@ -710,59 +712,108 @@ class CarDetailsTypeToChoose extends StatelessWidget {
MainAxisAlignment
.spaceBetween,
children: [
Container(
decoration: AppStyle
.boxDecoration1,
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Column(
children: [
Text('Awfar Car'
.tr),
Text(mapPassengerController
.totalPassengerRayehGaiBalash
.toStringAsFixed(
0)),
],
),
)),
Container(
decoration: AppStyle
.boxDecoration1,
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Column(
children: [
Text('Speed'.tr),
Text(mapPassengerController
.totalPassengerRayehGai
.toStringAsFixed(
0)),
],
),
)),
Container(
decoration: AppStyle
.boxDecoration1,
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Column(
children: [
Text(
'Comfort'.tr),
Text(mapPassengerController
.totalPassengerRayehGaiComfort
.toStringAsFixed(
0)),
],
),
))
GestureDetector(
onTap: () {
Get.back();
mapPassengerController
.totalPassenger =
mapPassengerController
.totalPassengerRayehGaiBalash;
mapPassengerController
.isBottomSheetShown =
false;
mapPassengerController
.update();
mapPassengerController
.changeCashConfirmPageShown();
},
child: Container(
decoration: AppStyle
.boxDecoration1,
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Column(
children: [
Text('Awfar Car'
.tr),
Text(mapPassengerController
.totalPassengerRayehGaiBalash
.toStringAsFixed(
0)),
],
),
)),
),
GestureDetector(
onTap: () {
Get.back();
mapPassengerController
.totalPassenger =
mapPassengerController
.totalPassengerRayehGai;
mapPassengerController
.isBottomSheetShown =
false;
mapPassengerController
.update();
mapPassengerController
.changeCashConfirmPageShown();
},
child: Container(
decoration: AppStyle
.boxDecoration1,
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Column(
children: [
Text(
'Speed'.tr),
Text(mapPassengerController
.totalPassengerRayehGai
.toStringAsFixed(
0)),
],
),
)),
),
GestureDetector(
onTap: () {
Get.back();
mapPassengerController
.totalPassenger =
mapPassengerController
.totalPassengerRayehGaiComfort;
mapPassengerController
.isBottomSheetShown =
false;
mapPassengerController
.update();
mapPassengerController
.changeCashConfirmPageShown();
},
child: Container(
decoration: AppStyle
.boxDecoration1,
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Column(
children: [
Text('Comfort'
.tr),
Text(mapPassengerController
.totalPassengerRayehGaiComfort
.toStringAsFixed(
0)),
],
),
)),
)
],
),
cancel: MyElevatedButton(
@@ -951,9 +1002,16 @@ class BurcMoney extends StatelessWidget {
}
}
class HeaderDestination extends StatelessWidget {
class HeaderDestination extends StatefulWidget {
const HeaderDestination({super.key});
@override
_HeaderDestinationState createState() => _HeaderDestinationState();
}
class _HeaderDestinationState extends State<HeaderDestination> {
bool _isExpanded = false;
@override
Widget build(BuildContext context) {
return GetBuilder<MapPassengerController>(
@@ -965,95 +1023,64 @@ class HeaderDestination extends StatelessWidget {
top: Get.height * .08,
left: 5,
right: 5,
child: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .15,
width: Get.width * .8,
child: InkWell(
onTap: () {
// mapPassengerController
// .getDialog('Are you want to change'.tr, '', () {
// Get.back();
// mapPassengerController.cancelRide();
// });
MyDialog().getDialog(
"Change Route".tr,
'You can change the destination by long-pressing any point on the map'
.tr, () {
Get.back();
});
},
child: GestureDetector(
onTap: () {
setState(() {
_isExpanded = !_isExpanded;
});
},
child: AnimatedContainer(
duration: const Duration(milliseconds: 300),
decoration: AppStyle.boxDecoration1,
height: _isExpanded ? Get.height * .13 : Get.height * .06,
width: Get.width * .9,
padding: const EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 2),
child: SizedBox(
height: Get.height * .08,
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
//
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'🟢 ',
_isExpanded
? Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text('🟢 ', style: AppStyle.subtitle),
Expanded(
child: Text(
mapPassengerController.startNameAddress,
style: AppStyle.subtitle,
overflow: TextOverflow.ellipsis,
),
SizedBox(
// height: Get.height * .03,
width: Get.width * .8,
child: Text(
mapPassengerController.startNameAddress,
style: AppStyle.subtitle,
),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'🔴 ',
style: AppStyle.subtitle,
),
SizedBox(
// height: Get.height * .03,
width: Get.width * .8,
child: Text(
mapPassengerController.endNameAddress,
style: AppStyle.subtitle,
),
),
],
),
],
),
],
)
: const SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('🔴 ', style: AppStyle.subtitle),
Expanded(
child: Text(
mapPassengerController.endNameAddress,
style: AppStyle.subtitle,
overflow: TextOverflow.ellipsis,
),
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
if (_isExpanded)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'📍 ',
style: AppStyle.subtitle,
),
SizedBox(
width: Get.width * .8,
Text('📍', style: AppStyle.subtitle),
Expanded(
child: Text(
'${mapPassengerController.distance} ${'KM'.tr}${mapPassengerController.hours > 0 ? '${'Your Ride Duration is '.tr}${mapPassengerController.hours} ${'H and'.tr} ${mapPassengerController.minutes} ${'m'.tr}' : '${'Your Ride Duration is '.tr} ${mapPassengerController.minutes} ${'m'.tr}'}',
style: AppStyle.subtitle,
overflow: TextOverflow.ellipsis,
),
),
],
),
),
],
),
),

View File

@@ -29,7 +29,8 @@ class CashConfirmPageShown extends StatelessWidget {
? controller.cashConfirmPageShown
: 0,
decoration: BoxDecoration(
color: box.read(BoxName.carType) == 'Lady'
color: box.read(BoxName.carType) == 'Lady' ||
box.read(BoxName.carType) == 'Pink Bike'
? Colors.pink.shade100
: AppColor.secondaryColor,
borderRadius: BorderRadius.circular(15)),

View File

@@ -419,7 +419,7 @@ class GoogleMapPassengerWidget extends StatelessWidget {
},
mapType:
controller.mapType ? MapType.satellite : MapType.normal,
controller.mapType ? MapType.satellite : MapType.terrain,
myLocationButtonEnabled: true,
// liteModeEnabled: true, tiltGesturesEnabled: false,

View File

@@ -1,7 +1,13 @@
import 'dart:math';
import 'package:SEFER/views/auth/login_page.dart';
import 'package:SEFER/views/auth/sms_verfy_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../constant/colors.dart';
import '../../../constant/notification.dart';
import '../../../controller/firebase/local_notification.dart';
import '../../../controller/functions/tts.dart';
import '../../../controller/home/map_passenger_controller.dart';
@@ -89,17 +95,14 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// borderRadius: BorderRadius.circular(15)),
// child: IconButton(
// onPressed: () async {
// FirebaseMessagesController().sendNotificationToAnyWithoutData(
// 'Order'.tr,
// 'from: ',
// // jsonDecode(value)['message'].toString(),
// 'dEugS-JOT4Ka5riF4s5TEN:APA91bEDL_W7BuEQGbyL-RMaKiMWDlURXhFuaybe5WurTUV8K5eIooSGe22yY22_U2hEZcfPr46ig1v--l00dbOGiivazxvmTyhUyQQW6lJsuIN-wordGtBxtREyeYtEKvxIa1J4ApEu',
// 'order.wav'
// // polylineCoordinates.toString()
// );
// // print(box.read(BoxName.tokenFCM));
// //
// final random = Random();
// final randomMessage =
// messages[random.nextInt(messages.length)];
// NotificationController().showNotification(
// randomMessage.split(':')[0],
// randomMessage.split(':')[1],
// "ding",
// );
// },
// icon: const Icon(
// Icons.voice_chat,

View File

@@ -30,7 +30,7 @@ class RideBeginPassenger extends StatelessWidget {
return Positioned(
left: 10,
right: 10,
bottom: 4,
bottom: 10,
child: Container(
decoration: AppStyle.boxDecoration,
height: controller.statusRide == 'Begin' ? Get.height * .33 : 0,

View File

@@ -8,6 +8,121 @@ import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../constant/links.dart';
// class SearchingCaptainWindow extends StatelessWidget {
// const SearchingCaptainWindow({super.key});
// Widget _buildDriverAvatars(MapPassengerController controller) {
// // If no drivers yet, show loading indicator
// if (controller.isSearchingWindow) {
// // Check if dataCarsLocationByPassenger or its 'data' is null
// if (controller.dataCarsLocationByPassenger == null ||
// controller.dataCarsLocationByPassenger['data'] == null ||
// controller.dataCarsLocationByPassenger['data'].isEmpty) {
// return const SizedBox(
// height: 60,
// child: Center(
// child: CircularProgressIndicator(
// valueColor:
// AlwaysStoppedAnimation<Color>(AppColor.secondaryColor),
// ),
// ),
// );
// }
// }
// return SizedBox(
// height: 60,
// child: ListView.builder(
// scrollDirection: Axis.horizontal,
// itemCount: controller.dataCarsLocationByPassenger['data'].length,
// padding: const EdgeInsets.symmetric(horizontal: 16),
// itemBuilder: (context, index) {
// final driver = controller.dataCarsLocationByPassenger['data'][index];
// return Padding(
// padding: const EdgeInsets.only(right: 8),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// CircleAvatar(
// radius: 25,
// backgroundColor: AppColor.secondaryColor,
// child: ClipOval(
// child: Image.network(
// '${AppLink.server}/portrate_captain_image/${driver['driver_id']}.jpg',
// width: 50,
// height: 50,
// fit: BoxFit.cover,
// errorBuilder: (context, error, stackTrace) {
// return const Icon(
// Icons.person,
// color: Colors.white,
// size: 30,
// );
// },
// ),
// ),
// ),
// ],
// ),
// );
// },
// ),
// );
// }
// @override
// Widget build(BuildContext context) {
// return GetBuilder<MapPassengerController>(
// builder: (mapPassengerController) {
// return mapPassengerController.isSearchingWindow
// ? Positioned(
// bottom: 0,
// left: 0,
// right: 0,
// child: Container(
// decoration: AppStyle.boxDecoration1,
// height: Get.height *
// .3, // Increased height to accommodate avatars
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// SizedBox(
// width: Get.width * .7,
// child: const LinearProgressIndicator(
// minHeight: 6,
// backgroundColor: AppColor.yellowColor,
// color: AppColor.secondaryColor,
// ),
// ),
// mapPassengerController.driverOrderStatus == 'recive'
// ? Text(
// "Drivers received orders".tr,
// style: AppStyle.title,
// )
// : Text(
// "We are searching for the nearest driver to you"
// .tr,
// style: AppStyle.title,
// ),
// Text(
// 'please wait till driver accept your order'.tr,
// style: AppStyle.title,
// ),
// // New: Driver avatars section
// _buildDriverAvatars(mapPassengerController),
// _buildTimer(mapPassengerController),
// ],
// ),
// ),
// )
// : const SizedBox();
// },
// );
// }
// }
class SearchingCaptainWindow extends StatelessWidget {
const SearchingCaptainWindow({super.key});

View File

@@ -116,9 +116,10 @@ class CupertinoDriverListWidget extends StatelessWidget {
width: 20,
height: 20,
decoration: BoxDecoration(
color: hexToColor(
driver['color_hex'].toString()) ??
Colors.amber,
color: driver['color_hex'].toString() == 'null'
? Colors.amber
: hexToColor(
driver['color_hex'].toString()),
borderRadius: BorderRadius.circular(4),
border: Border.all(),
),
@@ -151,9 +152,11 @@ class CupertinoDriverListWidget extends StatelessWidget {
width: 20,
height: 20,
decoration: BoxDecoration(
color: hexToColor(
driver['color_hex'].toString()) ??
AppColor.bronze,
color:
driver['color_hex'].toString() == 'null'
? Colors.amber
: hexToColor(
driver['color_hex'].toString()),
borderRadius: BorderRadius.circular(4),
border: Border.all(),
),
@@ -204,7 +207,9 @@ class CupertinoDriverListWidget extends StatelessWidget {
width: 20,
height: 20,
decoration: BoxDecoration(
color: hexToColor(driver['color_hex'].toString()),
color: driver['color_hex'].toString() == 'null'
? Colors.amber
: hexToColor(driver['color_hex'].toString()),
borderRadius: BorderRadius.circular(4),
border: Border.all(),
),