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_DATE = "[0-9/]";
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 apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT
// 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 {
WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) {
log("Api call failed with this error: ${error.toString()}");
});
if (widgetsConfigModel != null) {
currentWidgetsConfigModel = widgetsConfigModel;
notifyListeners();
}
currentWidgetsConfigModel = widgetsConfigModel;
notifyListeners();
}
WeathersWidgetModel currentWeathersWidgetModel = WeathersWidgetModel();
@ -352,7 +350,7 @@ class AppProvider extends ChangeNotifier {
lang: patientTicket.voiceLanguage == 1 ? "en" : "ar",
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;
// if (isQueuePatients.isNotEmpty) {
// isQueuePatients.removeAt(0);
@ -381,7 +379,6 @@ class AppProvider extends ChangeNotifier {
if (isQueuePatients.isNotEmpty) {
log("i am here on line 375");
final length = isQueuePatients.length;
// for (int i = 0; i < length; i++) {
await Future.delayed(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec)).whenComplete(() async {
PatientTicketModel temp = PatientTicketModel();
@ -438,12 +435,16 @@ class AppProvider extends ChangeNotifier {
patientTickets.add(temp);
}
notifyListeners();
await voiceCallPatientTicket(patientTickets.first, "setCompletionHandler");
updatePatientTicket(patientTickets.first);
if (isQueuePatients.isNotEmpty) {
await voiceCallPatientTicket(patientTickets.first, "setCompletionHandler");
updatePatientTicket(patientTickets.first);
}
});
// }
}
log("here logg: ${isQueuePatients.length}");
if (isQueuePatients.isEmpty) {
isCallingInProgress = false;
}

Loading…
Cancel
Save