11/10/1
This commit is contained in:
@@ -98,7 +98,7 @@ class CupertinoDrawerCaptain extends StatelessWidget {
|
||||
_buildDrawerItem(
|
||||
icon: CupertinoIcons.mail,
|
||||
text: "Contact Us".tr,
|
||||
onTap: () => Get.to(() => const SettingsCaptain()),
|
||||
onTap: () => Get.to(() => ContactUsPage()),
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildDrawerItem(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/controller/firebase/local_notification.dart';
|
||||
@@ -10,8 +11,12 @@ import 'package:get/get.dart';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import 'package:timezone/data/latest.dart' as tz;
|
||||
import 'package:timezone/timezone.dart' as tz;
|
||||
import '../../../../../constant/colors.dart';
|
||||
import '../../../../../constant/notification.dart';
|
||||
import '../../../../../controller/functions/audio_controller.dart';
|
||||
import '../../../../../print.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
import '../../../../../controller/functions/location_controller.dart';
|
||||
import '../../driver_map_page.dart';
|
||||
@@ -180,30 +185,53 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
),
|
||||
// Platform.isAndroid
|
||||
// ?
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(color: AppColor.blueColor),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: Builder(builder: (context) {
|
||||
// return IconButton(
|
||||
// onPressed: () async {
|
||||
// // NotificationController().showNotification(
|
||||
// // ' message.notification!.title.toString()',
|
||||
// // ' message.notification!.body.toString()',
|
||||
// // 'order',
|
||||
// // '');
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.window_close,
|
||||
// size: 29,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(color: AppColor.blueColor),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Builder(builder: (context) {
|
||||
return IconButton(
|
||||
onPressed: () async {
|
||||
// NotificationController().showNotification(
|
||||
// ' message.notification!.title.toString()',
|
||||
// ' message.notification!.body.toString()',
|
||||
// 'order',
|
||||
// '');
|
||||
|
||||
NotificationController notificationController =
|
||||
Get.put(NotificationController());
|
||||
await notificationController.initNotifications();
|
||||
final random = Random();
|
||||
final randomMessage =
|
||||
driverMessages[random.nextInt(driverMessages.length)];
|
||||
Log.print(
|
||||
' randomMessage.split[0]: ${randomMessage.split(':')[0]}');
|
||||
Log.print(
|
||||
' randomMessage.split([1]: ${randomMessage.split(':')[1]}');
|
||||
// Schedule the notification with the random message
|
||||
notificationController.showNotification(
|
||||
randomMessage.split(':')[0],
|
||||
randomMessage.split(':')[1],
|
||||
"ding",
|
||||
'');
|
||||
|
||||
// notificationController.scheduleNotificationEvery10Hours(
|
||||
// "افتح التطبيق".tr,
|
||||
// "افتح التطبيق لتبقى على اطلاع واستعداد للمهام القادمة.".tr,
|
||||
// "ding",
|
||||
// );
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.window_close,
|
||||
size: 29,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
// : const SizedBox(),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
|
||||
@@ -101,12 +101,13 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||
'message From Driver',
|
||||
"Where are you, sir?"
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
[],
|
||||
'ding.wav');
|
||||
Get.back();
|
||||
},
|
||||
@@ -132,12 +133,13 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||
'message From Driver',
|
||||
"I've been trying to reach you but your phone is off."
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
[],
|
||||
'ding.wav');
|
||||
Get.back();
|
||||
},
|
||||
@@ -163,12 +165,13 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||
'message From Driver',
|
||||
"Please don't be late, I'm waiting for you at the specified location."
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
[],
|
||||
'ding.wav');
|
||||
Get.back();
|
||||
},
|
||||
@@ -194,13 +197,14 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||
'message From Driver',
|
||||
"Please don't be late"
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
'ding.wav');
|
||||
[],
|
||||
'cancel.wav');
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
@@ -247,10 +251,11 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed:
|
||||
() {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
'message From Driver'.tr,
|
||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||
'message From Driver',
|
||||
controller.messageToPassenger.text,
|
||||
controller.tokenPassenger,
|
||||
[],
|
||||
'ding.wav');
|
||||
controller
|
||||
.messageToPassenger
|
||||
@@ -471,13 +476,13 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
140) {
|
||||
// Notify Passenger
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Hi, I Arrive at your site',
|
||||
.sendNotificationToDriverMAP(
|
||||
'Hi ,I Arrive your site',
|
||||
'I Arrive at your site'
|
||||
.tr,
|
||||
controller.tokenPassenger,
|
||||
[],
|
||||
'start.wav',
|
||||
'ding.wav',
|
||||
);
|
||||
controller
|
||||
.startTimerToShowDriverWaitPassengerDuration();
|
||||
@@ -553,7 +558,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
'Are you sure to cancel?'.tr,
|
||||
'', () async {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
.sendNotificationToDriverMAP(
|
||||
'Driver Cancelled Your Trip',
|
||||
'You will need to pay the cost to the driver, or it will be deducted from your next trip'
|
||||
.tr,
|
||||
|
||||
@@ -330,7 +330,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
if (AppLink.endPoint != AppLink.seferCairoServer) {
|
||||
CRUD().post(
|
||||
link:
|
||||
"${AppLink.endPoint}/rides/updateStausFromSpeed.php",
|
||||
"${AppLink.endPoint}/ride/rides/updateStausFromSpeed.php",
|
||||
payload: {
|
||||
'id': orderRequestController.myList[16],
|
||||
'rideTimeStart': DateTime.now().toString(),
|
||||
@@ -364,6 +364,17 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
box.read(BoxName.nameDriver).toString(),
|
||||
box.read(BoxName.tokenDriver).toString(),
|
||||
];
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Accepted Ride',
|
||||
'your ride is applied'.tr,
|
||||
// arguments['DriverList'][9].toString(),
|
||||
orderRequestController
|
||||
.arguments['DriverList'][9]
|
||||
.toString(),
|
||||
// box.read(BoxName.tokenDriver).toString(),
|
||||
bodyToPassenger,
|
||||
'start.wav');
|
||||
await CRUD().postFromDialogue(
|
||||
link: AppLink.addDriverOrder,
|
||||
payload: {
|
||||
@@ -388,7 +399,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
if (AppLink.endPoint != AppLink.seferCairoServer) {
|
||||
CRUD().post(
|
||||
link:
|
||||
"${AppLink.endPoint}/driver_order/add.php",
|
||||
"${AppLink.endPoint}/ride/driver_order/add.php",
|
||||
payload: {
|
||||
'driver_id': orderRequestController
|
||||
.myList[6]
|
||||
@@ -400,17 +411,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
'status': 'Apply'
|
||||
});
|
||||
}
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Apply Ride',
|
||||
'your ride is applied'.tr,
|
||||
// arguments['DriverList'][9].toString(),
|
||||
orderRequestController
|
||||
.arguments['DriverList'][9]
|
||||
.toString(),
|
||||
// box.read(BoxName.tokenDriver).toString(),
|
||||
bodyToPassenger,
|
||||
'start.wav');
|
||||
|
||||
Get.back();
|
||||
|
||||
// 'Arguments passed to PassengerLocationMapPage:');
|
||||
|
||||
@@ -1,16 +1,69 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../main.dart';
|
||||
|
||||
class VipOrderPage extends StatelessWidget {
|
||||
const VipOrderPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(VipOrderController());
|
||||
return MyScafolld(
|
||||
title: 'VIP Order'.tr,
|
||||
body: [],
|
||||
body: [
|
||||
GetBuilder<VipOrderController>(builder: (vipOrderController) {
|
||||
return SafeArea(
|
||||
child: Column(
|
||||
children: [],
|
||||
));
|
||||
})
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class VipOrderController extends GetxController {
|
||||
bool isLoading = false;
|
||||
final arguments = Get.arguments;
|
||||
late String body;
|
||||
List tripData = [];
|
||||
var myList;
|
||||
|
||||
initilize() {
|
||||
final myListString = arguments['myListString'];
|
||||
|
||||
if (arguments['DriverList'] == null || arguments['DriverList'].isEmpty) {
|
||||
myList = jsonDecode(myListString);
|
||||
} else {
|
||||
myList = arguments['DriverList'];
|
||||
}
|
||||
|
||||
body = arguments['body'];
|
||||
update();
|
||||
}
|
||||
|
||||
fetchOrder() async {
|
||||
var res = await CRUD().get(link: AppLink.getMishwari, payload: {
|
||||
'driverId': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
tripData = jsonDecode(res)['message'];
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
await initilize();
|
||||
fetchOrder();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user