faiz_kiosk
FaizHashmiCS22 10 months ago
parent 962a2af9ff
commit 6b9cb8aa5f

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

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

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

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

@ -55,9 +55,12 @@ class QueuingViewModel extends ChangeNotifier {
Future<void> onHubConfigCall(var response) async {
log("onHubConfigCall: $response");
// TODO:
// ScreenConfigViewModel screenConfigViewModel = getIt.get<ScreenConfigViewModel>();
// screenConfigViewModel.updateGlobalConfigurationsModel(true);
if (response != null && response.isNotEmpty) {
var data = response.first['data'];
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 {

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

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

@ -61,28 +61,28 @@ class PriorityTicketsSidelist 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),
),
// 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(
@ -137,36 +137,36 @@ class PriorityTicketsSidelist 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),
),
// 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),
// ),
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
"RoomNo",
ticket.ticketModel!.roomNo ?? "",
color: AppColors.blackColor,
letterSpacing: -1.5,
fontSize: SizeConfig.getWidthMultiplier() * 3.3,

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

Loading…
Cancel
Save