faiz_kiosk
FaizHashmiCS22 10 months ago
parent 962a2af9ff
commit 6b9cb8aa5f

@ -1,3 +1,4 @@
import 'dart:developer';
import 'dart:ui'; import 'dart:ui';
import 'package:hmg_qline/utilities/enums.dart'; import 'package:hmg_qline/utilities/enums.dart';
import 'package:hmg_qline/utilities/extensions.dart'; import 'package:hmg_qline/utilities/extensions.dart';

@ -24,9 +24,9 @@ abstract class ScreenDetailsRepo {
class ScreenDetailsRepoImp implements ScreenDetailsRepo { class ScreenDetailsRepoImp implements ScreenDetailsRepo {
ApiClient apiClientInstance; ApiClient apiClientInstance;
ScreenDetailsRepoImp({required this.apiClientInstance}); ScreenDetailsRepoImp({required this.apiClientInstance});
@override @override
Future<GlobalConfigurationsModel?> getGlobalScreenConfigurations({required String ipAddress}) async { Future<GlobalConfigurationsModel?> getGlobalScreenConfigurations({required String ipAddress}) async {
try { try {

@ -34,9 +34,10 @@ class TextToSpeechServiceImp implements TextToSpeechService {
textToSpeechInstance.setSpeechRate(0.45); textToSpeechInstance.setSpeechRate(0.45);
textToSpeechInstance.setPitch(0.9); textToSpeechInstance.setPitch(0.9);
// String postVoice = globalConfigurationsModel.postVoiceText;
String postVoice = '';
LanguageEnum langEnum = globalConfigurationsModel.voiceLanguageEnum; LanguageEnum langEnum = globalConfigurationsModel.voiceLanguageEnum;
String preVoice = globalConfigurationsModel.ticketNoText; String preVoice = globalConfigurationsModel.ticketNoText;
String postVoice = globalConfigurationsModel.postVoiceText;
String ticketNo = ticket.ticketModel!.queueNo!.trim().toString(); String ticketNo = ticket.ticketModel!.queueNo!.trim().toString();
bool isClinicNameAdded = false; bool isClinicNameAdded = false;
@ -75,7 +76,6 @@ class TextToSpeechServiceImp implements TextToSpeechService {
log("Speech: $preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice"); log("Speech: $preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice");
// Create Pre Voice Players // Create Pre Voice Players
if (postVoice.isNotEmpty) {
log('lang $langEnum'); log('lang $langEnum');
if (langEnum != LanguageEnum.arabic) { if (langEnum != LanguageEnum.arabic) {
await textToSpeechInstance.setLanguage(langEnum.enumToString()); await textToSpeechInstance.setLanguage(langEnum.enumToString());
@ -84,19 +84,15 @@ class TextToSpeechServiceImp implements TextToSpeechService {
} }
await textToSpeechInstance.setLanguage(langEnum.enumToString()); await textToSpeechInstance.setLanguage(langEnum.enumToString());
textToSpeechInstance.setPitch(1.1); textToSpeechInstance.setPitch(1.3);
if (isNeedToBreakVoiceForArabic) { if (isNeedToBreakVoiceForArabic) {
await textToSpeechInstance.speak("$preVoice .. "); await textToSpeechInstance.speak("$preVoice .. ");
await textToSpeechInstance.setLanguage("en"); await textToSpeechInstance.setLanguage("en");
await textToSpeechInstance.speak("$clinicName .. $patientAlpha .. $patientNumeric .. "); await textToSpeechInstance.speak("$clinicName .. $patientAlpha .. $patientNumeric .. ");
await textToSpeechInstance.setLanguage(langEnum.enumToString());
await textToSpeechInstance.speak(postVoice);
} else { } else {
log("here");
await textToSpeechInstance.speak("$preVoice .. .. $clinicName .. $patientAlpha .. .. $patientNumeric .. .. $postVoice"); await textToSpeechInstance.speak("$preVoice .. .. $clinicName .. $patientAlpha .. .. $patientNumeric .. .. $postVoice");
} }
} }
}
@override @override
void listenToTextToSpeechEvents({required Function() onVoiceCompleted}) { void listenToTextToSpeechEvents({required Function() onVoiceCompleted}) {

@ -65,7 +65,7 @@ extension QTypeEnumExtension on int {
case 4: case 4:
return QTypeEnum.pharmacy; return QTypeEnum.pharmacy;
default: default:
throw ArgumentError("Invalid QType value: $this"); return QTypeEnum.lab;
} }
} }
} }
@ -90,7 +90,7 @@ extension ScreenTypeExtension on int {
case 4: case 4:
return ScreenTypeEnum.dashboardScreen; return ScreenTypeEnum.dashboardScreen;
default: default:
throw ArgumentError("Invalid ScreenType value: $this"); return ScreenTypeEnum.waitingAreaScreen;
} }
} }
} }

@ -55,9 +55,12 @@ class QueuingViewModel extends ChangeNotifier {
Future<void> onHubConfigCall(var response) async { Future<void> onHubConfigCall(var response) async {
log("onHubConfigCall: $response"); log("onHubConfigCall: $response");
// TODO: if (response != null && response.isNotEmpty) {
// ScreenConfigViewModel screenConfigViewModel = getIt.get<ScreenConfigViewModel>(); var data = response.first['data'];
// screenConfigViewModel.updateGlobalConfigurationsModel(true); GlobalConfigurationsModel globalConfigurationsModel = GlobalConfigurationsModel.fromJson(data as Map<String, dynamic>);
ScreenConfigViewModel screenConfigViewModel = getIt.get<ScreenConfigViewModel>();
screenConfigViewModel.updateGlobalConfigurationsModel(value: globalConfigurationsModel, needNotify: true);
}
} }
Future<void> onHubReconnected(var response) async { Future<void> onHubReconnected(var response) async {

@ -276,7 +276,7 @@ class ScreenConfigViewModel extends ChangeNotifier {
for (int i = 0; i < numOfTicketsToCreate; i++) { for (int i = 0; i < numOfTicketsToCreate; i++) {
GenericRespModel? response = await screenDetailsRepo.createNextTickets(ticketNumber: startTicket); GenericRespModel? response = await screenDetailsRepo.createNextTickets(ticketNumber: startTicket);
startTicket = startTicket + 1; startTicket = startTicket + 1;
if (response == null) { if (response == null || response.messageStatus != 1) {
log("response null from createNextTickets"); log("response null from createNextTickets");
return; return;
} }

@ -83,7 +83,7 @@ class AppFooter extends StatelessWidget {
], ],
), ),
Expanded( Expanded(
child: (screenConfigVM.rssFeedModel.rssFeed == null || screenConfigVM.rssFeedModel.rssFeed!.isEmpty) child: (!screenConfigVM.globalConfigurationsModel.isRssFeedReq || screenConfigVM.rssFeedModel.rssFeed == null || screenConfigVM.rssFeedModel.rssFeed!.isEmpty)
? const SizedBox() ? const SizedBox()
: Container( : Container(
padding: const EdgeInsets.symmetric(horizontal: 10), padding: const EdgeInsets.symmetric(horizontal: 10),

@ -61,28 +61,28 @@ class PriorityTicketsSidelist extends StatelessWidget {
height: SizeConfig.getHeightMultiplier() * 0.3, height: SizeConfig.getHeightMultiplier() * 0.3,
margin: const EdgeInsets.symmetric(horizontal: 15), margin: const EdgeInsets.symmetric(horizontal: 15),
), ),
Expanded( // Expanded(
flex: 5, // flex: 5,
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
children: [ // children: [
AppText( // AppText(
globalConfigurationsModel.callForText ?? "", // globalConfigurationsModel.callForText ?? "",
letterSpacing: -2, // letterSpacing: -2,
fontHeight: 0.5, // fontHeight: 0.5,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.8, // fontSize: SizeConfig.getWidthMultiplier() * 3.8,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
), // ),
], // ],
), // ),
), // ),
Container( // Container(
color: Colors.grey.withOpacity(0.5), // color: Colors.grey.withOpacity(0.5),
width: 5, // width: 5,
height: SizeConfig.getHeightMultiplier() * 0.3, // height: SizeConfig.getHeightMultiplier() * 0.3,
margin: const EdgeInsets.symmetric(horizontal: 15), // margin: const EdgeInsets.symmetric(horizontal: 15),
), // ),
Expanded( Expanded(
flex: 3, flex: 3,
child: Row( child: Row(
@ -137,36 +137,36 @@ class PriorityTicketsSidelist extends StatelessWidget {
height: SizeConfig.getHeightMultiplier() * 0.3, height: SizeConfig.getHeightMultiplier() * 0.3,
margin: const EdgeInsets.symmetric(horizontal: 15), margin: const EdgeInsets.symmetric(horizontal: 15),
), ),
Expanded( // Expanded(
flex: 5, // flex: 5,
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
AppText( // AppText(
"ZahoorWillAddThis", // "ZahoorWillAddThis",
color: AppColors.blackColor, // color: AppColors.blackColor,
letterSpacing: -1, // letterSpacing: -1,
fontSize: SizeConfig.getWidthMultiplier() * 3, // fontSize: SizeConfig.getWidthMultiplier() * 3,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
fontHeight: 0.5, // fontHeight: 0.5,
), // ),
], // ],
), // ),
), // ),
Container( // Container(
color: Colors.grey.withOpacity(0.5), // color: Colors.grey.withOpacity(0.5),
width: 5, // width: 5,
height: SizeConfig.getHeightMultiplier() * 0.3, // height: SizeConfig.getHeightMultiplier() * 0.3,
margin: const EdgeInsets.symmetric(horizontal: 15), // margin: const EdgeInsets.symmetric(horizontal: 15),
), // ),
Expanded( Expanded(
flex: 3, flex: 3,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AppText( AppText(
"RoomNo", ticket.ticketModel!.roomNo ?? "",
color: AppColors.blackColor, color: AppColors.blackColor,
letterSpacing: -1.5, letterSpacing: -1.5,
fontSize: SizeConfig.getWidthMultiplier() * 3.3, fontSize: SizeConfig.getWidthMultiplier() * 3.3,

@ -132,9 +132,9 @@ class MainQueueScreen extends StatelessWidget {
return Consumer2( return Consumer2(
builder: (BuildContext context, ScreenConfigViewModel screenConfigViewModel, QueuingViewModel queuingViewModel, Widget? child) { builder: (BuildContext context, ScreenConfigViewModel screenConfigViewModel, QueuingViewModel queuingViewModel, Widget? child) {
Widget widget = const SizedBox(); Widget widget = const SizedBox();
// screenConfigViewModel.createAutoTickets();
// queuingViewModel.voiceCallTicket(ticketData: queuingViewModel.currentTickets.first.ticketModel); // queuingViewModel.voiceCallTicket(ticketData: queuingViewModel.currentTickets.first.ticketModel);
if (queuingViewModel.currentTickets.isEmpty) { if (queuingViewModel.currentTickets.isEmpty) {
// screenConfigViewModel.createAutoTickets();
widget = noPatientInQueue(); widget = noPatientInQueue();
} else if (screenConfigViewModel.globalConfigurationsModel.screenTypeEnum == ScreenTypeEnum.roomLevelScreen) { } else if (screenConfigViewModel.globalConfigurationsModel.screenTypeEnum == ScreenTypeEnum.roomLevelScreen) {
widget = PriorityTickets( widget = PriorityTickets(
@ -180,11 +180,7 @@ class MainQueueScreen extends StatelessWidget {
Widget getBody({required BuildContext context}) { Widget getBody({required BuildContext context}) {
return Consumer<ScreenConfigViewModel>( return Consumer<ScreenConfigViewModel>(
builder: ( builder: (BuildContext context, ScreenConfigViewModel screenConfigVM, Widget? child) {
BuildContext context,
ScreenConfigViewModel screenConfigVM,
Widget? child,
) {
return Column( return Column(
children: [ children: [
Expanded( Expanded(
@ -193,11 +189,16 @@ class MainQueueScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row( child: Row(
children: [ children: [
if (screenConfigVM.globalConfigurationsModel.isWeatherReq) ...[
getWeatherWidget(screenConfigVM), getWeatherWidget(screenConfigVM),
],
const SizedBox(width: 20), const SizedBox(width: 20),
if (screenConfigVM.globalConfigurationsModel.isPrayerTimeReq) ...[
getPrayerWidget(screenConfigVM), getPrayerWidget(screenConfigVM),
], ],
)), ],
),
),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
Expanded(flex: 10, child: dataContent(context: context)), Expanded(flex: 10, child: dataContent(context: context)),

Loading…
Cancel
Save