This commit is contained in:
Hamza-Ayed
2024-06-30 13:27:23 +03:00
parent 08d31bc4d1
commit 176f5105b1
25 changed files with 465 additions and 154 deletions

View File

@@ -9,6 +9,7 @@ import 'package:flutter/services.dart';
import 'package:get/get.dart';
import '../../../constant/box_name.dart';
import '../../../controller/functions/launch.dart';
class ApplyOrderWidget extends StatelessWidget {
const ApplyOrderWidget({super.key});
@@ -108,7 +109,23 @@ class ApplyOrderWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset(
'assets/images/blob.png',
box.read(BoxName.carType) == 'Comfort'
? 'assets/images/blob.png'
: box.read(BoxName.carType) == 'Lady'
? 'assets/images/lady.png' // Assuming there's an image for Lady
: box.read(BoxName.carType) == 'Speed'
? 'assets/images/carspeed.png'
: box.read(BoxName.carType) ==
'Delivery'
? 'assets/images/moto.png'
: box.read(BoxName.carType) ==
'Mashwari'
? 'assets/images/freeRide.png'
: box.read(BoxName
.carType) ==
'Rayeh Gai'
? 'assets/images/roundtrip.png'
: 'assets/images/carspeed.png', // Default image if none of the above
width: 80,
),
Column(
@@ -176,11 +193,12 @@ class ApplyOrderWidget extends StatelessWidget {
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
'Hello, I\'m at the agreed-upon location'
.tr,
controller
.driverToken);
'message From passenger',
'Hello, I\'m at the agreed-upon location'
.tr,
controller.driverToken,
'ding.wav',
);
Get.back();
},
child: Container(
@@ -202,11 +220,12 @@ class ApplyOrderWidget extends StatelessWidget {
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
'My location is correct. You can search for me using the navigation app'
.tr,
controller
.driverToken);
'message From passenger',
'My location is correct. You can search for me using the navigation app'
.tr,
controller.driverToken,
'ding.wav',
);
Get.back();
},
child: Container(
@@ -228,11 +247,11 @@ class ApplyOrderWidget extends StatelessWidget {
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
'I\'m waiting for you'
.tr,
controller
.driverToken);
'message From passenger',
'I\'m waiting for you'.tr,
controller.driverToken,
'ding.wav',
);
Get.back();
},
child: Container(
@@ -260,10 +279,11 @@ class ApplyOrderWidget extends StatelessWidget {
),
),
IconButton(
onPressed: () {
onPressed: () async {
HapticFeedback.heavyImpact();
// Get.to(() => const CallPage());
// Get.to(() => PassengerCallPage());
makePhoneCall(controller.driverPhone);
},
icon: const Icon(
Icons.call,

View File

@@ -180,9 +180,7 @@ class _PassengerCallPageState extends State<PassengerCallPage> {
status,
style: AppStyle.title,
),
Text(Get.find<MapPassengerController>()
.driverName
.toString()),
Text('Driver Name'),
],
),
GestureDetector(
@@ -193,6 +191,7 @@ class _PassengerCallPageState extends State<PassengerCallPage> {
'Call End',
Get.find<MapPassengerController>().driverToken,
[],
'iphone_ringtone.wav',
);
leave();
Get.back();

View File

@@ -2,7 +2,9 @@ import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/main.dart';
import 'package:SEFER/views/home/profile/passenger_profile_page.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_dialog.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -440,11 +442,22 @@ class CarDetailsTypeToChoose extends StatelessWidget {
title: 'Next'.tr,
onPressed: () {
Get.back();
mapPassengerController
.isBottomSheetShown = false;
mapPassengerController.update();
mapPassengerController
.changeCashConfirmPageShown();
if (box.read(BoxName.gender) !=
null) {
mapPassengerController
.isBottomSheetShown = false;
mapPassengerController.update();
mapPassengerController
.changeCashConfirmPageShown();
} else {
MyDialog().getDialog(
'Idintify gender',
'You should ideintify your gender for this type of trip!'
.tr, () {
Get.to(() =>
PassengerProfilePage());
});
}
}),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
@@ -577,32 +590,35 @@ class HeaderDestination extends StatelessWidget {
mapPassengerController.isBottomSheetShown &&
mapPassengerController.rideConfirm == false
? Positioned(
top: Get.height * .1,
top: Get.height * .08,
left: 5,
right: 5,
child: Container(
decoration: AppStyle.boxDecoration1,
height: box.read(BoxName.countryCode) == 'Egypt'
? Get.height * .2
: Get.height * .14,
height: Get.height * .1,
width: Get.width * .8,
child: InkWell(
onTap: () {
mapPassengerController
.getDialog('Are you want to change'.tr, '', () {
// mapPassengerController
// .getDialog('Are you want to change'.tr, '', () {
// Get.back();
// mapPassengerController.cancelRide();
// });
MyDialog().getDialog(
'Change Ride'.tr,
'You can change the destination by long-pressing any point on the map'
.tr, () {
Get.back();
mapPassengerController.cancelRide();
});
},
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 2),
child: SizedBox(
height: box.read(BoxName.countryCode) == 'Egypt'
? Get.height * .14
: Get.height * .06,
height: Get.height * .06,
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
//
@@ -616,7 +632,7 @@ class HeaderDestination extends StatelessWidget {
style: AppStyle.subtitle,
),
SizedBox(
height: Get.height * .06,
// height: Get.height * .03,
width: Get.width * .8,
child: Text(
mapPassengerController.startNameAddress,
@@ -634,7 +650,7 @@ class HeaderDestination extends StatelessWidget {
style: AppStyle.subtitle,
),
SizedBox(
height: Get.height * .06,
// height: Get.height * .03,
width: Get.width * .8,
child: Text(
mapPassengerController.endNameAddress,
@@ -647,13 +663,24 @@ class HeaderDestination extends StatelessWidget {
),
),
),
Row(
children: [
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,
),
],
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'📍 ',
style: AppStyle.subtitle,
),
SizedBox(
width: Get.width * .8,
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,
),
),
],
),
),
],
),

View File

@@ -134,7 +134,8 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
},
onLongPress: () {
Get.defaultDialog(
title: 'Do you want to change Work location',
title:
'Do you want to change Work location'.tr,
middleText: '',
confirm: MyElevatedButton(
title: 'Yes'.tr,

View File

@@ -4,6 +4,7 @@ import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../constant/box_name.dart';
import '../../../constant/colors.dart';
import '../../../controller/functions/launch.dart';
import '../../../controller/functions/tts.dart';
import '../../../controller/home/map_passenger_controller.dart';
@@ -82,26 +83,23 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
const SizedBox(
width: 5,
),
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
// decoration: BoxDecoration(
// color: AppColor.secondaryColor,
// border: Border.all(),
// borderRadius: BorderRadius.circular(15)),
// child: IconButton(
// onPressed: () async {
// // AudioRecorderController audioController =
// // Get.put(AudioRecorderController());
// // sql.deleteAllData(TableName.recentLocations);
// // await audioController.startRecording();
// },
// icon: const Icon(
// Icons.voice_chat,
// size: 29,
// ),
// ),
// ),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () async {
makePhoneCall('+201023248456');
},
icon: const Icon(
Icons.voice_chat,
size: 29,
),
),
),
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,

View File

@@ -1,3 +1,4 @@
import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -139,6 +140,92 @@ class MainBottomMenuMap extends StatelessWidget {
// }),
//todo If you want add stop click here
InkWell(
onTap: () {
Get.dialog(
Dialog(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(16)),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'WhatsApp Location Extractor'
.tr,
style: AppStyle.title,
),
const SizedBox(height: 16),
Form(
key: controller.sosFormKey,
child: Column(
children: [
MyTextForm(
controller: controller
.whatsAppLocationText,
label:
'Location Link'.tr,
hint:
'Paste location link here'
.tr,
type: TextInputType.url,
),
const SizedBox(
height: 16),
MyElevatedButton(
title:
'Go to this location'
.tr,
onPressed: () async {
controller
.goToWhatappLocation();
},
)
],
),
),
],
),
),
),
);
},
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.blue[300]!,
Colors.blue[600]!
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(12),
boxShadow: const [
BoxShadow(
color: Colors.black26,
offset: Offset(0, 4),
blurRadius: 5.0,
),
],
),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'Paste WhatsApp location link here'
.tr,
style: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
),
),
),
CupertinoButton(
child: Text(
!controller.isAnotherOreder
@@ -358,6 +445,20 @@ class MainBottomMenuMap extends StatelessWidget {
Get.back();
}));
} else {}
if (controller.isWhatsAppOrder == true) {
Get.defaultDialog(
title: 'Destination selected'.tr,
titleStyle: AppStyle.title,
content: Text(
'Now select start pick'.tr,
style: AppStyle.title,
),
confirm: MyElevatedButton(
title: 'OK'.tr,
onPressed: () {
Get.back();
}));
} else {}
}
controller.placesDestination = [];