Fixes Tone Repeat

master
FaizHashmiCS22 2 years ago
parent 341337e566
commit 582fb4ca86

@ -268,7 +268,7 @@ class AppProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
if (patientTickets.isNotEmpty) { if (patientTickets.isNotEmpty) {
updateCurrentScreenRotation(patientTickets.first.screenRotationEnum); updateCurrentScreenRotation(patientTickets.first.screenRotationEnum);
voiceCallPatientTicket(patientTickets.first, "callPatientsAPI"); await voiceCallPatientTicket(patientTickets.first, "callPatientsAPI");
updatePatientTicket(patientTickets.first); updatePatientTicket(patientTickets.first);
} }
}, },
@ -337,7 +337,7 @@ class AppProvider extends ChangeNotifier {
if (patientTicket.isToneReq && !patientTicket.isQueue) { if (patientTicket.isToneReq && !patientTicket.isQueue) {
audioPlayer.setAsset("assets/tones/call_tone.mp3"); audioPlayer.setAsset("assets/tones/call_tone.mp3");
await audioPlayer.play(); await audioPlayer.play();
Future.delayed(const Duration(seconds: 3)); await Future.delayed(const Duration(seconds: 2));
} }
if (patientTicket.isVoiceReq && voiceCaller == null && !patientTicket.isQueue) { if (patientTicket.isVoiceReq && voiceCaller == null && !patientTicket.isQueue) {
@ -371,6 +371,8 @@ class AppProvider extends ChangeNotifier {
Future<void> listenAudioPlayerEvents() async { Future<void> listenAudioPlayerEvents() async {
audioPlayer.playerStateStream.listen((playerState) async { audioPlayer.playerStateStream.listen((playerState) async {
if (playerState.processingState == ProcessingState.completed) { if (playerState.processingState == ProcessingState.completed) {
log("Tone Completed");
if (currentPatient.isVoiceReq) { if (currentPatient.isVoiceReq) {
isCallingInProgress = true; isCallingInProgress = true;
return; return;
@ -379,7 +381,6 @@ class AppProvider extends ChangeNotifier {
if (isQueuePatients.isNotEmpty) { if (isQueuePatients.isNotEmpty) {
isCallingInProgress = true; isCallingInProgress = true;
log("i am here on line 375");
log("isQueuePatients.length 1: ${isQueuePatients.length}"); log("isQueuePatients.length 1: ${isQueuePatients.length}");
// for (int i = 0; i < length; i++) { // for (int i = 0; i < length; i++) {
await Future.delayed(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec)).whenComplete(() async { await Future.delayed(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec)).whenComplete(() async {

Loading…
Cancel
Save