|
|
|
|
@ -171,8 +171,7 @@ class AppProvider extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
void getNextPrayerToShow() {
|
|
|
|
|
final current = DateTime.now();
|
|
|
|
|
logger.i("Checking Namaz time Locally at ${current.toString()} and ${current.timeZoneName} ");
|
|
|
|
|
|
|
|
|
|
log("Checking Namaz time Locally at ${current.toString()} and ${current.timeZoneName} ");
|
|
|
|
|
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.fajr!).isAfter(current)) {
|
|
|
|
|
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.fajr!));
|
|
|
|
|
nextPrayerToShowWithTime = "${patientCallConfigurations.fajrText} at $namazTime";
|
|
|
|
|
@ -318,9 +317,9 @@ class AppProvider extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
Future<void> callPatientsAPI() async {
|
|
|
|
|
logger.i("calling callPatientsAPI");
|
|
|
|
|
patientTickets.clear();
|
|
|
|
|
API.getCallRequestInfoByClinicInfo(currentDeviceIp,
|
|
|
|
|
await API.getCallRequestInfoByClinicInfo(currentDeviceIp,
|
|
|
|
|
onSuccess: (waitingCalls, isQueuePatientsCalls, callConfigs) async {
|
|
|
|
|
patientTickets.clear();
|
|
|
|
|
patientCallConfigurations = callConfigs;
|
|
|
|
|
if (waitingCalls.length > patientCallConfigurations.screenMaxDisplayPatients) {
|
|
|
|
|
patientTickets = waitingCalls.sublist(0, patientCallConfigurations.screenMaxDisplayPatients);
|
|
|
|
|
@ -346,8 +345,9 @@ class AppProvider extends ChangeNotifier {
|
|
|
|
|
logger.i("A new Ping Received when isQueuePatients: ${isQueuePatients.length}");
|
|
|
|
|
logger.i("isCallingInProgress from onPingReceived: $isCallingInProgress");
|
|
|
|
|
logger.i("isApiCallNeeded: $isApiCallNeeded");
|
|
|
|
|
logger.i("isQueuePatients: ${isQueuePatients.length}");
|
|
|
|
|
if (patientTickets.isNotEmpty) {
|
|
|
|
|
if (isCallingInProgress) {
|
|
|
|
|
if (isCallingInProgress && isQueuePatients.isNotEmpty) {
|
|
|
|
|
isApiCallNeeded = true;
|
|
|
|
|
} else {
|
|
|
|
|
await callPatientsAPI();
|
|
|
|
|
@ -378,16 +378,17 @@ class AppProvider extends ChangeNotifier {
|
|
|
|
|
CallByVoice? voiceCaller;
|
|
|
|
|
PatientTicketModel currentPatient = PatientTicketModel();
|
|
|
|
|
|
|
|
|
|
// testCalling() async {
|
|
|
|
|
// voiceCaller = CallByVoice(
|
|
|
|
|
// preVoice: "رقم التذكرة",
|
|
|
|
|
// ticketNo: "AMG A-78",
|
|
|
|
|
// postVoice: "دعوة للتطعيم",
|
|
|
|
|
// lang: "ar",
|
|
|
|
|
// flutterTts: flutterTts,
|
|
|
|
|
// );
|
|
|
|
|
// await voiceCaller!.startCalling(true);
|
|
|
|
|
// }
|
|
|
|
|
testCalling() async {
|
|
|
|
|
voiceCaller = CallByVoice(
|
|
|
|
|
preVoice: "رقم التذكرة",
|
|
|
|
|
ticketNo: "AMG A-78",
|
|
|
|
|
postVoice: "دعوة للتطعيم",
|
|
|
|
|
lang: "ar",
|
|
|
|
|
flutterTts: flutterTts,
|
|
|
|
|
isMute: false,
|
|
|
|
|
);
|
|
|
|
|
await voiceCaller!.startCalling(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
voiceCallPatientTicket(PatientTicketModel patientTicket, String calledFrom) async {
|
|
|
|
|
logger.i("voiceCallPatientTicket calledFrom : $calledFrom");
|
|
|
|
|
@ -396,10 +397,10 @@ class AppProvider extends ChangeNotifier {
|
|
|
|
|
isCallingInProgress = true;
|
|
|
|
|
logger.i("Setting isCallingInProgress : $isCallingInProgress");
|
|
|
|
|
|
|
|
|
|
logger.i("isVoiceReq: ${patientTicket.isVoiceReq}");
|
|
|
|
|
logger.i("voiceCaller: ${voiceCaller == null}");
|
|
|
|
|
logger.i("isQueue: ${patientTicket.isQueue}");
|
|
|
|
|
logger.i("isToneReq: ${patientTicket.isToneReq}");
|
|
|
|
|
log("isVoiceReq: ${patientTicket.isVoiceReq}");
|
|
|
|
|
log("voiceCaller: ${voiceCaller == null}");
|
|
|
|
|
log("isQueue: ${patientTicket.isQueue}");
|
|
|
|
|
log("isToneReq: ${patientTicket.isToneReq}");
|
|
|
|
|
//TODO: DATA ACCURACY
|
|
|
|
|
// if (patientTicket.isToneReq && !patientTicket.isQueue) {
|
|
|
|
|
if (!patientTicket.isQueue) {
|
|
|
|
|
|