Data Accuracy

data_accuracy_faiz
FaizHashmiCS22 7 months ago
parent a9e72035e9
commit 58afcf184a

@ -14,6 +14,8 @@ const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT
/// Timer Info /// Timer Info
const TIMER_MIN = 10; const TIMER_MIN = 10;
const currentBuildVersion = 4;
class AppGlobal { class AppGlobal {
static var CONTEX; static var CONTEX;

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:marquee/marquee.dart'; import 'package:marquee/marquee.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/config/size_config.dart'; import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/core/response_models/call_config_model.dart'; import 'package:queuing_system/core/response_models/call_config_model.dart';
import 'package:queuing_system/home/app_provider.dart'; import 'package:queuing_system/home/app_provider.dart';
@ -37,8 +38,7 @@ class AppFooter extends StatelessWidget {
fontFamily: 'Poppins-Medium.ttf', fontFamily: 'Poppins-Medium.ttf',
), ),
), ),
Text("v${appProvider.currentDeviceIp}", Text("v${appProvider.currentDeviceIp}_$currentBuildVersion", style: TextStyle(fontWeight: FontWeight.w500, fontSize: SizeConfig.getWidthMultiplier() * 1.8)),
style: TextStyle(fontWeight: FontWeight.w500, fontSize: SizeConfig.getWidthMultiplier() * 2.2)),
Row( Row(
children: [ children: [
InkWell( InkWell(

@ -400,14 +400,20 @@ class AppProvider extends ChangeNotifier {
logger.i("voiceCaller: ${voiceCaller == null}"); logger.i("voiceCaller: ${voiceCaller == null}");
logger.i("isQueue: ${patientTicket.isQueue}"); logger.i("isQueue: ${patientTicket.isQueue}");
logger.i("isToneReq: ${patientTicket.isToneReq}"); logger.i("isToneReq: ${patientTicket.isToneReq}");
//TODO: DATA ACCURACY
if (patientTicket.isToneReq && !patientTicket.isQueue) { // if (patientTicket.isToneReq && !patientTicket.isQueue) {
if (!patientTicket.isQueue) {
if (!patientTicket.isToneReq) {
await audioPlayer.setVolume(0.0);
}
audioPlayer.setAsset("assets/tones/call_tone.mp3"); audioPlayer.setAsset("assets/tones/call_tone.mp3");
await audioPlayer.play(); await audioPlayer.play();
await Future.delayed(const Duration(seconds: 2)); await Future.delayed(const Duration(seconds: 2));
} }
if (patientTicket.isVoiceReq && voiceCaller == null && !patientTicket.isQueue) { //TODO: DATA ACCURACY
// if (patientTicket.isVoiceReq && voiceCaller == null && !patientTicket.isQueue) {
if (!patientTicket.isQueue) {
logger.i("patientTicket.voiceLanguage: ${patientTicket.voiceLanguage}"); logger.i("patientTicket.voiceLanguage: ${patientTicket.voiceLanguage}");
final postVoice = getCallTypeText(patientTicket); final postVoice = getCallTypeText(patientTicket);
voiceCaller = CallByVoice( voiceCaller = CallByVoice(
@ -416,12 +422,16 @@ class AppProvider extends ChangeNotifier {
postVoice: postVoice, postVoice: postVoice,
lang: patientTicket.voiceLanguage == 1 ? "en" : "ar", lang: patientTicket.voiceLanguage == 1 ? "en" : "ar",
flutterTts: flutterTts, flutterTts: flutterTts,
isMute: !patientTicket.isVoiceReq,
); );
await voiceCaller!.startCalling(patientTicket.queueNo.trim().toString() != patientTicket.callNoStr.trim().toString()).whenComplete(() {
voiceCaller = null; //TODO: DATA ACCURACY
onVoiceCompleted(); // await voiceCaller!.startCalling(patientTicket.queueNo.trim().toString() != patientTicket.callNoStr.trim().toString()).whenComplete(() {
logger.i("Completed Calling!! ${isQueuePatients.length}"); // voiceCaller = null;
}); // onVoiceCompleted();
// logger.i("Completed Calling!! ${isQueuePatients.length}");
// });
await voiceCaller!.startCalling(patientTicket.queueNo.trim().toString() != patientTicket.callNoStr.trim().toString());
} else { } else {
isCallingInProgress = false; isCallingInProgress = false;
logger.i("Setting isCallingInProgress : $isCallingInProgress"); logger.i("Setting isCallingInProgress : $isCallingInProgress");

@ -22,7 +22,9 @@ class MyHomePage extends StatelessWidget {
return const SizedBox.shrink(); return const SizedBox.shrink();
} }
return Container( return Container(
height: (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown) ? SizeConfig.getHeightMultiplier() * 8 : SizeConfig.getHeightMultiplier() * 5, height: (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown)
? SizeConfig.getHeightMultiplier() * 8
: SizeConfig.getHeightMultiplier() * 5,
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10), padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
decoration: AppGlobal.configWidgetDecoration, decoration: AppGlobal.configWidgetDecoration,
child: Directionality( child: Directionality(
@ -64,7 +66,9 @@ class MyHomePage extends StatelessWidget {
return const SizedBox.shrink(); return const SizedBox.shrink();
} }
return Container( return Container(
height: (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown) ? SizeConfig.getHeightMultiplier() * 8 : SizeConfig.getHeightMultiplier() * 5, height: (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown)
? SizeConfig.getHeightMultiplier() * 8
: SizeConfig.getHeightMultiplier() * 5,
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10), padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
decoration: AppGlobal.configWidgetDecoration, decoration: AppGlobal.configWidgetDecoration,
child: Directionality( child: Directionality(

@ -106,7 +106,7 @@ class TicketItem extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.getWidthMultiplier() * 10, fontSize: SizeConfig.getWidthMultiplier() * 10,
letterSpacing: -1, letterSpacing: -1,
height: 0.5, height: 0.7,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
beginColor: Colors.black, beginColor: Colors.black,
@ -122,10 +122,7 @@ class TicketItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Padding( callType.icon(SizeConfig.getHeightMultiplier() * 2),
padding: EdgeInsets.only(bottom: callType == CallType.vitalSign ? 8 : 8),
child: callType.icon(SizeConfig.getHeightMultiplier() * 2),
),
const SizedBox(width: 13), const SizedBox(width: 13),
AppText( AppText(
callType.message(callConfig), callType.message(callConfig),
@ -133,16 +130,13 @@ class TicketItem extends StatelessWidget {
letterSpacing: -1, letterSpacing: -1,
fontSize: SizeConfig.getWidthMultiplier() * 3.8, fontSize: SizeConfig.getWidthMultiplier() * 3.8,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontHeight: 1, fontHeight: 0.7,
), ),
Padding( Container(
padding: const EdgeInsets.only(bottom: 8.0), color: Colors.grey.withOpacity(0.5),
child: Container( width: 5,
color: Colors.grey.withOpacity(0.5), height: SizeConfig.getHeightMultiplier() * 2,
width: 5, margin: const EdgeInsets.symmetric(horizontal: 15),
height: SizeConfig.getHeightMultiplier() * 2,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
), ),
AppText( AppText(
callConfig.textDirection == TextDirection.ltr ? "${callConfig.roomText}: $roomNo" : " $roomNo : ${callConfig.roomText}", callConfig.textDirection == TextDirection.ltr ? "${callConfig.roomText}: $roomNo" : " $roomNo : ${callConfig.roomText}",
@ -150,7 +144,7 @@ class TicketItem extends StatelessWidget {
letterSpacing: -1, letterSpacing: -1,
fontSize: SizeConfig.getWidthMultiplier() * 3.8, fontSize: SizeConfig.getWidthMultiplier() * 3.8,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontHeight: 1, fontHeight: 0.7,
), ),
], ],
), ),
@ -194,7 +188,6 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
final priorityTickets = tickets.sublist(0, 3); final priorityTickets = tickets.sublist(0, 3);
final otherTickets = tickets.sublist(3, tickets.length); final otherTickets = tickets.sublist(3, tickets.length);
final AppProvider appProvider = context.watch<AppProvider>(); final AppProvider appProvider = context.watch<AppProvider>();
log("appProvider.currentScreenRotation: ${appProvider.currentScreenRotation}");
final List<Widget> children = [ final List<Widget> children = [
Expanded(flex: 8, child: PriorityTickets(callConfig: callConfig, tickets: priorityTickets)), Expanded(flex: 8, child: PriorityTickets(callConfig: callConfig, tickets: priorityTickets)),
@ -204,11 +197,11 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
child: ListView( child: ListView(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.fromLTRB(10, SizeConfig.getHeightMultiplier() * 3.3, 10, 10), padding: EdgeInsets.fromLTRB(10, SizeConfig.getHeightMultiplier() * 3.3, 10, 20),
child: Directionality( child: Directionality(
textDirection: callConfig.textDirection, textDirection: callConfig.textDirection,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Expanded( Expanded(
@ -221,7 +214,7 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
letterSpacing: -2, letterSpacing: -2,
fontHeight: 0.5, fontHeight: 0.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.8, fontSize: SizeConfig.getWidthMultiplier() * 4,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
], ],
@ -243,7 +236,7 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
letterSpacing: -2, letterSpacing: -2,
fontHeight: 0.5, fontHeight: 0.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.8, fontSize: SizeConfig.getWidthMultiplier() * 4,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
], ],
@ -265,7 +258,7 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
letterSpacing: -2, letterSpacing: -2,
fontHeight: 0.5, fontHeight: 0.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.8, fontSize: SizeConfig.getWidthMultiplier() * 4,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
], ],
@ -281,11 +274,10 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
itemBuilder: (ctx, idx) { itemBuilder: (ctx, idx) {
final itm = otherTickets[idx]; final itm = otherTickets[idx];
return Padding( return Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(12),
child: Directionality( child: Directionality(
textDirection: callConfig.textDirection, textDirection: callConfig.textDirection,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
flex: 5, flex: 5,
@ -297,7 +289,7 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
letterSpacing: -1, letterSpacing: -1,
fontHeight: 0.5, fontHeight: 0.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.5, fontSize: SizeConfig.getWidthMultiplier() * 3.8,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
], ],
@ -306,35 +298,41 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
Container( Container(
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
width: 5, width: 5,
height: SizeConfig.getHeightMultiplier() * 2, height: SizeConfig.getHeightMultiplier() * 2.5,
margin: const EdgeInsets.symmetric(horizontal: 15), margin: const EdgeInsets.symmetric(horizontal: 15),
), ),
Expanded( Expanded(
flex: 5, flex: 5,
child: Row( child: SizedBox(
mainAxisAlignment: MainAxisAlignment.center, height: SizeConfig.getHeightMultiplier() * 3,
crossAxisAlignment: CrossAxisAlignment.center, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.center,
SizedBox( crossAxisAlignment: CrossAxisAlignment.center,
width: SizeConfig.getWidthMultiplier() * 3.5, children: [
child: itm.getCallType().icon(SizeConfig.getHeightMultiplier() * 2.5), Padding(
), padding: EdgeInsets.only(bottom: itm.getCallType() == CallType.doctor ? 8.0 : 0.0),
const SizedBox(width: 15), child: itm.getCallType().icon(
AppText( itm.getCallType() == CallType.vitalSign ? SizeConfig.getWidthMultiplier() * 3 : SizeConfig.getWidthMultiplier() * 3.5,
itm.getCallType().message(callConfig, isListView: true), fit: BoxFit.cover,
color: itm.getCallType().color(), ),
letterSpacing: -1, ),
fontSize: SizeConfig.getWidthMultiplier() * 3, const SizedBox(width: 15),
fontWeight: FontWeight.w600, AppText(
fontHeight: 0.5, itm.getCallType().message(callConfig, isListView: true),
), color: itm.getCallType().color(),
], letterSpacing: 0,
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
fontWeight: FontWeight.w600,
fontHeight: 1,
),
],
),
), ),
), ),
Container( Container(
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
width: 5, width: 5,
height: SizeConfig.getHeightMultiplier() * 2, height: SizeConfig.getHeightMultiplier() * 2.5,
margin: const EdgeInsets.symmetric(horizontal: 15), margin: const EdgeInsets.symmetric(horizontal: 15),
), ),
Expanded( Expanded(
@ -344,10 +342,9 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
children: [ children: [
AppText( AppText(
itm.roomNo, itm.roomNo,
// callConfig.textDirection == TextDirection.ltr ? "${callConfig.roomText}: ${itm.roomNo}" : " ${itm.roomNo} ${callConfig.roomText}: ",
color: itm.getCallType().color(), color: itm.getCallType().color(),
letterSpacing: -1.5, letterSpacing: 0,
fontSize: SizeConfig.getWidthMultiplier() * 3.3, fontSize: SizeConfig.getWidthMultiplier() * 3.8,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontHeight: 0.5, fontHeight: 0.5,
), ),

@ -8,9 +8,17 @@ class CallByVoice {
final String preVoice; final String preVoice;
final String ticketNo; final String ticketNo;
final String postVoice; final String postVoice;
final bool isMute;
final FlutterTts flutterTts; final FlutterTts flutterTts;
CallByVoice({this.lang = 'en', required this.ticketNo, required this.preVoice, required this.postVoice, required this.flutterTts}); CallByVoice({
this.lang = 'en',
required this.isMute,
required this.ticketNo,
required this.preVoice,
required this.postVoice,
required this.flutterTts,
});
double volume = 1.0; double volume = 1.0;
double pitch = 0.6; double pitch = 0.6;
@ -31,6 +39,9 @@ class CallByVoice {
String clinicName = ""; String clinicName = "";
String patientAlpha = ""; String patientAlpha = "";
String patientNumeric = ""; String patientNumeric = "";
if (isMute) {
volume = 0.0;
}
if (isClinicNameAdded) { if (isClinicNameAdded) {
var clinic = ticketNo.split(" "); var clinic = ticketNo.split(" ");
@ -54,13 +65,13 @@ class CallByVoice {
} }
} }
// Create Pre Voice Players // Create Pre Voice Players
if (postVoice != null && postVoice.isNotEmpty) { if (postVoice.isNotEmpty) {
log('lang $lang'); log('lang $lang');
flutterTts.setSpeechRate(0.45); flutterTts.setSpeechRate(0.45);
if (lang != "ar") { if (lang != "ar") {
await flutterTts.setLanguage(lang); await flutterTts.setLanguage(lang);
flutterTts.setPitch(0.9); flutterTts.setPitch(0.9);
flutterTts.setVolume(1.0); flutterTts.setVolume(volume);
isVoiceActualCompletedGlobally = true; isVoiceActualCompletedGlobally = true;
await flutterTts.awaitSpeakCompletion(true); await flutterTts.awaitSpeakCompletion(true);
await flutterTts.speak("$preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice"); await flutterTts.speak("$preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice");
@ -68,7 +79,7 @@ class CallByVoice {
} }
flutterTts.setPitch(1.1); flutterTts.setPitch(1.1);
flutterTts.setVolume(1.0); flutterTts.setVolume(volume);
await flutterTts.setLanguage(lang); await flutterTts.setLanguage(lang);
isVoiceActualCompletedGlobally = false; isVoiceActualCompletedGlobally = false;
await flutterTts.awaitSpeakCompletion(true); await flutterTts.awaitSpeakCompletion(true);
@ -76,7 +87,7 @@ class CallByVoice {
// await flutterTts.speak(preVoice + " .. " + clinicName + " .. " + patientAlpha + " .. " + patientNumeric + " .. " + postVoice); // await flutterTts.speak(preVoice + " .. " + clinicName + " .. " + patientAlpha + " .. " + patientNumeric + " .. " + postVoice);
await flutterTts.speak("$preVoice .. "); await flutterTts.speak("$preVoice .. ");
await flutterTts.setLanguage("en"); await flutterTts.setLanguage("en");
await flutterTts.speak("$clinicName .. $patientAlpha .. $patientNumeric .. "); await flutterTts.speak("${clinicName.isNotEmpty ? ".." : ""} $patientAlpha .. $patientNumeric .. ");
await flutterTts.setLanguage(lang); await flutterTts.setLanguage(lang);
isVoiceActualCompletedGlobally = true; isVoiceActualCompletedGlobally = true;
await flutterTts.speak(postVoice); await flutterTts.speak(postVoice);

@ -42,19 +42,26 @@ extension XCallType on CallType {
} }
} }
SvgPicture icon(double height) { SvgPicture icon(double height, {double? width, BoxFit fit = BoxFit.contain}) {
String iconPath = "";
if (this == CallType.vitalSign) { if (this == CallType.vitalSign) {
return SvgPicture.asset(AppGlobal.vitalSignIcon, height: height, color: color()); iconPath = AppGlobal.vitalSignIcon;
} else if (this == CallType.doctor) { } else if (this == CallType.doctor) {
return SvgPicture.asset(AppGlobal.doctorIcon, height: height, color: color()); iconPath = AppGlobal.doctorIcon;
} else if (this == CallType.procedure) { } else if (this == CallType.procedure) {
return SvgPicture.asset(AppGlobal.procedureIcon, height: height, color: color()); iconPath = AppGlobal.procedureIcon;
} else if (this == CallType.vaccination) { } else if (this == CallType.vaccination) {
return SvgPicture.asset(AppGlobal.vaccinationIcon, height: height, color: color()); iconPath = AppGlobal.vaccinationIcon;
} else if (this == CallType.nebulization) { } else if (this == CallType.nebulization) {
return SvgPicture.asset(AppGlobal.nebulizationIcon, height: height, color: color()); iconPath = AppGlobal.nebulizationIcon;
} }
return SvgPicture.asset("assets/images/wait.svg", height: height, color: color());
return SvgPicture.asset(
iconPath.isEmpty ? "assets/images/wait.svg" : iconPath,
height: height,
width: width,
fit: fit,
);
} }
String audio(String lang) { String audio(String lang) {

Loading…
Cancel
Save