4/23/1
This commit is contained in:
@@ -222,6 +222,8 @@ PODS:
|
||||
- record_darwin (1.0.0):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- share (0.0.1):
|
||||
- Flutter
|
||||
- sqflite (0.0.3):
|
||||
- Flutter
|
||||
- FMDB (>= 2.7.5)
|
||||
@@ -302,6 +304,7 @@ DEPENDENCIES:
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||
- record_darwin (from `.symlinks/plugins/record_darwin/ios`)
|
||||
- share (from `.symlinks/plugins/share/ios`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||
- stripe_ios (from `.symlinks/plugins/stripe_ios/ios`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
@@ -403,6 +406,8 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
record_darwin:
|
||||
:path: ".symlinks/plugins/record_darwin/ios"
|
||||
share:
|
||||
:path: ".symlinks/plugins/share/ios"
|
||||
sqflite:
|
||||
:path: ".symlinks/plugins/sqflite/ios"
|
||||
stripe_ios:
|
||||
@@ -472,6 +477,7 @@ SPEC CHECKSUMS:
|
||||
permission_handler_apple: 036b856153a2b1f61f21030ff725f3e6fece2b78
|
||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||
record_darwin: 1f6619f2abac4d1ca91d3eeab038c980d76f1517
|
||||
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
|
||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||
Stripe: e046335ab6e3f25d39f1a55bd98620a85269cffa
|
||||
stripe_ios: 37dd66ec680264019be16c5f47333f381164e6a6
|
||||
|
||||
@@ -95,7 +95,7 @@ class LoginController extends GetxController {
|
||||
if (jsonDecoeded.isNotEmpty) {
|
||||
if (jsonDecoeded['status'] == 'success') {
|
||||
print(jsonDecoeded['data'][0]['verified']);
|
||||
if (jsonDecoeded['data'][0]['verified'] == '1') {
|
||||
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
||||
box.write(BoxName.passengerID, jsonDecoeded['data'][0]['id']);
|
||||
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
|
||||
box.write(
|
||||
|
||||
119
lib/controller/functions/audio_record1.dart
Normal file
119
lib/controller/functions/audio_record1.dart
Normal file
@@ -0,0 +1,119 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
// import 'package:flutter_sound/flutter_sound.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
import 'package:record/record.dart';
|
||||
|
||||
class AudioRecorderController extends GetxController {
|
||||
AudioPlayer audioPlayer = AudioPlayer();
|
||||
AudioRecorder recorder = AudioRecorder();
|
||||
|
||||
bool isRecording = false;
|
||||
String filePath = '';
|
||||
String? selectedFilePath;
|
||||
double currentPosition = 0;
|
||||
double totalDuration = 0;
|
||||
String? selectedFile;
|
||||
|
||||
Future<void> startRecording() async {
|
||||
final bool isPermissionGranted = await recorder.hasPermission();
|
||||
if (!isPermissionGranted) {
|
||||
// RecordingPermissionException('l');
|
||||
print('sss');
|
||||
return;
|
||||
}
|
||||
|
||||
final directory = await getApplicationDocumentsDirectory();
|
||||
// Generate a unique file name using the current timestamp
|
||||
String fileName =
|
||||
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}_${Get.find<MapPassengerController>().rideId}.m4a';
|
||||
filePath = '${directory.path}/$fileName';
|
||||
|
||||
// Define the configuration for the recording
|
||||
const config = RecordConfig(
|
||||
// Specify the format, encoder, sample rate, etc., as needed
|
||||
encoder: AudioEncoder.aacLc, // For example, using AAC codec
|
||||
sampleRate: 44100, // Sample rate
|
||||
bitRate: 128000, // Bit rate
|
||||
);
|
||||
|
||||
// Start recording to file with the specified configuration
|
||||
await recorder.start(config, path: filePath);
|
||||
|
||||
isRecording = true;
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> stopRecording() async {
|
||||
final path = await recorder.stop();
|
||||
print(path);
|
||||
isRecording = false;
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> playRecording() async {
|
||||
if (filePath != null) {
|
||||
await audioPlayer.setFilePath(filePath!);
|
||||
totalDuration = audioPlayer.duration?.inSeconds.toDouble() ?? 0;
|
||||
audioPlayer.play();
|
||||
|
||||
audioPlayer.positionStream.listen((position) {
|
||||
currentPosition = position.inSeconds.toDouble();
|
||||
});
|
||||
selectedFilePath = filePath;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<String>> getRecordedFiles() async {
|
||||
final directory = await getApplicationDocumentsDirectory();
|
||||
final files = await directory.list().toList();
|
||||
return files
|
||||
.map((file) => file.path)
|
||||
.where((path) => path.endsWith('.m4a'))
|
||||
.toList();
|
||||
}
|
||||
|
||||
Future<void> playRecordedFile(String filePath) async {
|
||||
await audioPlayer.setFilePath(filePath);
|
||||
totalDuration = audioPlayer.duration?.inSeconds.toDouble() ?? 0;
|
||||
audioPlayer.play();
|
||||
|
||||
audioPlayer.positionStream.listen((position) {
|
||||
currentPosition = position.inSeconds.toDouble();
|
||||
});
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> deleteRecordedFile(String filePath) async {
|
||||
final file = File(filePath);
|
||||
if (await file.exists()) {
|
||||
await file.delete();
|
||||
print('File deleted: $filePath');
|
||||
await getRecordedFiles();
|
||||
} else {
|
||||
print('File not found: $filePath');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> deleteAllRecordedFiles() async {
|
||||
final directory = await getApplicationDocumentsDirectory();
|
||||
final files = await directory.list().toList();
|
||||
for (final file in files) {
|
||||
if (file.path.endsWith('.m4a')) {
|
||||
await deleteRecordedFile(file.path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
audioPlayer.dispose();
|
||||
recorder.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
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_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();
|
||||
// }
|
||||
// }
|
||||
File diff suppressed because it is too large
Load Diff
@@ -98,7 +98,9 @@ class RateController extends GetxController {
|
||||
await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
|
||||
'driverID': Get.find<MapPassengerController>().driverId.toString(),
|
||||
'paymentID': '${Get.find<MapPassengerController>().rideId}tip',
|
||||
'amount': (tip * 100).toString(),
|
||||
'amount': box.read(BoxName.countryCode) == 'Egypt'
|
||||
? tip.toStringAsFixed(0)
|
||||
: (tip * 100).toString(),
|
||||
'paymentMethod': 'visa-tip',
|
||||
});
|
||||
|
||||
|
||||
@@ -2,52 +2,34 @@ 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/functions/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 '../../../../../controller/functions/call_controller.dart';
|
||||
import '../../../../../main.dart';
|
||||
|
||||
class CallPage extends StatelessWidget {
|
||||
const CallPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Call Page'.tr, isleading: true, body: [callPage()]);
|
||||
return MyScafolld(title: 'Call Page', isleading: true, body: [callPage()]);
|
||||
}
|
||||
}
|
||||
|
||||
GetBuilder<HomeCaptainController> callPage() {
|
||||
CallController callController = Get.put(CallController());
|
||||
Get.put(MapDriverController());
|
||||
// callController.initAgoraFull();
|
||||
callController.initAgoraFull();
|
||||
return GetBuilder<HomeCaptainController>(
|
||||
builder: (controller) => Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
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),
|
||||
builder: (controller) => Positioned(
|
||||
top: Get.height * .2,
|
||||
child: Container(
|
||||
height: 100, width: Get.width,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
@@ -55,17 +37,17 @@ GetBuilder<HomeCaptainController> callPage() {
|
||||
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(),
|
||||
// ],
|
||||
// );
|
||||
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(
|
||||
@@ -82,17 +64,14 @@ GetBuilder<HomeCaptainController> callPage() {
|
||||
Column(
|
||||
children: [
|
||||
Text(callController.status),
|
||||
Text(Get.find<MapDriverController>()
|
||||
.passengerName
|
||||
.toString()),
|
||||
Text(Get.find<MapDriverController>().passengerName.toString()),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Call End',
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Call End'.tr,
|
||||
'Call End',
|
||||
Get.find<MapDriverController>().tokenPassenger,
|
||||
[],
|
||||
);
|
||||
@@ -115,7 +94,5 @@ GetBuilder<HomeCaptainController> callPage() {
|
||||
// ignore: prefer_const_constructors
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,11 +4,7 @@ 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 '../../../../../constant/api_key.dart';
|
||||
import '../../../../../constant/char_map.dart';
|
||||
import '../../../../../constant/colors.dart';
|
||||
import '../../../../../constant/credential.dart';
|
||||
import '../../../../../controller/functions/audio_recorder_controller.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
import '../../../../../controller/functions/location_controller.dart';
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import 'package:SEFER/controller/functions/tts.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/lang/languages.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:share/share.dart';
|
||||
|
||||
import '../../controller/functions/audio_record1.dart';
|
||||
import 'profile/passenger_profile_page.dart';
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
@@ -18,25 +23,6 @@ class HomePage extends StatelessWidget {
|
||||
body: [
|
||||
Column(
|
||||
children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
// child: ListTile(
|
||||
// title: Text(
|
||||
// 'Settings'.tr,
|
||||
// style: AppStyle.headTitle2,
|
||||
// ),
|
||||
// subtitle: Text('To change some Settings'.tr),
|
||||
// trailing: const Icon(
|
||||
// Icons.arrow_forward_ios,
|
||||
// size: 30,
|
||||
// color: AppColor.primaryColor,
|
||||
// ),
|
||||
// leading: const Icon(
|
||||
// Icons.settings,
|
||||
// color: AppColor.primaryColor,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
ListTile(
|
||||
onTap: () {
|
||||
Get.to(() => const Language());
|
||||
@@ -57,7 +43,7 @@ class HomePage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.place_outlined),
|
||||
leading: const Icon(Icons.location_city_outlined),
|
||||
title: Text(
|
||||
'Change Country'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
@@ -69,6 +55,130 @@ class HomePage extends StatelessWidget {
|
||||
body: [CountryPickerFromSetting()],
|
||||
isleading: true)),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.record_voice_over_outlined),
|
||||
title: Text(
|
||||
'Trips recorded'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text('Here recorded trips audio'.tr),
|
||||
onTap: () async {
|
||||
Get.defaultDialog(
|
||||
title: 'Select recorded trip'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content:
|
||||
GetBuilder<AudioRecorderController>(builder: (audio) {
|
||||
return Column(
|
||||
children: [
|
||||
FutureBuilder<List<String>>(
|
||||
future: audio.getRecordedFiles(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return const CircularProgressIndicator();
|
||||
} else if (snapshot.hasData) {
|
||||
final recordedFiles = snapshot.data!;
|
||||
return DropdownButton<String>(
|
||||
value: audio.selectedFilePath,
|
||||
onChanged: (value) {
|
||||
audio.selectedFilePath = value;
|
||||
audio.playRecordedFile(value!);
|
||||
audio.update();
|
||||
},
|
||||
items: recordedFiles
|
||||
.map((file) => DropdownMenuItem<String>(
|
||||
value: file,
|
||||
child: Text(path.basename(file)),
|
||||
))
|
||||
.toList(),
|
||||
);
|
||||
} else {
|
||||
return Text('Error: ${snapshot.error}');
|
||||
}
|
||||
},
|
||||
),
|
||||
Slider(
|
||||
value: audio.currentPosition,
|
||||
max: audio.totalDuration,
|
||||
inactiveColor: AppColor.accentColor,
|
||||
label: audio.currentPosition.toString(),
|
||||
onChanged: (value) {
|
||||
audio.currentPosition = value;
|
||||
// audio.update();
|
||||
audio.audioPlayer
|
||||
.seek(Duration(seconds: value.toInt()));
|
||||
},
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
color: Colors.grey[200],
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
audio.selectedFilePath != null
|
||||
? '${'Selected file:'.tr} ${path.basename(audio.selectedFilePath!)}'
|
||||
: 'No file selected'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
if (audio.selectedFilePath != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.share),
|
||||
onPressed: () {
|
||||
Share.shareFiles(
|
||||
[audio.selectedFilePath!]);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you sure to delete recorded files'
|
||||
.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.find<TextToSpeechController>()
|
||||
.speakText(
|
||||
'this will delete all files from your device'
|
||||
.tr);
|
||||
},
|
||||
icon: const Icon(Icons.headphones),
|
||||
),
|
||||
Text(
|
||||
'this will delete all files from your device'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
titleStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Delete'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () async {
|
||||
await audio
|
||||
// .deleteRecordedFile(audio.selectedFilePath!);
|
||||
.deleteAllRecordedFiles();
|
||||
Get.back();
|
||||
Get.back();
|
||||
}));
|
||||
},
|
||||
icon: const Icon(Icons.delete),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -167,12 +167,11 @@ class _PassengerCallPageState extends State<PassengerCallPage> {
|
||||
String statusText;
|
||||
|
||||
if (!_isJoined) {
|
||||
statusText = 'Join a channel'.tr;
|
||||
} else if (_remoteUid == null) {
|
||||
statusText = 'Waiting for a remote user to join...'.tr;
|
||||
} else {
|
||||
statusText = 'Join a channel';
|
||||
} else if (_remoteUid == null)
|
||||
statusText = 'Waiting for a remote user to join...';
|
||||
else
|
||||
statusText = 'Connected to remote user, uid:$_remoteUid';
|
||||
}
|
||||
|
||||
return Text(
|
||||
statusText,
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
import 'package:SEFER/controller/payment/payment_controller.dart';
|
||||
import 'package:SEFER/controller/payment/paymob.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
|
||||
import '../../../constant/api_key.dart';
|
||||
import '../../../constant/char_map.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/credential.dart';
|
||||
import '../../../controller/functions/audio_record1.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
@@ -96,9 +91,8 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
textToSpeechController.speakText(
|
||||
'''hello this is ${box.read(BoxName.name)}''');
|
||||
onPressed: () async {
|
||||
await Get.find<AudioRecorderController>().stopRecording();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.voice_chat,
|
||||
@@ -115,22 +109,21 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () async {
|
||||
// await PaymentController()
|
||||
// .payWithPayMobWallet(context, '100', 'EGP', () {});
|
||||
AC credentials = AC();
|
||||
String apiKey = AK.payPalSecret;
|
||||
String convertedStringN = credentials.c(
|
||||
credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||
print('Converted v: $convertedStringN');
|
||||
// AC credentials = AC();
|
||||
// String apiKey = AK.payPalSecret;
|
||||
// String convertedStringN = credentials.c(
|
||||
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||
// print('Converted v: $convertedStringN');
|
||||
|
||||
// String retrievedStringS = credentials.r(
|
||||
// credentials.r(credentials.r(convertedStringN, cn), cC),
|
||||
// cs);
|
||||
// print('Retrieved String: $retrievedStringS');
|
||||
// //
|
||||
// if (retrievedStringS == apiKey) {
|
||||
// print('same');
|
||||
// }
|
||||
|
||||
String retrievedStringS = credentials.r(
|
||||
credentials.r(credentials.r(convertedStringN, cn), cC),
|
||||
cs);
|
||||
print('Retrieved String: $retrievedStringS');
|
||||
//
|
||||
if (retrievedStringS == apiKey) {
|
||||
print('same');
|
||||
}
|
||||
// print(box.read(BoxName.passengerWalletTotal));
|
||||
// print(box.read(BoxName.name));
|
||||
// print(box.read(BoxName.phone));
|
||||
@@ -151,9 +144,12 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
// )
|
||||
// Get.to(() => const CallPage());
|
||||
// print(box.read(BoxName.lang));
|
||||
await Get.find<AudioRecorderController>().startRecording();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.call,
|
||||
icon: Icon(
|
||||
Get.put(AudioRecorderController()).isRecording
|
||||
? Icons.stop
|
||||
: Icons.start,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -6,11 +6,10 @@ import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/controller/profile/profile_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/audio_recorder_controller.dart';
|
||||
import '../../../controller/functions/audio_record1.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
class RideBeginPassenger extends StatelessWidget {
|
||||
@@ -21,7 +20,8 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProfileController profileController = Get.put(ProfileController());
|
||||
AudioController audioController = Get.put(AudioController());
|
||||
AudioRecorderController audioController =
|
||||
Get.put(AudioRecorderController());
|
||||
// Get.put(MapPassengerController());
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.statusRide == 'Begin' || !controller.statusRideFromStart) {
|
||||
|
||||
94
pubspec.lock
94
pubspec.lock
@@ -646,30 +646,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
flutter_sound:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_sound
|
||||
sha256: "090a4694b11ecc744c2010621c4ffc5fe7c3079d304ea014961a72c7b72cfe6c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.2.13"
|
||||
flutter_sound_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_sound_platform_interface
|
||||
sha256: "4537eaeb58a32748c42b621ad6116f7f4c6ee0a8d6ffaa501b165fe1c9df4753"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.2.13"
|
||||
flutter_sound_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_sound_web
|
||||
sha256: ad4ca92671a1879e1f613e900bbbdb8170b20d57d1e4e6363018fe56b055594f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.2.13"
|
||||
flutter_spinkit:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -880,14 +856,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.1-dev"
|
||||
google_identity_services_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_identity_services_web
|
||||
sha256: "000b7a31e1fa17ee04b6c0553a2b2ea18f9f9352e4dcc0c9fcc785cf10f2484e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.2"
|
||||
google_maps:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -960,46 +928,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
google_sign_in:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_sign_in
|
||||
sha256: "8f8b94880f2753ccb796744259da529674e49b9af2e372abf6978c590c0ebfef"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.6"
|
||||
google_sign_in_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_sign_in_android
|
||||
sha256: "6031f59074a337fdd81be821aba84cee3a41338c6e958499a5cd34d3e1db80ef"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.20"
|
||||
google_sign_in_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_sign_in_ios
|
||||
sha256: "8edfde9698b5951f3d02632eceb39cc283865c3cff0b03216bf951089f10345b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.6.3"
|
||||
google_sign_in_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_sign_in_platform_interface
|
||||
sha256: e10eaaa30a0cb03af12dd324fb2e630ac7e9d854d0530f7a87a4d825031f9a4a
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.3"
|
||||
google_sign_in_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_sign_in_web
|
||||
sha256: "794f5494a945d6dd2654c52f979594ecd2558e5c82ce8272295ba371c93015e6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.2+1"
|
||||
graphs:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1193,13 +1121,13 @@ packages:
|
||||
source: hosted
|
||||
version: "4.8.1"
|
||||
just_audio:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: just_audio
|
||||
sha256: b607cd1a43bac03d85c3aaee00448ff4a589ef2a77104e3d409889ff079bf823
|
||||
sha256: b7cb6bbf3750caa924d03f432ba401ec300fd90936b3f73a9b33d58b1e96286b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.36"
|
||||
version: "0.9.37"
|
||||
just_audio_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1312,14 +1240,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.0"
|
||||
logger:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logger
|
||||
sha256: "7ad7215c15420a102ec687bb320a7312afd449bac63bfb1c60d9787c27b9767f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1664,6 +1584,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
share:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: share
|
||||
sha256: "97e6403f564ed1051a01534c2fc919cb6e40ea55e60a18ec23cee6e0ce19f4be"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.4"
|
||||
shelf:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -18,7 +18,7 @@ dependencies:
|
||||
google_maps_flutter: ^2.5.0
|
||||
sqflite: ^2.3.0
|
||||
path: ^1.8.3
|
||||
google_sign_in: ^6.1.4
|
||||
# google_sign_in: ^6.1.4
|
||||
lottie: ^2.5.0
|
||||
intl: ^0.18.1
|
||||
google_fonts: ^ 4.0.4
|
||||
@@ -57,11 +57,13 @@ dependencies:
|
||||
vibration: ^1.8.4
|
||||
wakelock_plus:
|
||||
background_location: ^0.13.0
|
||||
flutter_sound: ^9.2.13
|
||||
# flutter_sound: ^9.2.13
|
||||
record: ^5.0.5
|
||||
dio: ^5.4.3+1
|
||||
# paymob_payment: ^0.0.1+1
|
||||
webview_flutter: ^4.7.0
|
||||
just_audio: ^0.9.37
|
||||
share: ^2.0.4
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user