4/10/2
This commit is contained in:
@@ -147,38 +147,44 @@ class FirebaseMessagesController extends GetxController {
|
||||
driverID = myList[2].toString();
|
||||
|
||||
NotificationController().showNotification(
|
||||
'Apply Order'.tr, 'Driver Applied the Ride for You'.tr, 'order');
|
||||
'Apply Order'.tr, 'Driver Applied the Ride for You'.tr, 'order1');
|
||||
// driverAppliedTripSnakBar();
|
||||
} else if (message.notification!.title! == 'Promo') {
|
||||
NotificationController()
|
||||
.showNotification('Promo', 'Show latest promo'.tr, 'order');
|
||||
.showNotification('Promo', 'Show latest promo'.tr, 'promo');
|
||||
Get.to(const PromosPassengerPage());
|
||||
} else if (message.notification!.title == 'Cancel Trip') {
|
||||
NotificationController().showNotification(
|
||||
'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'order');
|
||||
'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'cancel');
|
||||
cancelTripDialog();
|
||||
} else if (message.notification!.title! == 'DriverIsGoingToPassenger') {
|
||||
Get.find<MapPassengerController>().isDriverInPassengerWay = true;
|
||||
Get.find<MapPassengerController>().update();
|
||||
NotificationController().showNotification('Driver is Going To You'.tr,
|
||||
'Please stay on the picked point.'.tr, 'order');
|
||||
'Please stay on the picked point.'.tr, 'tone1');
|
||||
// Get.snackbar('Driver is Going To Passenger', '',
|
||||
// backgroundColor: AppColor.greenColor);
|
||||
} else if (message.notification!.title! == 'message From passenger') {
|
||||
NotificationController()
|
||||
.showNotification('message From passenger'.tr, ''.tr, 'tone2');
|
||||
passengerDialog(message.notification!.body!);
|
||||
|
||||
update();
|
||||
} else if (message.notification!.title! == 'RideIsBegin') {
|
||||
Get.find<MapPassengerController>().getBeginRideFromDriver();
|
||||
// Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
|
||||
NotificationController()
|
||||
.showNotification('Trip is Begin'.tr, ''.tr, 'order');
|
||||
.showNotification('Trip is Begin'.tr, ''.tr, 'start');
|
||||
update();
|
||||
} else if (message.notification!.title! == 'Hi ,I will go now') {
|
||||
// Get.snackbar('Hi ,I will go now', '',
|
||||
// backgroundColor: AppColor.greenColor);
|
||||
NotificationController().showNotification(
|
||||
'Passenger come to you'.tr, 'Hi ,I will go now'.tr, 'order');
|
||||
'Passenger come to you'.tr, 'Hi ,I will go now'.tr, 'tone2');
|
||||
update();
|
||||
} else if (message.notification!.title! == 'Hi ,I Arrive your site') {
|
||||
NotificationController()
|
||||
.showNotification('Hi ,I Arrive your site'.tr, ''.tr, 'order');
|
||||
.showNotification('Hi ,I Arrive your site'.tr, ''.tr, 'tone2');
|
||||
driverArrivePassengerDialoge();
|
||||
|
||||
update();
|
||||
@@ -188,7 +194,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
NotificationController().showNotification(
|
||||
'Driver Finish Trip'.tr,
|
||||
'you will pay to Driver'.tr + ' ${driverList[3].toString()} \$'.tr,
|
||||
'order');
|
||||
'tone1');
|
||||
Get.find<MapPassengerController>().tripFinishedFromDriver();
|
||||
if (Get.find<PaymentController>().isCashChecked == false &&
|
||||
Get.find<PaymentController>().isWalletChecked == true) {
|
||||
@@ -204,13 +210,13 @@ class FirebaseMessagesController extends GetxController {
|
||||
try {
|
||||
var myListString = message.data['passengerList'];
|
||||
var driverList = jsonDecode(myListString) as List<dynamic>;
|
||||
if (Platform.isAndroid) {
|
||||
NotificationController().showNotification(
|
||||
'Call Income'.tr,
|
||||
message.notification!.body!,
|
||||
'order',
|
||||
);
|
||||
}
|
||||
// if (Platform.isAndroid) {
|
||||
NotificationController().showNotification(
|
||||
'Call Income'.tr,
|
||||
message.notification!.body!,
|
||||
'iphone_ringtone',
|
||||
);
|
||||
// }
|
||||
// Assuming GetMaterialApp is initialized and context is valid for navigation
|
||||
Get.to(() => PassengerCallPage(
|
||||
channelName: driverList[1].toString(),
|
||||
@@ -228,7 +234,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
NotificationController().showNotification(
|
||||
'Call End'.tr,
|
||||
message.notification!.body!,
|
||||
'order',
|
||||
'tone2',
|
||||
);
|
||||
}
|
||||
// Assuming GetMaterialApp is initialized and context is valid for navigation
|
||||
@@ -242,11 +248,14 @@ class FirebaseMessagesController extends GetxController {
|
||||
// .tr,
|
||||
// 'message',
|
||||
// backgroundColor: AppColor.redColor);
|
||||
NotificationController().showNotification(
|
||||
'Driver Cancel Your Trip'.tr,
|
||||
'you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet'
|
||||
.tr,
|
||||
'order');
|
||||
if (Platform.isAndroid) {
|
||||
NotificationController().showNotification(
|
||||
'Driver Cancel Your Trip'.tr,
|
||||
'you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet'
|
||||
.tr,
|
||||
'order');
|
||||
}
|
||||
|
||||
Get.find<MapPassengerController>().restCounter();
|
||||
Get.offAll(const MapPagePassenger());
|
||||
} else if (message.notification!.title! == 'Order Applied') {
|
||||
@@ -335,6 +344,25 @@ class FirebaseMessagesController extends GetxController {
|
||||
}));
|
||||
}
|
||||
|
||||
Future<dynamic> passengerDialog(String message) {
|
||||
return Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'message From passenger'.tr,
|
||||
middleText: message.tr,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: () {
|
||||
// FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
// 'Hi ,I will go now'.tr,
|
||||
// 'I will go now'.tr,
|
||||
// Get.find<MapPassengerController>().driverToken, []);
|
||||
// Get.find<MapPassengerController>()
|
||||
// .startTimerDriverWaitPassenger5Minute();
|
||||
|
||||
Get.back();
|
||||
}));
|
||||
}
|
||||
|
||||
Future<dynamic> driverFinishTripDialoge(List<dynamic> driverList) {
|
||||
return Get.defaultDialog(
|
||||
title: 'Driver Finish Trip'.tr,
|
||||
@@ -412,7 +440,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'tone2.wav'
|
||||
'sound': 'start.wav'
|
||||
},
|
||||
'priority': 'high',
|
||||
'data': <String, dynamic>{
|
||||
@@ -507,7 +535,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'tone2.wav'
|
||||
'sound': 'promo.wav'
|
||||
},
|
||||
'data': <String, dynamic>{
|
||||
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
|
||||
|
||||
@@ -1,160 +1,160 @@
|
||||
// import 'dart:io';
|
||||
//
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_sound/flutter_sound.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:permission_handler/permission_handler.dart';
|
||||
//
|
||||
// import '../home/map_passenger_controller.dart';
|
||||
//
|
||||
// class AudioController extends GetxController {
|
||||
// final recorder = FlutterSoundRecorder();
|
||||
// bool isRecording = false;
|
||||
//
|
||||
// @override
|
||||
// void onInit() {
|
||||
// super.onInit();
|
||||
// initRecorder();
|
||||
// }
|
||||
//
|
||||
// Future<void> initRecorder() async {
|
||||
// final status = await Permission.microphone.request();
|
||||
// if (status != PermissionStatus.granted) {
|
||||
// if (status.isPermanentlyDenied) {
|
||||
// // Handle permission permanently denied
|
||||
// showPermissionDeniedDialog();
|
||||
// } else if (status.isDenied) {
|
||||
// // Handle permission denied
|
||||
// showPermissionDeniedSnackbar();
|
||||
// } else if (status.isRestricted) {
|
||||
// // Handle permission restricted
|
||||
// showPermissionDeniedSnackbar();
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
// await recorder.openRecorder();
|
||||
// recorder.setSubscriptionDuration(const Duration(minutes: 50));
|
||||
// }
|
||||
//
|
||||
// Future<void> startRecording() async {
|
||||
// if (!recorder.isStopped) {
|
||||
// await recorder.startRecorder();
|
||||
// }
|
||||
// isRecording = true;
|
||||
// update();
|
||||
// }
|
||||
//
|
||||
// Future<void> stopRecording() async {
|
||||
// final filePath = await recorder.stopRecorder();
|
||||
// final audioFile = File(filePath!);
|
||||
// print('Recorded file path: $audioFile');
|
||||
// // Now you can send this file to the server
|
||||
// isRecording = false;
|
||||
// update();
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// void onClose() {
|
||||
// recorder.stopRecorder();
|
||||
// super.onClose();
|
||||
// }
|
||||
//
|
||||
// void showPermissionDeniedDialog() {
|
||||
// showDialog(
|
||||
// context: Get.context!,
|
||||
// builder: (context) => AlertDialog(
|
||||
// title: const Text('Microphone Permission'),
|
||||
// content:
|
||||
// const Text('Microphone permission is required to record audio.'),
|
||||
// actions: [
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pop();
|
||||
// openAppSettings();
|
||||
// },
|
||||
// child: const Text('Open Settings'),
|
||||
// ),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// child: const Text('Cancel'),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// void showPermissionDeniedSnackbar() {
|
||||
// Get.snackbar(
|
||||
// 'Microphone Permission',
|
||||
// 'Microphone permission is required to record audio.',
|
||||
// snackPosition: SnackPosition.BOTTOM,
|
||||
// duration: const Duration(seconds: 5),
|
||||
// mainButton: TextButton(
|
||||
// onPressed: () {
|
||||
// openAppSettings();
|
||||
// },
|
||||
// child: const Text(
|
||||
// 'Open Settings',
|
||||
// style: TextStyle(color: Colors.white),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_sound/flutter_sound.dart';
|
||||
import 'package:get/get.dart';
|
||||
// import 'package:flutter_sound/flutter_sound.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
class AudioController extends GetxController {
|
||||
final flutterSoundHelper = FlutterSoundHelper();
|
||||
import '../home/map_passenger_controller.dart';
|
||||
|
||||
class AudioController extends GetxController {
|
||||
final recorder = FlutterSoundRecorder();
|
||||
bool isRecording = false;
|
||||
|
||||
Future<void> startRecording() async {
|
||||
if (!await flutterSoundHelper.hasPermissions()) {
|
||||
await flutterSoundHelper.requestPermissions();
|
||||
}
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
initRecorder();
|
||||
}
|
||||
|
||||
if (!await flutterSoundHelper.hasPermissions()) {
|
||||
Future<void> initRecorder() async {
|
||||
final status = await Permission.microphone.request();
|
||||
if (status != PermissionStatus.granted) {
|
||||
if (status.isPermanentlyDenied) {
|
||||
// Handle permission permanently denied
|
||||
showPermissionDeniedDialog();
|
||||
} else if (status.isDenied) {
|
||||
// Handle permission denied
|
||||
showPermissionDeniedSnackbar();
|
||||
} else if (status.isRestricted) {
|
||||
// Handle permission restricted
|
||||
// showPermissionDeniedSnackbar();
|
||||
}
|
||||
return;
|
||||
}
|
||||
await recorder.openRecorder();
|
||||
recorder.setSubscriptionDuration(const Duration(minutes: 50));
|
||||
}
|
||||
|
||||
await flutterSoundHelper.startRecorder();
|
||||
Future<void> startRecording() async {
|
||||
if (!recorder.isStopped) {
|
||||
await recorder.startRecorder();
|
||||
}
|
||||
isRecording = true;
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> stopRecording() async {
|
||||
if (!isRecording) {
|
||||
return;
|
||||
}
|
||||
|
||||
await flutterSoundHelper.stopRecorder();
|
||||
final filePath = await recorder.stopRecorder();
|
||||
final audioFile = File(filePath!);
|
||||
print('Recorded file path: $audioFile');
|
||||
// Now you can send this file to the server
|
||||
isRecording = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
recorder.stopRecorder();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void showPermissionDeniedDialog() {
|
||||
showDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Microphone Permission'),
|
||||
content:
|
||||
const Text('Microphone permission is required to record audio.'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
openAppSettings();
|
||||
},
|
||||
child: const Text('Open Settings'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void showPermissionDeniedSnackbar() {
|
||||
Get.snackbar(
|
||||
'Microphone Permission',
|
||||
'Microphone permission is required to record audio.',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
duration: const Duration(seconds: 5),
|
||||
mainButton: TextButton(
|
||||
onPressed: () {
|
||||
openAppSettings();
|
||||
},
|
||||
child: const Text(
|
||||
'Open Settings',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class FlutterSoundHelper {
|
||||
final flutterSound = FlutterSoundRecorder();
|
||||
|
||||
Future<bool> hasPermissions() async {
|
||||
return await Permission.microphone.isGranted;
|
||||
}
|
||||
|
||||
Future<void> requestPermissions() async {
|
||||
await Permission.microphone.request();
|
||||
}
|
||||
|
||||
Future<void> startRecorder() async {
|
||||
await flutterSound.openRecorder();
|
||||
await flutterSound.startRecorder(toFile: 'audio.wav');
|
||||
}
|
||||
|
||||
Future<void> stopRecorder() async {
|
||||
await flutterSound.stopRecorder();
|
||||
await flutterSound.closeRecorder();
|
||||
}
|
||||
}
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_sound/public/flutter_sound_recorder.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// // import 'package:flutter_sound/flutter_sound.dart';
|
||||
// import 'package:permission_handler/permission_handler.dart';
|
||||
//
|
||||
// class AudioController extends GetxController {
|
||||
// final flutterSoundHelper = FlutterSoundHelper();
|
||||
//
|
||||
// bool isRecording = false;
|
||||
//
|
||||
// Future<void> startRecording() async {
|
||||
// if (!await flutterSoundHelper.hasPermissions()) {
|
||||
// await flutterSoundHelper.requestPermissions();
|
||||
// }
|
||||
//
|
||||
// if (!await flutterSoundHelper.hasPermissions()) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// await flutterSoundHelper.startRecorder();
|
||||
// isRecording = true;
|
||||
// }
|
||||
//
|
||||
// Future<void> stopRecording() async {
|
||||
// if (!isRecording) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// await flutterSoundHelper.stopRecorder();
|
||||
// isRecording = false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// class FlutterSoundHelper {
|
||||
// final flutterSound = FlutterSoundRecorder();
|
||||
//
|
||||
// Future<bool> hasPermissions() async {
|
||||
// return await Permission.microphone.isGranted;
|
||||
// }
|
||||
//
|
||||
// Future<void> requestPermissions() async {
|
||||
// await Permission.microphone.request();
|
||||
// }
|
||||
//
|
||||
// Future<void> startRecorder() async {
|
||||
// await flutterSound.openRecorder();
|
||||
// await flutterSound.startRecorder(toFile: 'audio.wav');
|
||||
// }
|
||||
//
|
||||
// Future<void> stopRecorder() async {
|
||||
// await flutterSound.stopRecorder();
|
||||
// await flutterSound.closeRecorder();
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -478,8 +478,17 @@ class MyTranslation extends Translations {
|
||||
'Distance from Passenger to destination is ':
|
||||
"المسافة من الراكب إلى الوجهة هي ",
|
||||
'price is': 'التكلفة',
|
||||
'distance is'
|
||||
'No SIM card, no problem! Call your driver directly through our app. We use advanced technology to ensure your privacy.':
|
||||
'حتا لو مفيش كارت SIM, متخفش! تقدر تكلم سواقك بمنتهى البساطة عن طريق التطبيق بتاعنا. احنا بنستخدم تكنولوجيا حديثة عشان نحافظ على خصوصيتك.',
|
||||
'Driver Finish Trip'
|
||||
'distance is'
|
||||
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
||||
'Select one message': "اختر رسالة",
|
||||
'My location is correct. You can search for me using the navigation app':
|
||||
'المكان اللي أنا فيه صح، ممكن تدور عليّا من خلال تطبيق الملاحة',
|
||||
'I\'m waiting for you': 'مستنيك بفارغ الصبر',
|
||||
'Hello, I\'m at the agreed-upon location':
|
||||
' أهلاً وسهلاً، وصلت للمكان اللي اتفقنا عليه',
|
||||
"We noticed the speed is exceeding 100 km/h. Please slow down for your safety. If you feel unsafe, you can share your trip details with a contact or call the police using the red SOS button.":
|
||||
"لقد لاحظنا أن السرعة تتجاوز ١٠٠ كم/ساعة. يرجى التباطؤ من أجل سلامتك. إذا كنت تشعر بعدم الأمان، يمكنك مشاركة تفاصيل رحلتك مع جهة اتصال أو الاتصال بالشرطة باستخدام زر SOS الأحمر.",
|
||||
'Warning: Speeding detected!': "تحذير: تم رصد السرعة الزائدة!",
|
||||
|
||||
@@ -34,7 +34,7 @@ class CallController extends GetxController {
|
||||
await fetchToken();
|
||||
// Set up an instance of Agora engine
|
||||
setupVoiceSDKEngine();
|
||||
join();
|
||||
// join();
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Call Income',
|
||||
'${'You have call from driver'.tr} ${box.read(BoxName.nameDriver)}',
|
||||
|
||||
@@ -16,83 +16,106 @@ class CallPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(title: 'Call Page', isleading: true, body: [callPage()]);
|
||||
return MyScafolld(
|
||||
title: 'Call Page'.tr, isleading: true, body: [callPage()]);
|
||||
}
|
||||
}
|
||||
|
||||
GetBuilder<HomeCaptainController> callPage() {
|
||||
CallController callController = Get.put(CallController());
|
||||
Get.put(MapDriverController());
|
||||
callController.initAgoraFull();
|
||||
// callController.initAgoraFull();
|
||||
return GetBuilder<HomeCaptainController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: Get.height * .2,
|
||||
child: Container(
|
||||
height: 100, width: Get.width,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// await callController.initAgoraFull();
|
||||
// callController.join();
|
||||
// FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
// 'Call Income',
|
||||
// 'You have call from driver ${box.read(BoxName.nameDriver)}',
|
||||
// Get.find<MapDriverController>().tokenPassenger,
|
||||
// [
|
||||
// callController.token,
|
||||
// callController.channelName,
|
||||
// callController.uid.toString(),
|
||||
// callController.remoteUid.toString(),
|
||||
// ],
|
||||
// );
|
||||
// callController.join();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.greenColor),
|
||||
child: const Icon(
|
||||
Icons.phone,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
builder: (controller) => Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
'No SIM card, no problem! Call your driver directly through our app. We use advanced technology to ensure your privacy.'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Column(
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
height: 100, width: Get.width,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(callController.status),
|
||||
Text(Get.find<MapDriverController>().passengerName.toString()),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// await callController.initAgoraFull();
|
||||
// callController.join();
|
||||
// FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
// 'Call Income',
|
||||
// 'You have call from driver ${box.read(BoxName.nameDriver)}',
|
||||
// Get.find<MapDriverController>().tokenPassenger,
|
||||
// [
|
||||
// callController.token,
|
||||
// callController.channelName,
|
||||
// callController.uid.toString(),
|
||||
// callController.remoteUid.toString(),
|
||||
// ],
|
||||
// );
|
||||
callController.join();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.greenColor),
|
||||
child: const Icon(
|
||||
Icons.phone,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(callController.status),
|
||||
Text(Get.find<MapDriverController>()
|
||||
.passengerName
|
||||
.toString()),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Call End',
|
||||
'Call End'.tr,
|
||||
Get.find<MapDriverController>().tokenPassenger,
|
||||
[],
|
||||
);
|
||||
callController.leave();
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.redColor),
|
||||
child: const Icon(
|
||||
Icons.phone_disabled_sharp,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Call End',
|
||||
'Call End'.tr,
|
||||
Get.find<MapDriverController>().tokenPassenger,
|
||||
[],
|
||||
);
|
||||
callController.leave();
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.redColor),
|
||||
child: const Icon(
|
||||
Icons.phone_disabled_sharp,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
)
|
||||
],
|
||||
// ignore: prefer_const_constructors
|
||||
),
|
||||
),
|
||||
// ignore: prefer_const_constructors
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/firebase/firbase_messge.dart';
|
||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/views/home/Captin/home_captain/call_controller.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
|
||||
import '../../../../../constant/box_name.dart';
|
||||
import '../../../../../main.dart';
|
||||
|
||||
class CallPageFromPassenger extends StatelessWidget {
|
||||
const CallPageFromPassenger({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Call Page'.tr, isleading: true, body: [callPage()]);
|
||||
}
|
||||
}
|
||||
|
||||
GetBuilder<HomeCaptainController> callPage() {
|
||||
CallController callController = Get.put(CallController());
|
||||
// callController.initAgoraFull();
|
||||
return GetBuilder<HomeCaptainController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
'No SIM card, no problem! Call your driver directly through our app. We use advanced technology to ensure your privacy.'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
height: 100, width: Get.width,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// await callController.initAgoraFull();
|
||||
// callController.join();
|
||||
// FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
// 'Call Income',
|
||||
// 'You have call from driver ${box.read(BoxName.nameDriver)}',
|
||||
// Get.find<MapDriverController>().tokenPassenger,
|
||||
// [
|
||||
// callController.token,
|
||||
// callController.channelName,
|
||||
// callController.uid.toString(),
|
||||
// callController.remoteUid.toString(),
|
||||
// ],
|
||||
// );
|
||||
callController.join();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.greenColor),
|
||||
child: const Icon(
|
||||
Icons.phone,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(callController.status),
|
||||
Text(Get.find<MapPassengerController>()
|
||||
.driverName
|
||||
.toString()),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Call End',
|
||||
'Call End'.tr,
|
||||
Get.find<MapPassengerController>().driverToken,
|
||||
[],
|
||||
);
|
||||
callController.leave();
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.redColor),
|
||||
child: const Icon(
|
||||
Icons.phone_disabled_sharp,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
// ignore: prefer_const_constructors
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import '../../../../../constant/colors.dart';
|
||||
import '../../../../../controller/functions/audio_recorder_controller.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
import '../../../../../controller/functions/location_controller.dart';
|
||||
|
||||
@@ -24,6 +25,9 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
AudioController audio = Get.put(AudioController());
|
||||
audio.startRecording();
|
||||
|
||||
// Get.to((OrderRequestPage()));
|
||||
// ZonesController mapDriverController =
|
||||
// Get.put(ZonesController());
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:SEFER/controller/functions/location_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -19,11 +18,11 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
top: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? mapDriverController.driverEndPage = 190
|
||||
: 170,
|
||||
width: 240,
|
||||
// width: 240,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
|
||||
@@ -61,7 +61,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
controller.isSocialPressed =
|
||||
true;
|
||||
await controller
|
||||
.driverCallPassenger();
|
||||
.driverCallPassenger(); // to check from scam
|
||||
Get.to(
|
||||
() => const CallPage());
|
||||
// launchCommunication('phone',
|
||||
@@ -95,8 +95,8 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
decoration:
|
||||
AppStyle.boxDecoration,
|
||||
child: IconButton(
|
||||
onPressed: () async{await
|
||||
controller
|
||||
onPressed: () async {
|
||||
await controller
|
||||
.openGoogleMapFromDriverToPassenger();
|
||||
},
|
||||
icon: const Icon(
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/firebase/firbase_messge.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/home/Captin/home_captain/widget/call_page.dart';
|
||||
import 'package:SEFER/views/home/map_widget.dart/call_passenger_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -16,14 +19,14 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.statusRide == 'Apply' &&
|
||||
controller.isSearchingWindow == false) {
|
||||
double _height = 250;
|
||||
// double _height = Get.height * .2;
|
||||
return Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: _height,
|
||||
height: Get.height * .2,
|
||||
child: ListView(
|
||||
children: [
|
||||
Text.rich(
|
||||
@@ -133,7 +136,74 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
onPressed: () async {
|
||||
Get.defaultDialog(
|
||||
title: 'Select one message'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'message From passenger',
|
||||
'Hello, I\'m at the agreed-upon location'
|
||||
.tr,
|
||||
controller.driverToken);
|
||||
Get.back();
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(4),
|
||||
child: Text(
|
||||
'Hello, I\'m at the agreed-upon location'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'message From passenger',
|
||||
'My location is correct. You can search for me using the navigation app'
|
||||
.tr,
|
||||
controller.driverToken);
|
||||
Get.back();
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(4),
|
||||
child: Text(
|
||||
'My location is correct. You can search for me using the navigation app'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'message From passenger',
|
||||
'I\'m waiting for you'
|
||||
.tr,
|
||||
controller.driverToken);
|
||||
Get.back();
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(4),
|
||||
child: Text(
|
||||
'I\'m waiting for you'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.message,
|
||||
color: AppColor.blueColor,
|
||||
@@ -143,6 +213,8 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
HapticFeedback.heavyImpact();
|
||||
Get.to(() => const CallPage());
|
||||
// Get.to(() => PassengerCallPage());
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.call,
|
||||
|
||||
@@ -21,7 +21,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
ProfileController profileController = Get.put(ProfileController());
|
||||
AudioController audioController = Get.put(AudioController());
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.rideTimerBegin ||
|
||||
if ( //controller.rideTimerBegin ||
|
||||
controller.statusRide == 'Begin' && !controller.statusRideFromStart) {
|
||||
return Positioned(
|
||||
left: 10,
|
||||
|
||||
Reference in New Issue
Block a user