|
|
|
|
@ -88,18 +88,18 @@ class QueuingViewModel extends ChangeNotifier {
|
|
|
|
|
ticket: currentTickets.first,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
waitAndCallNextTicketIfThere();
|
|
|
|
|
waitAndCallNextTicketIfAvailable();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> onVoiceCompleted() async {
|
|
|
|
|
log("isSpeechCompleted::: $isSpeechCompleted");
|
|
|
|
|
if (isSpeechCompleted) {
|
|
|
|
|
waitAndCallNextTicketIfThere();
|
|
|
|
|
waitAndCallNextTicketIfAvailable();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
waitAndCallNextTicketIfThere() {
|
|
|
|
|
waitAndCallNextTicketIfAvailable() {
|
|
|
|
|
GlobalConfigurationsModel globalConfigurationsModel = getIt.get<ScreenConfigViewModel>().globalConfigurationsModel;
|
|
|
|
|
Timer(Duration(seconds: globalConfigurationsModel.concurrentCallDelaySec), () async {
|
|
|
|
|
if (queueTickets.isNotEmpty) {
|
|
|
|
|
@ -109,7 +109,7 @@ class QueuingViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
queueTickets.removeAt(0);
|
|
|
|
|
voiceCallTicket(ticketData: currentTickets.first.ticketModel);
|
|
|
|
|
callTicketOnScreen(ticketData: currentTickets.first.ticketModel);
|
|
|
|
|
} else {
|
|
|
|
|
isCallingInProgress = false;
|
|
|
|
|
}
|
|
|
|
|
@ -137,7 +137,7 @@ class QueuingViewModel extends ChangeNotifier {
|
|
|
|
|
if (currentTickets.length > globalConfigurationsModel.screenMaxDisplayPatients) {
|
|
|
|
|
currentTickets.removeLast();
|
|
|
|
|
}
|
|
|
|
|
voiceCallTicket(ticketData: currentTickets.first.ticketModel);
|
|
|
|
|
callTicketOnScreen(ticketData: currentTickets.first.ticketModel);
|
|
|
|
|
} else {
|
|
|
|
|
queueTickets.add(ticket);
|
|
|
|
|
log("inQueue Length: ${queueTickets.length}");
|
|
|
|
|
@ -149,7 +149,7 @@ class QueuingViewModel extends ChangeNotifier {
|
|
|
|
|
textToSpeechService.speechTextTest("Ticket Number ... ABC One Tow Three.. Please visit Doctor.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> voiceCallTicket({required TicketData? ticketData}) async {
|
|
|
|
|
Future<void> callTicketOnScreen({required TicketData? ticketData}) async {
|
|
|
|
|
if (ticketData == null) return;
|
|
|
|
|
GlobalConfigurationsModel globalConfigurationsModel = getIt.get<ScreenConfigViewModel>().globalConfigurationsModel;
|
|
|
|
|
if (globalConfigurationsModel.isToneReq) {
|
|
|
|
|
@ -162,7 +162,7 @@ class QueuingViewModel extends ChangeNotifier {
|
|
|
|
|
ticket: currentTickets.first,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
waitAndCallNextTicketIfThere();
|
|
|
|
|
waitAndCallNextTicketIfAvailable();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|