diff --git a/lib/core/api.dart b/lib/core/api.dart index ee14684..85e0f8f 100644 --- a/lib/core/api.dart +++ b/lib/core/api.dart @@ -55,6 +55,8 @@ class API { isQueuePatients.sort((a, b) => a.editedOnTimeStamp.compareTo(b.editedOnTimeStamp)); callPatients.removeWhere((element) => element.isQueue == false); callPatients.addAll(isQueuePatients); + + log("IP: $deviceIp"); log("callPatients: ${callPatients.reversed.toList().toString()}"); log("isQueuePatients: ${isQueuePatients.reversed.toList().toString()}"); onSuccess(callPatients.reversed.toList(), isQueuePatients.reversed.toList(), callConfig); diff --git a/lib/core/config/config.dart b/lib/core/config/config.dart index 3868dc3..2fd308b 100644 --- a/lib/core/config/config.dart +++ b/lib/core/config/config.dart @@ -11,14 +11,9 @@ const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT // const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST'; // const BASE_URL = 'https://hmgwebservices.com/'; -/// Timer Info -const TIMER_MIN = 10; - -const currentBuildVersion = 4; +const currentBuildVersion = 5; class AppGlobal { - static var CONTEX; - // static Color appRedColor = const Color(0xFFD02127); // static Color appGreenColor = const Color(0xFF359846); static Color appTextColor = const Color(0xFF2B353E); diff --git a/lib/home/app_provider.dart b/lib/home/app_provider.dart index 268e7d3..340a720 100644 --- a/lib/home/app_provider.dart +++ b/lib/home/app_provider.dart @@ -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 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) { diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index 743b7e7..b8a9084 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -161,9 +161,6 @@ class MyHomePage extends StatelessWidget { } Widget dataContent({required AppProvider appProvider, required BuildContext context}) { - log("isCallingInProgress from HomeScreen: ${appProvider.isCallingInProgress}"); - // appProvider.voiceCallPatientTicket(appProvider.patientTickets.first); - // appProvider.testCalling(); if (appProvider.patientTickets.isEmpty) { // No Patient in Queue return noPatientInQueue(screenOrientationEnum: appProvider.currentScreenRotation); diff --git a/lib/home/priority_calls_components.dart b/lib/home/priority_calls_components.dart index 09ed370..3dc81d0 100644 --- a/lib/home/priority_calls_components.dart +++ b/lib/home/priority_calls_components.dart @@ -40,8 +40,6 @@ class PriorityTickets extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: otherTickets.map((ticket) { - log("queueNoFaiz: ${ticket.callNoStr} != ${ticket.queueNo} "); - return Padding( padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 2), child: TicketItem( @@ -82,7 +80,6 @@ class TicketItem extends StatelessWidget { }) : super(key: key); String getFormattedTicket(String ticketNo, bool isClinicAdded) { - log("ticketNo: $ticketNo"); if (isClinicAdded) { var formattedString = ticketNo.split(" "); if (formattedString.length > 1) { diff --git a/lib/utils/call_by_voice.dart b/lib/utils/call_by_voice.dart index 5301763..8b4e038 100644 --- a/lib/utils/call_by_voice.dart +++ b/lib/utils/call_by_voice.dart @@ -25,12 +25,6 @@ class CallByVoice { double rate = 0.2; Future startCalling(bool isClinicNameAdded) async { - log("lang: $lang"); - log("preVoice: $preVoice"); - log("postVoice: $postVoice"); - log("ticketNo: $ticketNo"); - log("isClinicNameAdded: $isClinicNameAdded"); - // log("getEngines: ${await flutterTts.getEngines}"); // log("getDefaultEngine: ${await flutterTts.getDefaultEngine}"); // log("getVoices: ${await flutterTts.getVoices}");