4/7/7
This commit is contained in:
@@ -578,7 +578,7 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
late String arrivalTime;
|
late String arrivalTime = '';
|
||||||
void rideIsBeginPassengerTimer() async {
|
void rideIsBeginPassengerTimer() async {
|
||||||
// Calculate arrival time considering current time and duration
|
// Calculate arrival time considering current time and duration
|
||||||
DateTime now = DateTime.now();
|
DateTime now = DateTime.now();
|
||||||
@@ -707,6 +707,17 @@ class MapPassengerController extends GetxController {
|
|||||||
if (rideStatusFromStartApp['data']['status'] == 'Begin') {
|
if (rideStatusFromStartApp['data']['status'] == 'Begin') {
|
||||||
statusRide = 'Begin';
|
statusRide = 'Begin';
|
||||||
statusRideFromStart = true;
|
statusRideFromStart = true;
|
||||||
|
DateTime endTime =
|
||||||
|
DateTime.parse(rideStatusFromStartApp['data']['endtime']);
|
||||||
|
DateTime rideTimeStart =
|
||||||
|
DateTime.parse(rideStatusFromStartApp['data']['rideTimeStart']);
|
||||||
|
|
||||||
|
// Calculate the new end time by adding the duration to the rideTimeStart
|
||||||
|
DateTime newEndTime = rideTimeStart.add(
|
||||||
|
Duration(seconds: endTime.difference(rideTimeStart).inSeconds));
|
||||||
|
|
||||||
|
// Save the new end time in a variable
|
||||||
|
var newEndTimeVariable = newEndTime.toString();
|
||||||
update();
|
update();
|
||||||
|
|
||||||
Map<String, dynamic> tripData =
|
Map<String, dynamic> tripData =
|
||||||
|
|||||||
@@ -178,22 +178,20 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Text(
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
double.parse(myList[2]).toStringAsFixed(2),
|
double.parse(myList[2]).toStringAsFixed(2),
|
||||||
style: AppStyle.headTitle2,
|
style: AppStyle.headTitle2,
|
||||||
)
|
|
||||||
// RichText(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: 'Total From Passenger is '.tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// children: [
|
|
||||||
// TextSpan(
|
|
||||||
// text: double.parse(myList[2]).toStringAsFixed(2),
|
|
||||||
// style: AppStyle.headTitle2),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
myList[31].toString(),
|
||||||
|
style: AppStyle.title
|
||||||
|
.copyWith(color: AppColor.deepPurpleAccent),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: Get.height * .15,
|
height: Get.height * .15,
|
||||||
|
|||||||
@@ -178,22 +178,20 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Text(
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
double.parse(myList[2]).toStringAsFixed(2),
|
double.parse(myList[2]).toStringAsFixed(2),
|
||||||
style: AppStyle.headTitle2,
|
style: AppStyle.headTitle2,
|
||||||
)
|
|
||||||
// RichText(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: 'Total From Passenger is '.tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// children: [
|
|
||||||
// TextSpan(
|
|
||||||
// text: double.parse(myList[2]).toStringAsFixed(2),
|
|
||||||
// style: AppStyle.headTitle2),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
myList[31].toString(),
|
||||||
|
style: AppStyle.title
|
||||||
|
.copyWith(color: AppColor.deepPurpleAccent),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: Get.height * .15,
|
height: Get.height * .15,
|
||||||
|
|||||||
@@ -39,10 +39,12 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Container(
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'⏱️ Arrive',
|
'⏱️',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
@@ -51,10 +53,13 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Column(
|
),
|
||||||
|
Container(
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
' Total',
|
'💵 ',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
@@ -63,6 +68,7 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => Get.to(
|
onPressed: () => Get.to(
|
||||||
() => FeedBackPage(),
|
() => FeedBackPage(),
|
||||||
@@ -131,44 +137,6 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
box.write(BoxName.sosPhonePassenger,
|
box.write(BoxName.sosPhonePassenger,
|
||||||
profileController.prfoileData['sosPhone']);
|
profileController.prfoileData['sosPhone']);
|
||||||
}
|
}
|
||||||
// Get.defaultDialog(
|
|
||||||
// title: 'You dont Add Emergency Phone Yet!'.tr,
|
|
||||||
// content: Column(
|
|
||||||
// children: [
|
|
||||||
// Form(
|
|
||||||
// key: controller.sosFormKey,
|
|
||||||
// child: TextFormField(
|
|
||||||
// keyboardType: TextInputType
|
|
||||||
// .phone, // Set the keyboard type to phone
|
|
||||||
// controller:
|
|
||||||
// controller.sosPhonePassengerProfile,
|
|
||||||
// validator: (value) {
|
|
||||||
// if (value!.isEmpty ||
|
|
||||||
// value.length != 10) {
|
|
||||||
// return 'Please enter a valid phone number'
|
|
||||||
// .tr;
|
|
||||||
// }
|
|
||||||
// // Add additional validation if needed
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// decoration: const InputDecoration(
|
|
||||||
// border: OutlineInputBorder(),
|
|
||||||
// hintText: 'Type here',
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// confirm: MyElevatedButton(
|
|
||||||
// title: 'Add Phone'.tr,
|
|
||||||
// onPressed: () async {
|
|
||||||
// await profileController
|
|
||||||
// .updatField('sosPhone');
|
|
||||||
// box.write(
|
|
||||||
// BoxName.sosPhonePassenger,
|
|
||||||
// profileController
|
|
||||||
// .prfoileData['sosPhone']);
|
|
||||||
// }));
|
|
||||||
} else {
|
} else {
|
||||||
controller
|
controller
|
||||||
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
||||||
@@ -208,34 +176,6 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
// controller.remainingTimeTimerRideBegin < 5
|
|
||||||
// ? MyElevatedButton(
|
|
||||||
// title:
|
|
||||||
// 'If you in destination Now. Press finish The Ride',
|
|
||||||
// onPressed: () async {
|
|
||||||
//todo finish the trip and rest all counter ,start new counter of the trip time
|
|
||||||
|
|
||||||
// await CRUD()
|
|
||||||
// .post(link: AppLink.updateRides, payload: {
|
|
||||||
// 'id': controller.rideId,
|
|
||||||
// 'rideTimeStart': DateTime.now().toString(),
|
|
||||||
// 'status': 'Applied'
|
|
||||||
// });
|
|
||||||
// controller.driverArrivePassenger();
|
|
||||||
// // Send notification to driver to alert him that trip is begin
|
|
||||||
// FirebaseMessagesController()
|
|
||||||
// .sendNotificationToAnyWithoutData(
|
|
||||||
// 'BeginTrip',
|
|
||||||
// box.read(BoxName.name).toString(),
|
|
||||||
// controller.driverToken.toString(),
|
|
||||||
// );
|
|
||||||
// print(controller.driverToken.toString());
|
|
||||||
// Get.defaultDialog(
|
|
||||||
// title: 'The Ride is Begin'.tr,
|
|
||||||
// backgroundColor: AppColor.greenColor,
|
|
||||||
// );
|
|
||||||
// })
|
|
||||||
// : const SizedBox()
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../constant/box_name.dart';
|
||||||
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
import '../../../controller/home/map_passenger_controller.dart';
|
import '../../../controller/home/map_passenger_controller.dart';
|
||||||
|
import '../../../controller/profile/profile_controller.dart';
|
||||||
|
import '../../../main.dart';
|
||||||
|
|
||||||
class RideFromStartApp extends StatelessWidget {
|
class RideFromStartApp extends StatelessWidget {
|
||||||
const RideFromStartApp({super.key});
|
const RideFromStartApp({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
ProfileController profileController = Get.put(ProfileController());
|
||||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||||
return (controller.statusRideFromStart ||
|
return (controller.statusRideFromStart ||
|
||||||
controller.statusRide == 'Begin')
|
controller.statusRide == 'Begin')
|
||||||
@@ -20,26 +26,36 @@ class RideFromStartApp extends StatelessWidget {
|
|||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
height: 200,
|
height: 200,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${'duration is'.tr} ${controller.rideStatusFromStartApp['data']['endtime']}',
|
'${controller.rideStatusFromStartApp['data']['endtime']} ⏱️',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${'price is'.tr} ${controller.rideStatusFromStartApp['data']['price']} 💵',
|
'${controller.rideStatusFromStartApp['data']['distance']} 📍',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${'distance is'.tr} ${controller.rideStatusFromStartApp['data']['distance']}',
|
'${controller.rideStatusFromStartApp['data']['price']} 💵',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
|
CircleAvatar(
|
||||||
|
radius: 30,
|
||||||
|
backgroundImage: NetworkImage(
|
||||||
|
// '',
|
||||||
|
// ),
|
||||||
|
'https://ride.mobile-app.store/portrate_captain_image/${controller.rideStatusFromStartApp['data']['driver_id']}.jpg'),
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
'${'driver name is'.tr} ${controller.rideStatusFromStartApp['data']['driverName']}',
|
'${'driver name is'.tr} ${controller.rideStatusFromStartApp['data']['driverName']}',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
@@ -49,9 +65,59 @@ class RideFromStartApp extends StatelessWidget {
|
|||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
if (box.read(BoxName.sosPhonePassenger) == null) {
|
||||||
|
{
|
||||||
|
await profileController.updatField(
|
||||||
|
'sosPhone', TextInputType.phone);
|
||||||
|
box.write(BoxName.sosPhonePassenger,
|
||||||
|
profileController.prfoileData['sosPhone']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
controller
|
||||||
|
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.sos_rounded,
|
||||||
|
color: AppColor.redColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
print(box.read(BoxName.sosPhonePassenger));
|
||||||
|
if (box.read(BoxName.sosPhonePassenger) == null ||
|
||||||
|
box.read(BoxName.sosPhonePassenger) == 'sos') {
|
||||||
|
{
|
||||||
|
await profileController.updatField(
|
||||||
|
'sosPhone', TextInputType.phone);
|
||||||
|
box.write(BoxName.sosPhonePassenger,
|
||||||
|
profileController.prfoileData['sosPhone']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String phoneNumber = box
|
||||||
|
.read(BoxName.sosPhonePassenger)
|
||||||
|
.toString();
|
||||||
|
phoneNumber = phoneNumber.replaceAll('0', '');
|
||||||
|
print(phoneNumber); // Output: 798583061
|
||||||
|
var phone =
|
||||||
|
// '+${box.read(BoxName.countryCode)}${box.read(BoxName.sosPhonePassenger)}';
|
||||||
|
'+20${box.read(BoxName.sosPhonePassenger)}';
|
||||||
|
controller.sendWhatsapp(phone);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
FontAwesome.whatsapp,
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user