deployed merged with appointment module v6

appointment_merge
Faiz Hashmi 4 months ago
parent 2e215f7a5e
commit d9813561bc

Binary file not shown.

@ -33,7 +33,7 @@ class AppColors {
static Color whiteColor = Colors.white;
static Color yellowColor = const Color(0xFFC99609);
static Color brownColor = const Color(0xFF460707);
static Color blackColor = Colors.black54;
static Color blackColor = Colors.black;
static Color nebulizationColor = const Color(0xFF3C86D0);
static Color vitalSignColor = const Color(0xFFD02127);
@ -102,7 +102,7 @@ class AppConstants {
static String testIP = '12.4.5.1'; // projectID.QlineType.ScreenType.AnyNumber (1 to 10)
static int thresholdForListUI = 3;
static int currentBuildVersion = 1;
static int currentBuildVersion = 6;
}
class ApiConstants {
@ -122,12 +122,15 @@ class ApiConstants {
static String rssFeedGet = '$baseUrlApiPatientCall/RssFeed_Get';
static String getWeatherForecastBy5Days = "$baseUrlApiPatientCall/WeatherForecast_GetBy5Days";
static String prayerTimeToday = "$baseUrlApiPatientCall/PrayerTime_Today";
static String ticketCallRequestUpdate = "$baseUrlApiPatientCall/CallRequest_QueueUpdate";
//Generic
static String createTicketForKiosk = '$baseUrlApiGen/GEN_PatientCallNo_Get';
static String ticketAcknowledgementInsert = '$baseUrlApi/Common/TicketQueueAck_Insert';
// AppointmentSpecific
static String ticketCallRequestUpdate = "$baseUrlApiPatientCall/CallRequest_QueueUpdate";
// Signal R Constants
static String sendQLinePatientCall = "SendQLinePatientCall";
@ -484,3 +487,5 @@ class MockJsonRepo {
}
];
}
// RAW DATA:

@ -9,6 +9,7 @@ import 'package:hmg_qline/view_models/queuing_view_model.dart';
import 'package:hmg_qline/views/view_helpers/size_config.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await AppDependencies.addDependencies();

@ -146,7 +146,7 @@ class GlobalConfigurationsModel {
this.callForNebulizationText = "Call for Nebulization",
});
GlobalConfigurationsModel.fromJson(Map<String, dynamic> json) {
GlobalConfigurationsModel.fromJson({required Map<String, dynamic> json, int qType = 1, int screenType = 1}) {
id = json['id'];
configType = json['configType'];
description = json['description'];
@ -164,7 +164,7 @@ class GlobalConfigurationsModel {
isNotiReq = json['isNotiReq'];
prioritySMS = json['prioritySMS'];
priorityWhatsApp = json['priorityWhatsApp'];
priorityEmail = json['priorityEmail'];
priorityEmail = json['priorityEmail'];
ticketNoText = json['ticketNoText'] ?? "Ticket Number";
postVoiceText = json['pleaseVisitCounterText'] ?? "Please Visit Counter";
counterText = json['counterText'];
@ -197,12 +197,12 @@ class GlobalConfigurationsModel {
isWeatherReq = json['isWeatherReq'] ?? false;
isPrayerTimeReq = json['isPrayerTimeReq'] ?? false;
isRssFeedReq = json['isRssFeedReq'] ?? false;
qTypeEnum = (json['qType'] as int).toQTypeEnum();
screenTypeEnum = (json['screenType'] as int).toScreenTypeEnum();
qTypeEnum = ((json['qType'] ?? qType) as int).toQTypeEnum();
screenTypeEnum = ((json['screenType'] ?? screenType) as int).toScreenTypeEnum();
projectID = json['projectID'];
projectLatitude = json['projectLatitude'] == 0 ? 0.0 : json['projectLatitude'];
projectLongitude = json['projectLongitude'] == 0 ? 0.0 : json['projectLongitude'];
cityKey = json['cityKey'];
cityKey = json['cityKey'] ?? 0;
if (json['kioskQueue'] != null) {
kioskQueueList = List<KioskQueueModel>.from(json['kioskQueue'].map((kioskQueueJson) => KioskQueueModel.fromJson(kioskQueueJson)));
} else {
@ -224,6 +224,11 @@ class GlobalConfigurationsModel {
callForVaccinationText = json['callForVaccinationText'];
callForNebulizationText = json['callForNebulizationText'];
}
@override
String toString() {
return 'GlobalConfigurationsModel{id: $id, configType: $configType, description: $description, counterStart: $counterStart, counterEnd: $counterEnd, concurrentCallDelaySec: $concurrentCallDelaySec, voiceType: $voiceType, voiceTypeText: $voiceTypeText, screenLanguageEnum: $screenLanguageEnum, screenLanguageText: $screenLanguageText, textDirection: $textDirection, voiceLanguageEnum: $voiceLanguageEnum, voiceLanguageText: $voiceLanguageText, screenMaxDisplayPatients: $screenMaxDisplayPatients, isNotiReq: $isNotiReq, prioritySMS: $prioritySMS, priorityWhatsApp: $priorityWhatsApp, priorityEmail: $priorityEmail, ticketNoText: $ticketNoText, postVoiceText: $postVoiceText, roomText: $roomText, roomNo: $roomNo, isRoomNoRequired: $isRoomNoRequired, counterText: $counterText, queueNoText: $queueNoText, callForText: $callForText, currentServeText: $currentServeText, maxText: $maxText, minText: $minText, nextPrayerText: $nextPrayerText, weatherText: $weatherText, fajarText: $fajarText, dhuhrText: $dhuhrText, asarText: $asarText, maghribText: $maghribText, ishaText: $ishaText, isActive: $isActive, createdBy: $createdBy, createdOn: $createdOn, editedBy: $editedBy, editedOn: $editedOn, isToneReq: $isToneReq, isVoiceReq: $isVoiceReq, orientationTypeEnum: $orientationTypeEnum, isTurnOn: $isTurnOn, waitingAreaType: $waitingAreaType, gender: $gender, isWeatherReq: $isWeatherReq, isPrayerTimeReq: $isPrayerTimeReq, isRssFeedReq: $isRssFeedReq, qTypeEnum: $qTypeEnum, screenTypeEnum: $screenTypeEnum, projectID: $projectID, projectLatitude: $projectLatitude, projectLongitude: $projectLongitude, cityKey: $cityKey, kioskQueueList: $kioskQueueList, kioskLanguageConfigList: $kioskLanguageConfigList, vitalSignText: $vitalSignText, doctorText: $doctorText, procedureText: $procedureText, vaccinationText: $vaccinationText, nebulizationText: $nebulizationText, callForVitalSignText: $callForVitalSignText, callForDoctorText: $callForDoctorText, callForProcedureText: $callForProcedureText, callForVaccinationText: $callForVaccinationText, callForNebulizationText: $callForNebulizationText}';
}
}
// {

@ -49,7 +49,7 @@ class TicketData {
// New fields
String? doctorNameN;
int? callType;
CallTypeEnum callTypeEnum = CallTypeEnum.vitalSign;
String? queueNoM;
String? callNoStr;
bool? isQueue;
@ -99,7 +99,7 @@ class TicketData {
this.editedBy,
this.editedOn,
this.doctorNameN,
this.callType,
this.callTypeEnum = CallTypeEnum.vitalSign,
this.queueNoM,
this.callNoStr,
this.isQueue,
@ -129,7 +129,7 @@ class TicketData {
id = json['id'];
patientID = json['patientID'];
laBQGroupID = json['laB_QGroupID'];
queueNo = json['queueNo'];
queueNo = json['queueNoM'];
counterBatchNo = json['counterBatchNo'];
calledBy = json['calledBy'];
calledOn = json['calledOn'];
@ -152,9 +152,8 @@ class TicketData {
editedOn = json['editedOn'] != null ? (json['editedOn'] as String).toDateTime() : DateTime.now();
createdOn = json['createdOn'] != null ? (json['createdOn'] as String).toDateTime() : DateTime.now();
// New fields
doctorNameN = json['doctorNameN'];
callType = json['callType'];
callTypeEnum = ((json['callType'] ?? 1) as int).toCallTypeEnum();
queueNoM = json['queueNoM'];
callNoStr = json['callNoStr'];
isQueue = json['isQueue'];
@ -164,8 +163,8 @@ class TicketData {
isTurnOn = json['isTurnOn'];
concurrentCallDelaySec = json['concurrentCallDelaySec'];
crTypeAckIP = json['crTypeAckIP'];
voiceLanguage = json['voiceLanguage'];
voiceLanguageText = json['voiceLanguageText'];
voiceLanguage = json['voiceLanguage'] ?? 1;
voiceLanguageText = json['voiceLanguageText'] ?? "English";
vitalSignText = json['vitalSignText'];
doctorText = json['doctorText'];
procedureText = json['procedureText'];
@ -180,4 +179,9 @@ class TicketData {
queueNoText = json['queueNoText'];
callForText = json['callForText'];
}
@override
String toString() {
return 'TicketData{id: $id, patientID: $patientID, laBQGroupID: $laBQGroupID, queueNo: $queueNo, counterBatchNo: $counterBatchNo, calledBy: $calledBy, calledOn: $calledOn, servedOn: $servedOn, patientName: $patientName, mobileNo: $mobileNo, patientEmail: $patientEmail, preferredLang: $preferredLang, voiceLanguageEnum: $voiceLanguageEnum, ticketNoText: $ticketNoText, postVoiceText: $postVoiceText, patientGender: $patientGender, roomNo: $roomNo, isActive: $isActive, createdBy: $createdBy, editedBy: $editedBy, editedOn: $editedOn, createdOn: $createdOn, doctorNameN: $doctorNameN, callTypeEnum: $callTypeEnum, queueNoM: $queueNoM, callNoStr: $callNoStr, isQueue: $isQueue, isToneReq: $isToneReq, isVoiceReq: $isVoiceReq, orientationType: $orientationType, isTurnOn: $isTurnOn, concurrentCallDelaySec: $concurrentCallDelaySec, crTypeAckIP: $crTypeAckIP, voiceLanguage: $voiceLanguage, voiceLanguageText: $voiceLanguageText, vitalSignText: $vitalSignText, doctorText: $doctorText, procedureText: $procedureText, vaccinationText: $vaccinationText, nebulizationText: $nebulizationText, callForVitalSignText: $callForVitalSignText, callForDoctorText: $callForDoctorText, callForProcedureText: $callForProcedureText, callForVaccinationText: $callForVaccinationText, callForNebulizationText: $callForNebulizationText, roomText: $roomText, queueNoText: $queueNoText, callForText: $callForText}';
}
}

@ -25,7 +25,9 @@ abstract class ScreenDetailsRepo {
Future<RssFeedModel?> getRssFeedDetailsByLanguageID({required int languageId});
Future<GenericRespModel?> acknowledgeTicket({required String ipAddress, required String ticketQueueID, required QTypeEnum qTypeEnum});
Future<GenericRespModel?> acknowledgeTicket({required String ipAddress, required int ticketQueueID, required QTypeEnum qTypeEnum});
Future<GenericRespModel?> acknowledgeTicketForAppointment({required int ticketId, required String ipAddress, required CallTypeEnum callTypeEnum});
}
class ScreenDetailsRepoImp implements ScreenDetailsRepo {
@ -45,8 +47,7 @@ class ScreenDetailsRepoImp implements ScreenDetailsRepo {
ApiConstants.commonConfigGet,
params,
);
List<GlobalConfigurationsModel> globalConfigurationsModel = List.generate(genericModel.data.length, (index) => GlobalConfigurationsModel.fromJson(genericModel.data[index]));
List<GlobalConfigurationsModel> globalConfigurationsModel = List.generate(genericModel.data.length, (index) => GlobalConfigurationsModel.fromJson(json: genericModel.data[index]));
if (globalConfigurationsModel.isNotEmpty) {
return globalConfigurationsModel.first;
}
@ -198,7 +199,7 @@ class ScreenDetailsRepoImp implements ScreenDetailsRepo {
}
@override
Future<GenericRespModel?> acknowledgeTicket({required String ipAddress, required String ticketQueueID, required QTypeEnum qTypeEnum}) async {
Future<GenericRespModel?> acknowledgeTicket({required String ipAddress, required int ticketQueueID, required QTypeEnum qTypeEnum}) async {
try {
var params = {
"ipAddress": ipAddress.toString(),
@ -217,4 +218,27 @@ class ScreenDetailsRepoImp implements ScreenDetailsRepo {
return null;
}
}
@override
Future<GenericRespModel?> acknowledgeTicketForAppointment({required int ticketId, required String ipAddress, required CallTypeEnum callTypeEnum}) async {
try {
var params = {
"id": ticketId.toString(),
"apiKey": AppConstants.apiKey,
"ipAddress": ipAddress,
"callType": callTypeEnum.getIdFromCallTypeEnum().toString(),
};
GenericRespModel genericModel = await apiClientInstance.postJsonForObject(
(json) => GenericRespModel.fromJson(json),
ApiConstants.ticketCallRequestUpdate,
params,
);
return genericModel;
} catch (e) {
logger.e(e.toString());
InfoComponents.showToast(e.toString());
return null;
}
}
}

@ -3,7 +3,7 @@ import 'package:just_audio/just_audio.dart';
abstract class AudioService {
Future<void> playTone({required String path, bool isMute = false});
Future<void> listenAudioPlayerEvents({required Function() onAudioCompleted});
Future<void> listenAudioPlayerEvents({required Function() onToneCompleted});
Future<void> disposeAudioPlayer();
}
@ -14,10 +14,10 @@ class AudioServiceImp implements AudioService {
AudioServiceImp({required this.audioPlayerInstance});
@override
Future<void> listenAudioPlayerEvents({required Function() onAudioCompleted}) async {
Future<void> listenAudioPlayerEvents({required Function() onToneCompleted}) async {
audioPlayerInstance.playerStateStream.listen((playerState) async {
if (playerState.processingState == ProcessingState.completed) {
onAudioCompleted();
onToneCompleted();
}
});
}
@ -27,6 +27,8 @@ class AudioServiceImp implements AudioService {
audioPlayerInstance.setAsset(path);
if (isMute) {
audioPlayerInstance.setVolume(0.0);
} else {
audioPlayerInstance.setVolume(1.0);
}
await audioPlayerInstance.play();
}

@ -51,8 +51,6 @@ class TextToSpeechServiceImp implements TextToSpeechService {
bool isMute = false,
}) async {
const ttsGoogleEngine = 'com.google.android.tts';
// const ttsFlyTecEngine = 'com.iflytek.speechcloud';
LanguageEnum langEnum = ticket.ticketModel!.voiceLanguageEnum;
List engines = await textToSpeechInstance.getEngines;
if (engines.contains(ttsGoogleEngine)) {
@ -73,24 +71,27 @@ class TextToSpeechServiceImp implements TextToSpeechService {
textToSpeechInstance.setSpeechRate(0.37);
textToSpeechInstance.setPitch(0.85);
}
// String postVoice = globalConfigurationsModel.postVoiceText;
// String preVoice = ticket.ticketModel!.ticketNoText;
String postVoice = ticket.ticketModel!.postVoiceText;
String preVoice = '';
String preVoice = ticket.ticketModel!.ticketNoText;
String postVoice = '';
if (globalConfigurationsModel.qTypeEnum == QTypeEnum.appointment) {
postVoice = ticket.ticketModel!.callTypeEnum.getCallTextFromCallType(ticket.ticketModel!);
} else {
postVoice = ticket.ticketModel!.postVoiceText;
}
String roomNo = '';
if (ticket.ticketModel!.roomNo != null && ticket.ticketModel!.roomNo!.isNotEmpty) {
roomNo = ticket.ticketModel!.roomNo.toString();
if (globalConfigurationsModel.qTypeEnum != QTypeEnum.appointment && ticket.ticketModel!.roomNo != null && ticket.ticketModel!.roomNo!.isNotEmpty) {
roomNo = ".. ${ticket.ticketModel!.roomNo.toString()}";
}
if (preVoice.isNotEmpty) {
preVoice = '$preVoice..';
}
String ticketNo = ticket.ticketModel!.queueNo!.trim().toString();
log("lang: ${await textToSpeechInstance.areLanguagesInstalled(["en", "ar"])}");
log("getDefaultEngine: ${await textToSpeechInstance.getDefaultEngine}");
log("getEngines: ${await textToSpeechInstance.getEngines}");
// log("lang: ${await textToSpeechInstance.areLanguagesInstalled(["en", "ar"])}");
// log("getDefaultEngine: ${await textToSpeechInstance.getDefaultEngine}");
// log("getEngines: ${await textToSpeechInstance.getEngines}");
log("lang: $langEnum");
log("preVoice: $preVoice");
log("postVoice: $postVoice");
@ -98,20 +99,43 @@ class TextToSpeechServiceImp implements TextToSpeechService {
String patientAlpha = "";
String patientNumeric = "";
String clinicName = "";
bool isClinicNameAdded = (ticket.ticketModel?.queueNo != ticket.ticketModel?.callNoStr);
if (isClinicNameAdded) {
var queueNo = "";
var clinic = ticketNo.split(" ");
if (clinic.length > 1) {
clinicName = clinic[0];
queueNo = clinic[1];
} else {
queueNo = ticketNo;
}
var queueNoArray = ticketNo.split("-");
if (queueNoArray.length > 2) {
patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}";
patientNumeric = queueNoArray[2];
var queueNoArray = queueNo.split("-");
if (queueNoArray.length > 2) {
patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}";
patientNumeric = queueNoArray[2];
} else {
patientAlpha = queueNoArray[0];
patientNumeric = queueNoArray[1];
}
} else {
patientAlpha = queueNoArray[0];
patientNumeric = queueNoArray[1];
var queueNoArray = ticketNo.split("-");
if (queueNoArray.length > 2) {
patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}";
patientNumeric = queueNoArray[2];
} else {
patientAlpha = queueNoArray[0];
patientNumeric = queueNoArray[1];
}
}
patientAlpha = patientAlpha.split('').join(' .. ');
if (langEnum == LanguageEnum.english) {
await textToSpeechInstance.speak("$preVoice $patientAlpha .. $patientNumeric .. $postVoice $roomNo");
await textToSpeechInstance.speak("$preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice $roomNo");
return;
}
@ -127,11 +151,11 @@ class TextToSpeechServiceImp implements TextToSpeechService {
textToSpeechInstance.setLanguage(langEnum.enumToString());
// await textToSpeechInstance.speak(postVoice);
// textToSpeechInstance.setLanguage(LanguageEnum.english.enumToString());
await textToSpeechInstance.speak("$postVoice .. $roomNo").whenComplete(() {
await textToSpeechInstance.speak("$postVoice $roomNo").whenComplete(() {
isSpeechCompleted = true;
});
} else {
await textToSpeechInstance.speak("$patientAlpha .. .. $patientNumeric .. .. $postVoice .. $roomNo");
await textToSpeechInstance.speak("$preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice $roomNo");
}
}

@ -1,7 +1,10 @@
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_qline/constants/app_constants.dart';
import 'package:hmg_qline/models/global_config_model.dart';
import 'package:hmg_qline/models/ticket_model.dart';
import 'package:hmg_qline/utilities/enums.dart';
import 'package:intl/intl.dart';
@ -62,6 +65,7 @@ extension ScreenOrientationExt on ScreenOrientationEnum {
extension QTypeEnumExtension on int {
QTypeEnum toQTypeEnum() {
// return QTypeEnum.lab;
switch (this) {
case 1:
return QTypeEnum.appointment;
@ -153,7 +157,7 @@ extension LanguageEnumToString on LanguageEnum {
enum CallTypeEnum { vitalSign, doctor, procedure, vaccination, nebulization, none }
extension XCallType on CallTypeEnum {
Color color() {
Color getColorByCallType() {
if (this == CallTypeEnum.vitalSign) {
return AppColors.vitalSignColor;
} else if (this == CallTypeEnum.doctor) {
@ -169,27 +173,27 @@ extension XCallType on CallTypeEnum {
}
}
String message(GlobalConfigurationsModel globalConfig, {bool isListView = false}) {
String getMessageByCallType(GlobalConfigurationsModel globalConfig, {bool isListView = false}) {
switch (this) {
case CallTypeEnum.vitalSign:
return isListView ? globalConfig.callForVitalSignText : globalConfig.vitalSignText;
return !isListView ? globalConfig.callForVitalSignText : globalConfig.vitalSignText;
case CallTypeEnum.doctor:
return isListView ? globalConfig.callForDoctorText : globalConfig.doctorText;
return !isListView ? globalConfig.callForDoctorText : globalConfig.doctorText;
case CallTypeEnum.procedure:
return isListView ? globalConfig.callForProcedureText : globalConfig.procedureText;
return !isListView ? globalConfig.callForProcedureText : globalConfig.procedureText;
case CallTypeEnum.vaccination:
return isListView ? globalConfig.callForVaccinationText : globalConfig.vaccinationText;
return !isListView ? globalConfig.callForVaccinationText : globalConfig.vaccinationText;
case CallTypeEnum.nebulization:
return isListView ? globalConfig.callForNebulizationText : globalConfig.nebulizationText;
return !isListView ? globalConfig.callForNebulizationText : globalConfig.nebulizationText;
case CallTypeEnum.none:
return isListView ? globalConfig.callForVitalSignText : globalConfig.vitalSignText;
return !isListView ? globalConfig.callForVitalSignText : globalConfig.vitalSignText;
default:
return globalConfig.callForVitalSignText;
}
}
SvgPicture icon(double height, {double? width, BoxFit fit = BoxFit.contain}) {
SvgPicture getIconByCallType(double height, {double? width, BoxFit fit = BoxFit.contain}) {
String iconPath = "";
if (this == CallTypeEnum.vitalSign) {
iconPath = AppAssets.vitalSignIcon;
@ -207,22 +211,53 @@ extension XCallType on CallTypeEnum {
iconPath.isEmpty ? "assets/images/wait.svg" : iconPath,
height: height,
width: width,
fit: fit,
color: getColorByCallType(),
// fit: fit,
);
}
String audio(String lang) {
if (this == CallTypeEnum.vitalSign) {
return "visit_nurse.mp3";
} else if (this == CallTypeEnum.doctor) {
return "visit_doctor.mp3";
} else if (this == CallTypeEnum.procedure) {
return "visit_doctor.mp3";
} else if (this == CallTypeEnum.vaccination) {
return "visit_doctor.mp3";
} else if (this == CallTypeEnum.nebulization) {
return "visit_doctor.mp3";
int getIdFromCallTypeEnum() {
switch (this) {
case CallTypeEnum.vitalSign:
return 1;
case CallTypeEnum.doctor:
return 2;
case CallTypeEnum.procedure:
return 3;
case CallTypeEnum.vaccination:
return 4;
case CallTypeEnum.nebulization:
return 5;
case CallTypeEnum.none:
return 1;
}
return "";
}
String getCallTextFromCallType(TicketData ticket) {
switch (this) {
case CallTypeEnum.vitalSign:
return ticket.callForVitalSignText;
case CallTypeEnum.doctor:
return ticket.callForDoctorText;
case CallTypeEnum.procedure:
return ticket.callForProcedureText;
case CallTypeEnum.vaccination:
return ticket.callForVaccinationText;
case CallTypeEnum.nebulization:
return ticket.callForNebulizationText;
default:
return ticket.callForVitalSignText;
}
}
}
extension XCallTypeInt on int {
CallTypeEnum toCallTypeEnum() {
if (this == 1) return CallTypeEnum.vitalSign;
if (this == 2) return CallTypeEnum.doctor;
if (this == 3) return CallTypeEnum.procedure;
if (this == 4) return CallTypeEnum.vaccination;
if (this == 5) return CallTypeEnum.nebulization;
return CallTypeEnum.vitalSign;
}
}

@ -10,6 +10,7 @@ import 'package:hmg_qline/repositories/signalR_repo.dart';
import 'package:hmg_qline/services/audio_service.dart';
import 'package:hmg_qline/services/cache_service.dart';
import 'package:hmg_qline/services/text_to_speech_service.dart';
import 'package:hmg_qline/utilities/enums.dart';
import 'package:hmg_qline/view_models/screen_config_view_model.dart';
class QueuingViewModel extends ChangeNotifier {
@ -46,7 +47,7 @@ class QueuingViewModel extends ChangeNotifier {
}
initializeAudioPlayer() {
audioService.listenAudioPlayerEvents(onAudioCompleted: onToneCompleted);
audioService.listenAudioPlayerEvents(onToneCompleted: onToneCompleted);
}
initializeTextToSpeech() {
@ -54,10 +55,16 @@ class QueuingViewModel extends ChangeNotifier {
}
Future<void> onHubConfigCall(var response) async {
log("onHubConfigCall: $response");
if (response != null && response.isNotEmpty) {
var data = response.first['data'];
GlobalConfigurationsModel globalConfigurationsModel = GlobalConfigurationsModel.fromJson(data as Map<String, dynamic>);
GlobalConfigurationsModel globalConfigurationsModel = GlobalConfigurationsModel.fromJson(
json: data,
qType: response.first['qType'] ?? 1,
screenType: response.first['screenType'] ?? 1,
);
log("onHubConfigCall: ${globalConfigurationsModel.toString()}");
ScreenConfigViewModel screenConfigViewModel = getIt.get<ScreenConfigViewModel>();
screenConfigViewModel.updateGlobalConfigurationsModel(value: globalConfigurationsModel, needNotify: true, shouldUpdateNextPrayer: true);
}
@ -81,11 +88,8 @@ class QueuingViewModel extends ChangeNotifier {
Future<void> onToneCompleted() async {
GlobalConfigurationsModel globalConfigurationsModel = getIt.get<ScreenConfigViewModel>().globalConfigurationsModel;
if (globalConfigurationsModel.isVoiceReq) {
textToSpeechService.speechText(
globalConfigurationsModel: globalConfigurationsModel,
ticket: currentTickets.first,
);
if (true) {
await textToSpeechService.speechText(globalConfigurationsModel: globalConfigurationsModel, ticket: currentTickets.first, isMute: !(globalConfigurationsModel.isVoiceReq));
} else {
waitAndCallNextTicketIfAvailable();
}
@ -102,7 +106,12 @@ class QueuingViewModel extends ChangeNotifier {
GlobalConfigurationsModel globalConfigurationsModel = getIt.get<ScreenConfigViewModel>().globalConfigurationsModel;
Timer(Duration(seconds: globalConfigurationsModel.concurrentCallDelaySec), () async {
if (queueTickets.isNotEmpty) {
int index = itemAlreadyAvailableAtIndex(ticketToSearch: queueTickets.first, listToSearchIn: currentTickets);
if (index != -1) {
currentTickets.removeAt(index);
}
currentTickets.insert(0, queueTickets.first);
if (currentTickets.length > globalConfigurationsModel.screenMaxDisplayPatients) {
currentTickets.removeLast();
}
@ -117,12 +126,29 @@ class QueuingViewModel extends ChangeNotifier {
Future<void> onHubTicketCall(List<Object?>? response) async {
logger.i("onHubTicketCall: $response");
log("isCallingInProgress: $isCallingInProgress");
if (response != null && response.isNotEmpty) {
TicketDetailsModel ticketDetailsModel = TicketDetailsModel.fromJson(response.first as Map<String, dynamic>);
addNewTicket(ticketDetailsModel);
}
}
int itemAlreadyAvailableAtIndex({required TicketDetailsModel ticketToSearch, required List<TicketDetailsModel> listToSearchIn}) {
int isFoundAt = -1;
try {
isFoundAt = listToSearchIn.indexWhere((ticket) {
log("ticket.ticketModel!.queueNo: ${ticket.ticketModel!.queueNo}");
log("ticketToSearch.ticketModel!.queueNo: ${ticketToSearch.ticketModel!.queueNo}");
return ticket.ticketModel!.queueNo == ticketToSearch.ticketModel!.queueNo;
});
log("itemAlreadyAvailableAtIndex: $isFoundAt");
return isFoundAt;
} catch (e) {
log("Error isItemAlreadyAvailableInList: ${e.toString()}");
return isFoundAt;
}
}
bool isCallingInProgress = false;
// Tickets Management
@ -131,13 +157,22 @@ class QueuingViewModel extends ChangeNotifier {
void addNewTicket(TicketDetailsModel ticket) {
if (!isCallingInProgress) {
int index = itemAlreadyAvailableAtIndex(ticketToSearch: ticket, listToSearchIn: currentTickets);
if (index != -1) {
currentTickets.removeAt(index);
}
currentTickets.insert(0, ticket);
GlobalConfigurationsModel globalConfigurationsModel = getIt.get<ScreenConfigViewModel>().globalConfigurationsModel;
if (currentTickets.length > globalConfigurationsModel.screenMaxDisplayPatients) {
currentTickets.removeLast();
}
callTicketOnScreen(ticketData: currentTickets.first.ticketModel);
} else {
int index = itemAlreadyAvailableAtIndex(ticketToSearch: ticket, listToSearchIn: queueTickets);
if (index != -1) {
queueTickets.removeAt(index);
}
queueTickets.add(ticket);
log("inQueue Length: ${queueTickets.length}");
}
@ -152,19 +187,49 @@ class QueuingViewModel extends ChangeNotifier {
if (ticketData == null) return;
ScreenConfigViewModel screenConfigViewModel = getIt.get<ScreenConfigViewModel>();
GlobalConfigurationsModel globalConfigurationsModel = screenConfigViewModel.globalConfigurationsModel;
screenConfigViewModel.acknowledgeTicket(ticketQueueID: ticketData.id!.toString());
if (globalConfigurationsModel.isToneReq) {
if (globalConfigurationsModel.qTypeEnum == QTypeEnum.appointment) {
screenConfigViewModel.acknowledgeTicketForAppointmentOnly(
ticketQueueID: ticketData.id ?? 0,
ipAddress: screenConfigViewModel.currentScreenIP,
callTypeEnum: ticketData.callTypeEnum,
);
} else {
screenConfigViewModel.acknowledgeTicket(ticketQueueID: ticketData.id ?? 0);
}
log("globalConfigurationsModel: ${globalConfigurationsModel.toString()}");
if (true) {
isCallingInProgress = true;
await audioService.playTone(path: AppAssets.callTone, isMute: false );
await audioService.playTone(path: AppAssets.callTone, isMute: !(globalConfigurationsModel.isToneReq));
} else if (globalConfigurationsModel.isVoiceReq) {
isCallingInProgress = true;
await textToSpeechService.speechText(
globalConfigurationsModel: globalConfigurationsModel,
ticket: currentTickets.first,
isMute: false
);
await textToSpeechService.speechText(globalConfigurationsModel: globalConfigurationsModel, ticket: currentTickets.first, isMute: !(globalConfigurationsModel.isVoiceReq));
} else {
waitAndCallNextTicketIfAvailable();
}
}
}
// Future<void> callTicketOnScreen({required TicketData? ticketData}) async {
// if (ticketData == null) return;
// ScreenConfigViewModel screenConfigViewModel = getIt.get<ScreenConfigViewModel>();
// GlobalConfigurationsModel globalConfigurationsModel = screenConfigViewModel.globalConfigurationsModel;
// if (globalConfigurationsModel.qTypeEnum == QTypeEnum.appointment) {
// screenConfigViewModel.acknowledgeTicketForAppointmentOnly(
// ticketQueueID: ticketData.id ?? 0,
// ipAddress: screenConfigViewModel.currentScreenIP,
// callTypeEnum: ticketData.callTypeEnum,
// );
// } else {
// screenConfigViewModel.acknowledgeTicket(ticketQueueID: ticketData.id ?? 0);
// }
// if (globalConfigurationsModel.isToneReq) {
// isCallingInProgress = true;
// await audioService.playTone(path: AppAssets.callTone, isMute: !(globalConfigurationsModel.isToneReq));
// } else if (globalConfigurationsModel.isVoiceReq) {
// isCallingInProgress = true;
// await textToSpeechService.speechText(globalConfigurationsModel: globalConfigurationsModel, ticket: currentTickets.first, isMute: !(globalConfigurationsModel.isVoiceReq));
// } else {
// waitAndCallNextTicketIfAvailable();
// }
// }

@ -19,6 +19,7 @@ import 'package:hmg_qline/utilities/extensions.dart';
import 'package:hmg_qline/view_models/queuing_view_model.dart';
import 'package:hmg_qline/views/view_helpers/info_components.dart';
import 'package:qr_code_scanner_plus/qr_code_scanner_plus.dart';
// import 'package:timezone/browser.dart' as tz;
class ScreenConfigViewModel extends ChangeNotifier {
final ScreenDetailsRepo screenDetailsRepo;
@ -33,12 +34,17 @@ class ScreenConfigViewModel extends ChangeNotifier {
Future<void> initializeScreenConfigVM() async {
await getGlobalConfigurationsByIP();
await getInfoWidgetsDetailsFromServer();
await getLastTimeUpdatedFromCache();
listenNetworkConnectivity();
getTheWidgetsConfigurationsEveryMidnight();
}
// Future<void> initializeTimezone() async {
// await tz.initializeTimeZone();
// var detroit = tz.getLocation('America/Detroit');
// var now = tz.TZDateTime.now(detroit);
// }
Future<void> waitForIPAndInitializeConfigVM() async {
while (currentScreenIP == "") {
await getCurrentScreenIP();
@ -114,9 +120,11 @@ class ScreenConfigViewModel extends ChangeNotifier {
Future<void> getGlobalConfigurationsByIP() async {
GlobalConfigurationsModel? response = await screenDetailsRepo.getGlobalScreenConfigurations(ipAddress: currentScreenIP);
log("response; $response");
response ??= GlobalConfigurationsModel.fromJson(MockJsonRepo.globalConfigurationMockResponse);
if (response == null) {
logger.e("response was: $response");
return;
}
updateGlobalConfigurationsModel(value: response);
updateCurrentScreenTypeEnum(globalConfigurationsModel.screenTypeEnum);
updateCurrentQTypeEnum(globalConfigurationsModel.qTypeEnum);
@ -126,6 +134,8 @@ class ScreenConfigViewModel extends ChangeNotifier {
void updateGlobalConfigurationsModel({required var value, bool needNotify = false, bool shouldUpdateNextPrayer = false}) {
globalConfigurationsModel = value;
log(" Updating@2 : ${globalConfigurationsModel.isToneReq}");
if (needNotify) {
notifyListeners();
}
@ -187,7 +197,7 @@ class ScreenConfigViewModel extends ChangeNotifier {
Future<void> getWeatherDetailsFromServer() async {
int testCityKey = 297030;
WeathersWidgetModel? response = await screenDetailsRepo.getWeatherDetailsByCity(
cityId: (globalConfigurationsModel.cityKey == 0 ? testCityKey : globalConfigurationsModel.cityKey).toString(),
cityId: ((globalConfigurationsModel.cityKey == null || globalConfigurationsModel.cityKey == 0) ? testCityKey : globalConfigurationsModel.cityKey).toString(),
);
if (response == null) {
@ -207,6 +217,10 @@ class ScreenConfigViewModel extends ChangeNotifier {
await getPrayerDetailsFromServer();
}
// log("prayersWidgetModel.dhuhr: ${prayersWidgetModel.dhuhr!}");
// log("dhuhr: ${prayersWidgetModel.dhuhr!.toDateTimeFromInt()}");
// log("current: $current");
if (prayersWidgetModel.fajr != null && prayersWidgetModel.fajr!.toDateTimeFromInt().isAfter(current)) {
final namazTime = prayersWidgetModel.fajr!.toFormattedDateTimeFromInt();
nextPrayerToShowWithTime = "${globalConfigurationsModel.fajarText} at $namazTime";
@ -374,7 +388,7 @@ class ScreenConfigViewModel extends ChangeNotifier {
}
}
Future<void> acknowledgeTicket({required String ticketQueueID}) async {
Future<void> acknowledgeTicket({required int ticketQueueID}) async {
GenericRespModel? response = await screenDetailsRepo.acknowledgeTicket(
ipAddress: currentScreenIP,
ticketQueueID: ticketQueueID,
@ -388,6 +402,20 @@ class ScreenConfigViewModel extends ChangeNotifier {
}
}
Future<void> acknowledgeTicketForAppointmentOnly({required int ticketQueueID, required String ipAddress, required CallTypeEnum callTypeEnum}) async {
GenericRespModel? response = await screenDetailsRepo.acknowledgeTicketForAppointment(
ticketId: ticketQueueID,
ipAddress: ipAddress,
callTypeEnum: callTypeEnum,
);
if (response == null || response.messageStatus != 1) {
logger.e("response null from acknowledgeTicket");
return;
} else {
logger.i("response from acknowledgeTicket ${response.data}");
}
}
// ***************************** TEXT INPUT PATIENT ID FUNCTIONS *********************
final TextEditingController patientIdController = TextEditingController();

@ -28,19 +28,14 @@ class AppFooter extends StatelessWidget {
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
onTap: () {
context.read<QueuingViewModel>().onHubTicketCall(MockJsonRepo.mockPatientTicketResponse);
},
child: AppText(
AppStrings.poweredBy,
fontSize: SizeConfig.getWidthMultiplier() * 2,
),
AppText(
AppStrings.poweredBy,
fontSize: SizeConfig.getWidthMultiplier() * 2.5,
),
Text("${screenConfigVM.currentScreenIP}_v${AppConstants.currentBuildVersion}",
Text("v${screenConfigVM.currentScreenIP}_${AppConstants.currentBuildVersion}",
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: SizeConfig.getWidthMultiplier() * 2,
fontSize: SizeConfig.getWidthMultiplier() * 1.7,
)),
Row(
children: [
@ -88,36 +83,36 @@ class AppFooter extends StatelessWidget {
},
child: Image.asset(
AppAssets.cloudLogo,
height: SizeConfig.getHeightMultiplier() * 0.5,
height: SizeConfig.getHeightMultiplier() * 0.6,
),
),
],
),
Expanded(
child: (!screenConfigVM.globalConfigurationsModel.isRssFeedReq || screenConfigVM.rssFeedModel.rssFeed == null || screenConfigVM.rssFeedModel.rssFeed!.isEmpty)
? const SizedBox()
: Container(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Marquee(
text: screenConfigVM.rssFeedModel.rssFeed ?? "",
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: SizeConfig.getWidthMultiplier() * 4,
fontFamily: AppStrings.fontNamePoppins,
),
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.center,
blankSpace: 20.0,
velocity: 100.0,
pauseAfterRound: const Duration(seconds: 1),
startPadding: 10.0,
accelerationDuration: const Duration(seconds: 1),
accelerationCurve: Curves.linear,
decelerationDuration: const Duration(milliseconds: 500),
decelerationCurve: Curves.easeOut,
),
if (screenConfigVM.globalConfigurationsModel.isRssFeedReq && screenConfigVM.rssFeedModel.rssFeed != null && screenConfigVM.rssFeedModel.rssFeed!.isNotEmpty) ...[
Expanded(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Marquee(
text: screenConfigVM.rssFeedModel.rssFeed ?? "",
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: SizeConfig.getWidthMultiplier() * 4,
fontFamily: AppStrings.fontNamePoppins,
),
)
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.center,
blankSpace: 20.0,
velocity: 100.0,
pauseAfterRound: const Duration(seconds: 1),
startPadding: 10.0,
accelerationDuration: const Duration(seconds: 1),
accelerationCurve: Curves.linear,
decelerationDuration: const Duration(milliseconds: 500),
decelerationCurve: Curves.easeOut,
),
),
)
]
],
));
});

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_qline/constants/app_constants.dart';
@ -62,7 +64,7 @@ Widget getPrayerWidget(ScreenConfigViewModel screenConfigViewModel) {
screenConfigViewModel.globalConfigurationsModel.orientationTypeEnum == ScreenOrientationEnum.portraitDown)
? SizeConfig.getHeightMultiplier() * 2
: SizeConfig.getHeightMultiplier() * 0.9,
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
decoration: AppColors.configWidgetDecoration,
child: Directionality(
@ -82,7 +84,7 @@ Widget getPrayerWidget(ScreenConfigViewModel screenConfigViewModel) {
),
AppText(
screenConfigViewModel.nextPrayerToShowWithTime,
fontSize: SizeConfig.getWidthMultiplier() * 3,
fontSize: SizeConfig.getWidthMultiplier() * 2.7,
fontHeight: 1,
fontFamily: screenConfigViewModel.globalConfigurationsModel.screenLanguageEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
),

@ -63,7 +63,6 @@ class AppHeader extends StatelessWidget implements PreferredSizeWidget {
return Selector<ScreenConfigViewModel, GlobalConfigurationsModel>(
selector: (context, screenConfigViewModel) => screenConfigViewModel.globalConfigurationsModel,
builder: (BuildContext context, GlobalConfigurationsModel globalConfigurationsModel, Widget? child) {
log("globalConfigurationsModel.qTypeEnum: ${globalConfigurationsModel.qTypeEnum}");
return Column(
children: [
Container(
@ -80,7 +79,7 @@ class AppHeader extends StatelessWidget implements PreferredSizeWidget {
AppText(
globalConfigurationsModel.currentServeText ?? "",
color: Colors.white,
fontSize: SizeConfig.getHeightMultiplier() * 0.1,
fontSize: SizeConfig.getHeightMultiplier() * 0.4,
fontFamily: globalConfigurationsModel.screenLanguageEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
),
SvgPicture.asset(

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:hmg_qline/models/global_config_model.dart';
import 'package:hmg_qline/models/ticket_model.dart';
@ -13,46 +15,47 @@ class PriorityTickets extends StatelessWidget {
@override
Widget build(BuildContext context) {
final TicketDetailsModel firstTicket = tickets[0];
final TicketData firstTicket = tickets[0].ticketModel!;
final List<TicketDetailsModel> otherTickets = tickets.sublist(1, tickets.length);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
TicketItem(
ticketNo: firstTicket.ticketModel!.queueNo ?? '',
ticketNo: firstTicket.queueNo ?? '',
scale: globalConfigurationsModel.screenTypeEnum == ScreenTypeEnum.roomLevelScreen ? 2 : 1.2,
blink: true,
roomNo: firstTicket.ticketModel!.roomNo ?? '',
roomText: globalConfigurationsModel.counterText ?? "",
roomNo: firstTicket.roomNo ?? '',
roomText: (globalConfigurationsModel.qTypeEnum == QTypeEnum.appointment ? globalConfigurationsModel.roomText : globalConfigurationsModel.counterText) ?? "",
isClinicAdded: false,
callTypeEnum: firstTicket.callTypeEnum,
textDirection: globalConfigurationsModel.textDirection,
message: globalConfigurationsModel.ticketNoText,
screenTypeEnum: globalConfigurationsModel.screenTypeEnum,
langTypeEnum: globalConfigurationsModel.screenLanguageEnum,
globalConfigurationsModel: globalConfigurationsModel,
),
if (tickets.length > 1) ...[
// SizedBox(height: SizeConfig.getHeightMultiplier() * 0.8),
Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: otherTickets
.map(
(ticket) => Padding(
padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 0.5),
child: TicketItem(
ticketNo: ticket.ticketModel!.queueNo ?? '',
scale: 0.8,
roomNo: firstTicket.ticketModel!.roomNo ?? '',
roomText: globalConfigurationsModel.counterText ?? "",
isClinicAdded: false,
textDirection: globalConfigurationsModel.textDirection,
message: globalConfigurationsModel.ticketNoText,
screenTypeEnum: globalConfigurationsModel.screenTypeEnum,
langTypeEnum: globalConfigurationsModel.screenLanguageEnum,
),
),
)
.toList(),
children: otherTickets.map((ticketDetailsModel) {
TicketData ticketData = ticketDetailsModel.ticketModel!;
return Padding(
padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 0.5),
child: TicketItem(
ticketNo: ticketData.queueNo ?? '',
scale: 0.8,
roomNo: ticketData.roomNo ?? '',
roomText: (globalConfigurationsModel.qTypeEnum == QTypeEnum.appointment ? globalConfigurationsModel.roomText : globalConfigurationsModel.counterText) ?? "",
isClinicAdded: false,
callTypeEnum: ticketData.callTypeEnum,
textDirection: globalConfigurationsModel.textDirection,
screenTypeEnum: globalConfigurationsModel.screenTypeEnum,
langTypeEnum: globalConfigurationsModel.screenLanguageEnum,
globalConfigurationsModel: globalConfigurationsModel,
),
);
}).toList(),
)
]
],

@ -3,6 +3,7 @@ import 'package:hmg_qline/constants/app_constants.dart';
import 'package:hmg_qline/models/global_config_model.dart';
import 'package:hmg_qline/models/ticket_model.dart';
import 'package:hmg_qline/utilities/enums.dart';
import 'package:hmg_qline/utilities/extensions.dart';
import 'package:hmg_qline/views/common_widgets/app_texts_widget.dart';
import 'package:hmg_qline/views/main_queue_screen/components/priority_tickets.dart';
import 'package:hmg_qline/views/view_helpers/size_config.dart';
@ -21,8 +22,8 @@ class PriorityTicketsWithSidelist extends StatelessWidget {
@override
Widget build(BuildContext context) {
final priorityTickets = tickets.sublist(0, 3);
final otherTickets = tickets.sublist(3, tickets.length);
final priorityTickets = tickets.sublist(0, AppConstants.thresholdForListUI);
final otherTickets = tickets.sublist(AppConstants.thresholdForListUI, tickets.length);
final List<Widget> children = [
Expanded(flex: 7, child: PriorityTickets(globalConfigurationsModel: globalConfigurationsModel, tickets: priorityTickets)),
@ -62,35 +63,37 @@ class PriorityTicketsWithSidelist extends StatelessWidget {
height: SizeConfig.getHeightMultiplier() * 0.3,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
// Expanded(
// flex: 5,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// AppText(
// globalConfigurationsModel.callForText ?? "",
// letterSpacing: -2,
// fontHeight: 0.5,
// fontWeight: FontWeight.bold,
// fontSize: SizeConfig.getWidthMultiplier() * 3.8,
// textAlign: TextAlign.center,
// ),
// ],
// ),
// ),
// Container(
// color: Colors.grey.withOpacity(0.5),
// width: 5,
// height: SizeConfig.getHeightMultiplier() * 0.3,
// margin: const EdgeInsets.symmetric(horizontal: 15),
// ),
if (globalConfigurationsModel.qTypeEnum == QTypeEnum.appointment) ...[
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
globalConfigurationsModel.callForText ?? "",
letterSpacing: -2,
fontHeight: 0.5,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
textAlign: TextAlign.center,
),
],
),
),
Container(
color: Colors.grey.withOpacity(0.5),
width: 5,
height: SizeConfig.getHeightMultiplier() * 0.3,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
],
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
globalConfigurationsModel.counterText ?? "",
(globalConfigurationsModel.qTypeEnum == QTypeEnum.appointment ? globalConfigurationsModel.roomText : globalConfigurationsModel.counterText) ?? "",
letterSpacing: -2,
fontHeight: 0.5,
fontWeight: FontWeight.bold,
@ -109,7 +112,7 @@ class PriorityTicketsWithSidelist extends StatelessWidget {
shrinkWrap: true,
itemCount: otherTickets.length,
itemBuilder: (ctx, index) {
final ticket = otherTickets[index];
final ticketModel = otherTickets[index].ticketModel;
return Padding(
padding: const EdgeInsets.all(8),
child: Directionality(
@ -123,12 +126,12 @@ class PriorityTicketsWithSidelist extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
ticket.ticketModel!.queueNo ?? "",
ticketModel!.queueNo ?? "",
letterSpacing: -1,
fontHeight: 0.5,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.5,
textAlign: TextAlign.center,
fontHeight: 0.5,
fontFamily: globalConfigurationsModel.screenLanguageEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
),
],
@ -140,41 +143,50 @@ class PriorityTicketsWithSidelist extends StatelessWidget {
height: SizeConfig.getHeightMultiplier() * 0.3,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
// Expanded(
// flex: 5,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// AppText(
// "ZahoorWillAddThis",
// color: AppColors.blackColor,
// letterSpacing: -1,
// fontSize: SizeConfig.getWidthMultiplier() * 3,
// fontWeight: FontWeight.w600,
// fontHeight: 0.5,
// ),
// ],
// ),
// ),
// Container(
// color: Colors.grey.withOpacity(0.5),
// width: 5,
// height: SizeConfig.getHeightMultiplier() * 0.3,
// margin: const EdgeInsets.symmetric(horizontal: 15),
// ),
if (globalConfigurationsModel.qTypeEnum == QTypeEnum.appointment) ...[
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: SizedBox(
height: SizeConfig.getWidthMultiplier() * 3,
child: ticketModel.callTypeEnum.getIconByCallType(SizeConfig.getHeightMultiplier() * 0.3),
),
),
const SizedBox(width: 15),
AppText(
ticketModel.callTypeEnum.getMessageByCallType(globalConfigurationsModel, isListView: true),
color: ticketModel.callTypeEnum.getColorByCallType(),
fontSize: SizeConfig.getWidthMultiplier() * 3,
fontWeight: FontWeight.w600,
fontHeight: 0.5,
),
],
),
),
Container(
color: Colors.grey.withOpacity(0.5),
width: 5,
height: SizeConfig.getHeightMultiplier() * 0.3,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
],
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
ticket.ticketModel!.roomNo ?? "",
ticketModel.roomNo ?? "",
color: AppColors.blackColor,
letterSpacing: -1.5,
fontHeight: 0.5,
fontSize: SizeConfig.getWidthMultiplier() * 3.3,
fontWeight: FontWeight.w600,
fontHeight: 0.5,
fontFamily: globalConfigurationsModel.screenLanguageEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
),
],

@ -1,7 +1,9 @@
import 'package:blinking_text/blinking_text.dart';
import 'package:flutter/material.dart';
import 'package:hmg_qline/constants/app_constants.dart';
import 'package:hmg_qline/models/global_config_model.dart';
import 'package:hmg_qline/utilities/enums.dart';
import 'package:hmg_qline/utilities/extensions.dart';
import 'package:hmg_qline/views/common_widgets/app_texts_widget.dart';
import 'package:hmg_qline/views/view_helpers/size_config.dart';
@ -12,8 +14,9 @@ class TicketItem extends StatelessWidget {
final double scale;
final bool isClinicAdded;
final TextDirection textDirection;
final String message;
final String roomText;
final GlobalConfigurationsModel globalConfigurationsModel;
final CallTypeEnum callTypeEnum;
final ScreenTypeEnum screenTypeEnum;
final LanguageEnum langTypeEnum;
@ -24,8 +27,9 @@ class TicketItem extends StatelessWidget {
required this.roomNo,
required this.scale,
required this.textDirection,
required this.message,
required this.roomText,
required this.globalConfigurationsModel,
required this.callTypeEnum,
required this.screenTypeEnum,
required this.langTypeEnum,
this.blink = false,
@ -62,7 +66,7 @@ class TicketItem extends StatelessWidget {
endColor: blink ? Colors.black.withOpacity(0.1) : Colors.black,
times: 0,
duration: const Duration(seconds: 1)),
const SizedBox(height: 20),
const SizedBox(height: 30),
screenTypeEnum == ScreenTypeEnum.roomLevelScreen
? const SizedBox()
: Directionality(
@ -71,10 +75,17 @@ class TicketItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: SizedBox(
height: SizeConfig.getWidthMultiplier() * 3,
child: callTypeEnum.getIconByCallType(SizeConfig.getHeightMultiplier() * 0.3),
),
),
const SizedBox(width: 13),
AppText(
message,
color: AppColors.blackColor,
letterSpacing: -1,
callTypeEnum.getMessageByCallType(globalConfigurationsModel, isListView: false),
color: callTypeEnum.getColorByCallType(),
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
fontWeight: FontWeight.w600,
fontHeight: 1,
@ -88,7 +99,7 @@ class TicketItem extends StatelessWidget {
),
AppText(
textDirection == TextDirection.ltr ? "$roomText: $roomNo" : " $roomNo : $roomText",
color: AppColors.blackColor,
color: callTypeEnum.getColorByCallType(),
letterSpacing: -1,
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
fontWeight: FontWeight.w600,

@ -18,6 +18,16 @@ class MainQueueScreen extends StatelessWidget {
Widget dataContent({required BuildContext context}) {
return Consumer2(
builder: (BuildContext context, ScreenConfigViewModel screenConfigViewModel, QueuingViewModel queuingViewModel, Widget? child) {
//
// // TODO: FOR TEST
// queuingViewModel.textToSpeechService.speechText(
// globalConfigurationsModel: screenConfigViewModel.globalConfigurationsModel,
// ticket: queuingViewModel.currentTickets.first,
// );
// screenConfigViewModel.getNextPrayerToShow();
Widget widget = const SizedBox();
String text = AppStrings.awaitingArrivalEng;
String fontFamily = AppStrings.fontNamePoppins;

@ -47,8 +47,8 @@ class SplashScreen extends StatelessWidget {
// If the data is loaded successfully
if (snapshot.connectionState == ConnectionState.done) {
Future.delayed(const Duration(seconds: 1)).whenComplete(() {
log("context.read<ScreenConfigViewModel>().currentScreenTypeEnum: ${context.read<ScreenConfigViewModel>().currentScreenTypeEnum}");
log("context.read<ScreenConfigViewModel>().currentQTypeEnum: ${context.read<ScreenConfigViewModel>().currentQTypeEnum}");
// log("context.read<ScreenConfigViewModel>().currentScreenTypeEnum: ${context.read<ScreenConfigViewModel>().currentScreenTypeEnum}");
// log("context.read<ScreenConfigViewModel>().currentQTypeEnum: ${context.read<ScreenConfigViewModel>().currentQTypeEnum}");
if (context.read<ScreenConfigViewModel>().currentScreenTypeEnum == ScreenTypeEnum.kioskScreen) {
context.navigateReplaceTo(AppRoutes.kioskMainScreen);
} else {

@ -61,10 +61,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
connectivity_plus:
dependency: "direct main"
description:
@ -101,10 +101,10 @@ packages:
dependency: transitive
description:
name: dbus
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c"
url: "https://pub.dev"
source: hosted
version: "0.7.10"
version: "0.7.11"
equatable:
dependency: transitive
description:
@ -196,10 +196,10 @@ packages:
dependency: "direct main"
description:
name: fluttertoast
sha256: "95f349437aeebe524ef7d6c9bde3e6b4772717cf46a0eb6a3ceaddc740b297cc"
sha256: "25e51620424d92d3db3832464774a6143b5053f15e382d8ffbfd40b6e795dcf1"
url: "https://pub.dev"
source: hosted
version: "8.2.8"
version: "8.2.12"
get_it:
dependency: "direct main"
description:
@ -260,18 +260,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
@ -548,7 +548,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_span:
dependency: transitive
description:
@ -577,10 +577,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.0"
stream_channel:
dependency: transitive
description:
@ -593,10 +593,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
term_glyph:
dependency: transitive
description:
@ -609,10 +609,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.3"
tuple:
dependency: transitive
description:
@ -673,26 +673,26 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.3.0"
wakelock_plus:
dependency: "direct main"
description:
name: wakelock_plus
sha256: "36c88af0b930121941345306d259ec4cc4ecca3b151c02e3a9e71aede83c615e"
sha256: a474e314c3e8fb5adef1f9ae2d247e57467ad557fa7483a2b895bc1b421c5678
url: "https://pub.dev"
source: hosted
version: "1.2.10"
version: "1.3.2"
wakelock_plus_platform_interface:
dependency: transitive
description:
name: wakelock_plus_platform_interface
sha256: "70e780bc99796e1db82fe764b1e7dcb89a86f1e5b3afb1db354de50f2e41eb7a"
sha256: e10444072e50dbc4999d7316fd303f7ea53d31c824aa5eb05d7ccbdd98985207
url: "https://pub.dev"
source: hosted
version: "1.2.2"
version: "1.2.3"
web:
dependency: transitive
description:

@ -40,7 +40,7 @@ dependencies:
get_it: ^8.0.2
connectivity_plus: ^6.1.0
flutter_svg: ^2.0.14
# http: ^1.2.2
# http: ^1.2.2
blinking_text: ^1.0.2
just_audio: ^0.9.42
flutter_tts: ^4.2.0
@ -115,3 +115,5 @@ flutter:
- asset: assets/fonts/Cairo/Cairo-Bold/Cairo-Bold.ttf
weight: 700

Loading…
Cancel
Save