Fixed Repeating issue

master
faizatflutter 2 years ago
parent 8bc4b08646
commit 3982491386

@ -5,7 +5,7 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL = 'https://ms.hmg.com/nscapi/api/PatientCall'; // UAT // const BASE_URL = 'https://ms.hmg.com/nscapi'; // UAT
const BASE_URL = 'https://qline.hmg.com'; // LIVE const BASE_URL = 'https://qline.hmg.com'; // LIVE
const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT
// const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST'; // const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST';

@ -80,17 +80,15 @@ class AppProvider extends ChangeNotifier {
} }
} }
WidgetsConfigModel? currentWidgetsConfigModel = WidgetsConfigModel(); WidgetsConfigModel? currentWidgetsConfigModel;
Future<void> getInfoWidgetsConfigurationsFromServer() async { Future<void> getInfoWidgetsConfigurationsFromServer() async {
WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) { WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) {
log("Api call failed with this error: ${error.toString()}"); log("Api call failed with this error: ${error.toString()}");
}); });
if (widgetsConfigModel != null) { currentWidgetsConfigModel = widgetsConfigModel;
currentWidgetsConfigModel = widgetsConfigModel; notifyListeners();
notifyListeners();
}
} }
WeathersWidgetModel currentWeathersWidgetModel = WeathersWidgetModel(); WeathersWidgetModel currentWeathersWidgetModel = WeathersWidgetModel();
@ -352,7 +350,7 @@ class AppProvider extends ChangeNotifier {
lang: patientTicket.voiceLanguage == 1 ? "en" : "ar", lang: patientTicket.voiceLanguage == 1 ? "en" : "ar",
flutterTts: flutterTts, flutterTts: flutterTts,
); );
voiceCaller!.startCalling(patientTicket.queueNo.trim().toString() != patientTicket.callNoStr.trim().toString()).whenComplete(() { await voiceCaller!.startCalling(patientTicket.queueNo.trim().toString() != patientTicket.callNoStr.trim().toString()).whenComplete(() {
voiceCaller = null; voiceCaller = null;
// if (isQueuePatients.isNotEmpty) { // if (isQueuePatients.isNotEmpty) {
// isQueuePatients.removeAt(0); // isQueuePatients.removeAt(0);
@ -381,7 +379,6 @@ class AppProvider extends ChangeNotifier {
if (isQueuePatients.isNotEmpty) { if (isQueuePatients.isNotEmpty) {
log("i am here on line 375"); log("i am here on line 375");
final length = 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 {
PatientTicketModel temp = PatientTicketModel(); PatientTicketModel temp = PatientTicketModel();
@ -438,12 +435,16 @@ class AppProvider extends ChangeNotifier {
patientTickets.add(temp); patientTickets.add(temp);
} }
notifyListeners(); notifyListeners();
await voiceCallPatientTicket(patientTickets.first, "setCompletionHandler"); if (isQueuePatients.isNotEmpty) {
updatePatientTicket(patientTickets.first); await voiceCallPatientTicket(patientTickets.first, "setCompletionHandler");
updatePatientTicket(patientTickets.first);
}
}); });
// } // }
} }
log("here logg: ${isQueuePatients.length}");
if (isQueuePatients.isEmpty) { if (isQueuePatients.isEmpty) {
isCallingInProgress = false; isCallingInProgress = false;
} }

Loading…
Cancel
Save