This commit is contained in:
Hamza Aleghwairyeen
2024-04-10 02:42:17 +03:00
parent 8ca9e65f4c
commit 88b671c112
23 changed files with 564 additions and 241 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -147,38 +147,44 @@ class FirebaseMessagesController extends GetxController {
driverID = myList[2].toString(); driverID = myList[2].toString();
NotificationController().showNotification( 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(); // driverAppliedTripSnakBar();
} else if (message.notification!.title! == 'Promo') { } else if (message.notification!.title! == 'Promo') {
NotificationController() NotificationController()
.showNotification('Promo', 'Show latest promo'.tr, 'order'); .showNotification('Promo', 'Show latest promo'.tr, 'promo');
Get.to(const PromosPassengerPage()); Get.to(const PromosPassengerPage());
} else if (message.notification!.title == 'Cancel Trip') { } else if (message.notification!.title == 'Cancel Trip') {
NotificationController().showNotification( NotificationController().showNotification(
'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'order'); 'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'cancel');
cancelTripDialog(); cancelTripDialog();
} else if (message.notification!.title! == 'DriverIsGoingToPassenger') { } else if (message.notification!.title! == 'DriverIsGoingToPassenger') {
Get.find<MapPassengerController>().isDriverInPassengerWay = true; Get.find<MapPassengerController>().isDriverInPassengerWay = true;
Get.find<MapPassengerController>().update(); Get.find<MapPassengerController>().update();
NotificationController().showNotification('Driver is Going To You'.tr, 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', '', // Get.snackbar('Driver is Going To Passenger', '',
// backgroundColor: AppColor.greenColor); // 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') { } else if (message.notification!.title! == 'RideIsBegin') {
Get.find<MapPassengerController>().getBeginRideFromDriver(); Get.find<MapPassengerController>().getBeginRideFromDriver();
// Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor); // Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
NotificationController() NotificationController()
.showNotification('Trip is Begin'.tr, ''.tr, 'order'); .showNotification('Trip is Begin'.tr, ''.tr, 'start');
update(); update();
} else if (message.notification!.title! == 'Hi ,I will go now') { } else if (message.notification!.title! == 'Hi ,I will go now') {
// Get.snackbar('Hi ,I will go now', '', // Get.snackbar('Hi ,I will go now', '',
// backgroundColor: AppColor.greenColor); // backgroundColor: AppColor.greenColor);
NotificationController().showNotification( 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(); update();
} else if (message.notification!.title! == 'Hi ,I Arrive your site') { } else if (message.notification!.title! == 'Hi ,I Arrive your site') {
NotificationController() NotificationController()
.showNotification('Hi ,I Arrive your site'.tr, ''.tr, 'order'); .showNotification('Hi ,I Arrive your site'.tr, ''.tr, 'tone2');
driverArrivePassengerDialoge(); driverArrivePassengerDialoge();
update(); update();
@@ -188,7 +194,7 @@ class FirebaseMessagesController extends GetxController {
NotificationController().showNotification( NotificationController().showNotification(
'Driver Finish Trip'.tr, 'Driver Finish Trip'.tr,
'you will pay to Driver'.tr + ' ${driverList[3].toString()} \$'.tr, 'you will pay to Driver'.tr + ' ${driverList[3].toString()} \$'.tr,
'order'); 'tone1');
Get.find<MapPassengerController>().tripFinishedFromDriver(); Get.find<MapPassengerController>().tripFinishedFromDriver();
if (Get.find<PaymentController>().isCashChecked == false && if (Get.find<PaymentController>().isCashChecked == false &&
Get.find<PaymentController>().isWalletChecked == true) { Get.find<PaymentController>().isWalletChecked == true) {
@@ -204,13 +210,13 @@ class FirebaseMessagesController extends GetxController {
try { try {
var myListString = message.data['passengerList']; var myListString = message.data['passengerList'];
var driverList = jsonDecode(myListString) as List<dynamic>; var driverList = jsonDecode(myListString) as List<dynamic>;
if (Platform.isAndroid) { // if (Platform.isAndroid) {
NotificationController().showNotification( NotificationController().showNotification(
'Call Income'.tr, 'Call Income'.tr,
message.notification!.body!, message.notification!.body!,
'order', 'iphone_ringtone',
); );
} // }
// Assuming GetMaterialApp is initialized and context is valid for navigation // Assuming GetMaterialApp is initialized and context is valid for navigation
Get.to(() => PassengerCallPage( Get.to(() => PassengerCallPage(
channelName: driverList[1].toString(), channelName: driverList[1].toString(),
@@ -228,7 +234,7 @@ class FirebaseMessagesController extends GetxController {
NotificationController().showNotification( NotificationController().showNotification(
'Call End'.tr, 'Call End'.tr,
message.notification!.body!, message.notification!.body!,
'order', 'tone2',
); );
} }
// Assuming GetMaterialApp is initialized and context is valid for navigation // Assuming GetMaterialApp is initialized and context is valid for navigation
@@ -242,11 +248,14 @@ class FirebaseMessagesController extends GetxController {
// .tr, // .tr,
// 'message', // 'message',
// backgroundColor: AppColor.redColor); // backgroundColor: AppColor.redColor);
if (Platform.isAndroid) {
NotificationController().showNotification( NotificationController().showNotification(
'Driver Cancel Your Trip'.tr, 'Driver Cancel Your Trip'.tr,
'you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet' 'you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet'
.tr, .tr,
'order'); 'order');
}
Get.find<MapPassengerController>().restCounter(); Get.find<MapPassengerController>().restCounter();
Get.offAll(const MapPagePassenger()); Get.offAll(const MapPagePassenger());
} else if (message.notification!.title! == 'Order Applied') { } 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) { Future<dynamic> driverFinishTripDialoge(List<dynamic> driverList) {
return Get.defaultDialog( return Get.defaultDialog(
title: 'Driver Finish Trip'.tr, title: 'Driver Finish Trip'.tr,
@@ -412,7 +440,7 @@ class FirebaseMessagesController extends GetxController {
'notification': <String, dynamic>{ 'notification': <String, dynamic>{
'title': title, 'title': title,
'body': body, 'body': body,
'sound': 'tone2.wav' 'sound': 'start.wav'
}, },
'priority': 'high', 'priority': 'high',
'data': <String, dynamic>{ 'data': <String, dynamic>{
@@ -507,7 +535,7 @@ class FirebaseMessagesController extends GetxController {
'notification': <String, dynamic>{ 'notification': <String, dynamic>{
'title': title, 'title': title,
'body': body, 'body': body,
'sound': 'tone2.wav' 'sound': 'promo.wav'
}, },
'data': <String, dynamic>{ 'data': <String, dynamic>{
'click_action': 'FLUTTER_NOTIFICATION_CLICK', 'click_action': 'FLUTTER_NOTIFICATION_CLICK',

View File

@@ -1,160 +1,160 @@
// import 'dart:io'; 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 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_sound/flutter_sound.dart'; import 'package:flutter_sound/flutter_sound.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
// import 'package:flutter_sound/flutter_sound.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
class AudioController extends GetxController { import '../home/map_passenger_controller.dart';
final flutterSoundHelper = FlutterSoundHelper();
class AudioController extends GetxController {
final recorder = FlutterSoundRecorder();
bool isRecording = false; bool isRecording = false;
Future<void> startRecording() async { @override
if (!await flutterSoundHelper.hasPermissions()) { void onInit() {
await flutterSoundHelper.requestPermissions(); 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; 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; isRecording = true;
update();
} }
Future<void> stopRecording() async { Future<void> stopRecording() async {
if (!isRecording) { final filePath = await recorder.stopRecorder();
return; final audioFile = File(filePath!);
} print('Recorded file path: $audioFile');
// Now you can send this file to the server
await flutterSoundHelper.stopRecorder();
isRecording = false; isRecording = false;
} update();
} }
class FlutterSoundHelper { @override
final flutterSound = FlutterSoundRecorder(); void onClose() {
recorder.stopRecorder();
Future<bool> hasPermissions() async { super.onClose();
return await Permission.microphone.isGranted;
} }
Future<void> requestPermissions() async { void showPermissionDeniedDialog() {
await Permission.microphone.request(); 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'),
),
],
),
);
} }
Future<void> startRecorder() async { void showPermissionDeniedSnackbar() {
await flutterSound.openRecorder(); Get.snackbar(
await flutterSound.startRecorder(toFile: 'audio.wav'); 'Microphone Permission',
} 'Microphone permission is required to record audio.',
snackPosition: SnackPosition.BOTTOM,
Future<void> stopRecorder() async { duration: const Duration(seconds: 5),
await flutterSound.stopRecorder(); mainButton: TextButton(
await flutterSound.closeRecorder(); onPressed: () {
openAppSettings();
},
child: const Text(
'Open Settings',
style: TextStyle(color: Colors.white),
),
),
);
} }
} }
// 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();
// }
// }

View File

@@ -478,8 +478,17 @@ class MyTranslation extends Translations {
'Distance from Passenger to destination is ': 'Distance from Passenger to destination is ':
"المسافة من الراكب إلى الوجهة هي ", "المسافة من الراكب إلى الوجهة هي ",
'price is': '‏التكلفة', 'price 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' 'distance is'
'Cost Of Trip 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.": "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 الأحمر.", "لقد لاحظنا أن السرعة تتجاوز ١٠٠ كم/ساعة. يرجى التباطؤ من أجل سلامتك. إذا كنت تشعر بعدم الأمان، يمكنك مشاركة تفاصيل رحلتك مع جهة اتصال أو الاتصال بالشرطة باستخدام زر SOS الأحمر.",
'Warning: Speeding detected!': "تحذير: تم رصد السرعة الزائدة!", 'Warning: Speeding detected!': "تحذير: تم رصد السرعة الزائدة!",

View File

@@ -34,7 +34,7 @@ class CallController extends GetxController {
await fetchToken(); await fetchToken();
// Set up an instance of Agora engine // Set up an instance of Agora engine
setupVoiceSDKEngine(); setupVoiceSDKEngine();
join(); // join();
FirebaseMessagesController().sendNotificationToPassengerToken( FirebaseMessagesController().sendNotificationToPassengerToken(
'Call Income', 'Call Income',
'${'You have call from driver'.tr} ${box.read(BoxName.nameDriver)}', '${'You have call from driver'.tr} ${box.read(BoxName.nameDriver)}',

View File

@@ -16,20 +16,38 @@ class CallPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { 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() { GetBuilder<HomeCaptainController> callPage() {
CallController callController = Get.put(CallController()); CallController callController = Get.put(CallController());
Get.put(MapDriverController()); Get.put(MapDriverController());
callController.initAgoraFull(); // callController.initAgoraFull();
return GetBuilder<HomeCaptainController>( return GetBuilder<HomeCaptainController>(
builder: (controller) => Positioned( builder: (controller) => Column(
top: Get.height * .2, 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,
),
),
),
const SizedBox(
height: 30,
),
Padding(
padding: const EdgeInsets.all(15),
child: Container( child: Container(
height: 100, width: Get.width, height: 100, width: Get.width,
decoration: AppStyle.boxDecoration, decoration: AppStyle.boxDecoration1,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@@ -48,7 +66,7 @@ GetBuilder<HomeCaptainController> callPage() {
// callController.remoteUid.toString(), // callController.remoteUid.toString(),
// ], // ],
// ); // );
// callController.join(); callController.join();
}, },
child: Container( child: Container(
width: 50, width: 50,
@@ -64,12 +82,15 @@ GetBuilder<HomeCaptainController> callPage() {
Column( Column(
children: [ children: [
Text(callController.status), Text(callController.status),
Text(Get.find<MapDriverController>().passengerName.toString()), Text(Get.find<MapDriverController>()
.passengerName
.toString()),
], ],
), ),
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
FirebaseMessagesController().sendNotificationToPassengerToken( FirebaseMessagesController()
.sendNotificationToPassengerToken(
'Call End', 'Call End',
'Call End'.tr, 'Call End'.tr,
Get.find<MapDriverController>().tokenPassenger, Get.find<MapDriverController>().tokenPassenger,
@@ -94,5 +115,7 @@ GetBuilder<HomeCaptainController> callPage() {
// ignore: prefer_const_constructors // ignore: prefer_const_constructors
), ),
), ),
],
),
); );
} }

View File

@@ -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
),
),
],
),
);
}

View File

@@ -5,6 +5,7 @@ import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../../../constant/colors.dart'; import '../../../../../constant/colors.dart';
import '../../../../../controller/functions/audio_recorder_controller.dart';
import '../../../../Rate/ride_calculate_driver.dart'; import '../../../../Rate/ride_calculate_driver.dart';
import '../../../../../controller/functions/location_controller.dart'; import '../../../../../controller/functions/location_controller.dart';
@@ -24,6 +25,9 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
borderRadius: BorderRadius.circular(15)), borderRadius: BorderRadius.circular(15)),
child: IconButton( child: IconButton(
onPressed: () { onPressed: () {
AudioController audio = Get.put(AudioController());
audio.startRecording();
// Get.to((OrderRequestPage())); // Get.to((OrderRequestPage()));
// ZonesController mapDriverController = // ZonesController mapDriverController =
// Get.put(ZonesController()); // Get.put(ZonesController());

View File

@@ -1,6 +1,5 @@
import 'dart:io'; import 'dart:io';
import 'package:SEFER/controller/functions/location_controller.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -19,11 +18,11 @@ GetBuilder<MapDriverController> driverEndRideBar() {
top: 5, top: 5,
right: 5, right: 5,
child: Container( child: Container(
decoration: AppStyle.boxDecoration, decoration: AppStyle.boxDecoration1,
height: mapDriverController.remainingTimeTimerRideBegin < 60 height: mapDriverController.remainingTimeTimerRideBegin < 60
? mapDriverController.driverEndPage = 190 ? mapDriverController.driverEndPage = 190
: 170, : 170,
width: 240, // width: 240,
child: Column( child: Column(
children: [ children: [
Row( Row(

View File

@@ -61,7 +61,7 @@ class PassengerInfoWindow extends StatelessWidget {
controller.isSocialPressed = controller.isSocialPressed =
true; true;
await controller await controller
.driverCallPassenger(); .driverCallPassenger(); // to check from scam
Get.to( Get.to(
() => const CallPage()); () => const CallPage());
// launchCommunication('phone', // launchCommunication('phone',
@@ -95,8 +95,8 @@ class PassengerInfoWindow extends StatelessWidget {
decoration: decoration:
AppStyle.boxDecoration, AppStyle.boxDecoration,
child: IconButton( child: IconButton(
onPressed: () async{await onPressed: () async {
controller await controller
.openGoogleMapFromDriverToPassenger(); .openGoogleMapFromDriverToPassenger();
}, },
icon: const Icon( icon: const Icon(

View File

@@ -1,7 +1,10 @@
import 'package:SEFER/constant/colors.dart'; import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.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/controller/home/map_passenger_controller.dart';
import 'package:SEFER/main.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/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -16,14 +19,14 @@ class ApplyOrderWidget extends StatelessWidget {
return GetBuilder<MapPassengerController>(builder: (controller) { return GetBuilder<MapPassengerController>(builder: (controller) {
if (controller.statusRide == 'Apply' && if (controller.statusRide == 'Apply' &&
controller.isSearchingWindow == false) { controller.isSearchingWindow == false) {
double _height = 250; // double _height = Get.height * .2;
return Positioned( return Positioned(
bottom: 0, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,
child: Container( child: Container(
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,
height: _height, height: Get.height * .2,
child: ListView( child: ListView(
children: [ children: [
Text.rich( Text.rich(
@@ -133,7 +136,74 @@ class ApplyOrderWidget extends StatelessWidget {
], ],
), ),
IconButton( 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( icon: const Icon(
Icons.message, Icons.message,
color: AppColor.blueColor, color: AppColor.blueColor,
@@ -143,6 +213,8 @@ class ApplyOrderWidget extends StatelessWidget {
IconButton( IconButton(
onPressed: () { onPressed: () {
HapticFeedback.heavyImpact(); HapticFeedback.heavyImpact();
Get.to(() => const CallPage());
// Get.to(() => PassengerCallPage());
}, },
icon: const Icon( icon: const Icon(
Icons.call, Icons.call,

View File

@@ -21,7 +21,7 @@ class RideBeginPassenger extends StatelessWidget {
ProfileController profileController = Get.put(ProfileController()); ProfileController profileController = Get.put(ProfileController());
AudioController audioController = Get.put(AudioController()); AudioController audioController = Get.put(AudioController());
return GetBuilder<MapPassengerController>(builder: (controller) { return GetBuilder<MapPassengerController>(builder: (controller) {
if (controller.rideTimerBegin || if ( //controller.rideTimerBegin ||
controller.statusRide == 'Begin' && !controller.statusRideFromStart) { controller.statusRide == 'Begin' && !controller.statusRideFromStart) {
return Positioned( return Positioned(
left: 10, left: 10,

View File

@@ -8,6 +8,7 @@
#include <file_selector_linux/file_selector_plugin.h> #include <file_selector_linux/file_selector_plugin.h>
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h> #include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
#include <record_linux/record_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h> #include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
@@ -17,6 +18,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
g_autoptr(FlPluginRegistrar) record_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "RecordLinuxPlugin");
record_linux_plugin_register_with_registrar(record_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);

View File

@@ -5,6 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux file_selector_linux
flutter_secure_storage_linux flutter_secure_storage_linux
record_linux
url_launcher_linux url_launcher_linux
) )

View File

@@ -20,6 +20,7 @@ import just_audio
import location import location
import package_info_plus import package_info_plus
import path_provider_foundation import path_provider_foundation
import record_darwin
import sqflite import sqflite
import url_launcher_macos import url_launcher_macos
import video_player_avfoundation import video_player_avfoundation
@@ -41,6 +42,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
RecordPlugin.register(with: registry.registrar(forPlugin: "RecordPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin")) FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))

View File

@@ -1584,6 +1584,62 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.1.0" version: "4.1.0"
record:
dependency: "direct main"
description:
name: record
sha256: "113b368168c49c78902ab37c2b354dea30a0aec5bdeca434073826b6ea73eca1"
url: "https://pub.dev"
source: hosted
version: "5.0.5"
record_android:
dependency: transitive
description:
name: record_android
sha256: "0df98e05873b22b443309e289bf1eb3b5b9a60e7779134334e2073eb0763a992"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
record_darwin:
dependency: transitive
description:
name: record_darwin
sha256: ee8cb1bb1712d7ce38140ecabe70e5c286c02f05296d66043bee865ace7eb1b9
url: "https://pub.dev"
source: hosted
version: "1.0.1"
record_linux:
dependency: transitive
description:
name: record_linux
sha256: "7d0e70cd51635128fe9d37d89bafd6011d7cbba9af8dc323079ae60f23546aef"
url: "https://pub.dev"
source: hosted
version: "0.7.1"
record_platform_interface:
dependency: transitive
description:
name: record_platform_interface
sha256: "3a4b56e94ecd2a0b2b43eb1fa6f94c5b8484334f5d38ef43959c4bf97fb374cf"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
record_web:
dependency: transitive
description:
name: record_web
sha256: "24847cdbcf999f7a5762170792f622ac844858766becd0f2370ec8ae22f7526e"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
record_windows:
dependency: transitive
description:
name: record_windows
sha256: "39998b3ea7d8d28b04159d82220e6e5e32a7c357c6fb2794f5736beea272f6c3"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
rxdart: rxdart:
dependency: transitive dependency: transitive
description: description:

View File

@@ -58,6 +58,7 @@ dependencies:
wakelock_plus: wakelock_plus:
background_location: ^0.13.0 background_location: ^0.13.0
flutter_sound: ^9.2.13 flutter_sound: ^9.2.13
record: ^5.0.5

View File

@@ -15,6 +15,7 @@
#include <iris_method_channel/iris_method_channel_plugin_c_api.h> #include <iris_method_channel/iris_method_channel_plugin_c_api.h>
#include <local_auth_windows/local_auth_plugin.h> #include <local_auth_windows/local_auth_plugin.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h> #include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <record_windows/record_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
@@ -36,6 +37,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("LocalAuthPlugin")); registry->GetRegistrarForPlugin("LocalAuthPlugin"));
PermissionHandlerWindowsPluginRegisterWithRegistrar( PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
RecordWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("RecordWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar( UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows")); registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }

View File

@@ -12,6 +12,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
iris_method_channel iris_method_channel
local_auth_windows local_auth_windows
permission_handler_windows permission_handler_windows
record_windows
url_launcher_windows url_launcher_windows
) )