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