send the release v9.1

qlline_design_update
Faiz Hashmi 4 months ago
parent a6df0764fb
commit 1247b70b04

@ -167,7 +167,7 @@ class AppConstants {
static String apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; static String apiKey = 'EE17D21C7943485D9780223CCE55DCE5';
static String testIP = '12.4.5.1'; // projectID.QlineType.ScreenType.AnyNumber (1 to 10) static String testIP = '12.4.5.1'; // projectID.QlineType.ScreenType.AnyNumber (1 to 10)
static int thresholdForListUI = 5; static int thresholdForListUI = 5;
static double currentBuildVersion = 8.9; static double currentBuildVersion = 9.1;
static double clearLogsHoursThreshold = 48; static double clearLogsHoursThreshold = 48;
} }

@ -13,14 +13,12 @@ import 'package:wakelock_plus/wakelock_plus.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
try { try {
await AppDependencies.addDependencies(); await AppDependencies.addDependencies();
await WakelockPlus.enable(); await WakelockPlus.enable();
} catch (e) { } catch (e) {
log('Initialization error: $e'); log('Initialization error: $e');
} }
runApp(const MyApp()); runApp(const MyApp());
} }

@ -203,9 +203,8 @@ class GlobalConfigurationsModel {
screenLanguageText = json['screenLanguageText']; screenLanguageText = json['screenLanguageText'];
// textDirection = json['textDirection'] == 2 ? TextDirection.rtl : TextDirection.ltr; // textDirection = json['textDirection'] == 2 ? TextDirection.rtl : TextDirection.ltr;
textDirection = TextDirection.rtl; textDirection = TextDirection.rtl;
// screenMaxDisplayPatients = json['screenMaxDisplayPatients'] ?? 16; screenMaxDisplayPatients = json['screenMaxDisplayPatients'] ?? 16;
// TODO: Uncomment this screenMaxDisplayPatients // screenMaxDisplayPatients = 15;
screenMaxDisplayPatients = 15;
voiceLanguageEnum = (json['voiceLanguage'] as int).toLanguageEnum(); voiceLanguageEnum = (json['voiceLanguage'] as int).toLanguageEnum();
voiceLanguageText = json['voiceLanguageText']; voiceLanguageText = json['voiceLanguageText'];
isNotiReq = json['isNotiReq']; isNotiReq = json['isNotiReq'];

@ -15,7 +15,7 @@ abstract class TextToSpeechService {
bool isMute = false, bool isMute = false,
}); });
Future<void> speechTextTest(TicketData ticket); // Future<void> speechTextTest(TicketData ticket);
void listenToTextToSpeechEvents({required Function() onVoiceCompleted}); void listenToTextToSpeechEvents({required Function() onVoiceCompleted});
} }
@ -31,119 +31,120 @@ class TextToSpeechServiceImp implements TextToSpeechService {
Map<String, String> arabicVoice = {"name": "ar-xa-x-ard-local", "locale": "ar"}; Map<String, String> arabicVoice = {"name": "ar-xa-x-ard-local", "locale": "ar"};
@override @override
Future<void> speechTextTest(TicketData ticket) async { // Future<void> speechTextTest(TicketData ticket) async {
const ttsGoogleEngine = 'com.google.android.tts'; // const ttsGoogleEngine = 'com.google.android.tts';
LanguageEnum langEnum = ticket.voiceLanguageEnum; // LanguageEnum langEnum = ticket.voiceLanguageEnum;
List engines = await textToSpeechInstance.getEngines; // List engines = await textToSpeechInstance.getEngines;
if (engines.contains(ttsGoogleEngine)) { // if (engines.contains(ttsGoogleEngine)) {
await textToSpeechInstance.setEngine(ttsGoogleEngine); // await textToSpeechInstance.setEngine(ttsGoogleEngine);
} // }
textToSpeechInstance.setVolume(1.0); //
// textToSpeechInstance.setVolume(1.0);
// final voices = await textToSpeechInstance.getVoices; //
// log ("voices:: $voices"); // // final voices = await textToSpeechInstance.getVoices;
// // log ("voices:: $voices");
await textToSpeechInstance.setVoice(arabicVoice); //
// await textToSpeechInstance.setVoice(arabicVoice);
if (langEnum == LanguageEnum.arabic) { //
try { // if (langEnum == LanguageEnum.arabic) {
await textToSpeechInstance.setLanguage(LanguageEnum.arabic.enumToString()); // try {
} catch (e) { // await textToSpeechInstance.setLanguage(LanguageEnum.arabic.enumToString());
log("error setting language english: ${e.toString()}"); // } catch (e) {
} // log("error setting language english: ${e.toString()}");
} else if (langEnum == LanguageEnum.english) { // }
try { // } else if (langEnum == LanguageEnum.english) {
await textToSpeechInstance.setLanguage(LanguageEnum.english.enumToString()); // try {
} catch (e) { // await textToSpeechInstance.setLanguage(LanguageEnum.english.enumToString());
log("error setting language english: ${e.toString()}"); // } catch (e) {
} // log("error setting language english: ${e.toString()}");
} // }
String preVoice = ticket.ticketNoText; // }
String postVoice = ticket.postVoiceText; // String preVoice = ticket.ticketNoText;
if (preVoice.isNotEmpty) { // String postVoice = ticket.postVoiceText;
preVoice = '$preVoice..'; // if (preVoice.isNotEmpty) {
} // preVoice = '$preVoice..';
String ticketNo = ticket.queueNo!.trim().toString(); // }
// String ticketNo = ticket.queueNo!.trim().toString();
log("areLanguagesInstalled: ${await textToSpeechInstance.areLanguagesInstalled(["en", "ar"])}"); //
// log("areLanguagesInstalled: ${await textToSpeechInstance.areLanguagesInstalled(["en", "ar"])}");
log("lang: $langEnum"); //
log("preVoice: $preVoice"); // log("lang: $langEnum");
log("postVoice: $postVoice"); // log("preVoice: $preVoice");
log("ticketNo: $ticketNo"); // log("postVoice: $postVoice");
// log("ticketNo: $ticketNo");
String patientAlpha = ""; //
String patientNumeric = ""; // String patientAlpha = "";
String clinicName = ""; // String patientNumeric = "";
// String clinicName = "";
bool isClinicNameAdded = (ticket.queueNo != ticket.callNoStr); //
// bool isClinicNameAdded = (ticket.queueNo != ticket.callNoStr);
if (isClinicNameAdded) { //
var queueNo = ""; // if (isClinicNameAdded) {
var clinic = ticketNo.split(" "); // var queueNo = "";
if (clinic.length > 1) { // var clinic = ticketNo.split(" ");
clinicName = clinic[0]; // if (clinic.length > 1) {
queueNo = clinic[1]; // clinicName = clinic[0];
} else { // queueNo = clinic[1];
queueNo = ticketNo; // } else {
} // queueNo = ticketNo;
// }
var queueNoArray = queueNo.split("-"); //
if (queueNoArray.length > 2) { // var queueNoArray = queueNo.split("-");
patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}"; // if (queueNoArray.length > 2) {
patientNumeric = queueNoArray[2]; // patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}";
} else { // patientNumeric = queueNoArray[2];
patientAlpha = queueNoArray[0]; // } else {
patientNumeric = queueNoArray[1]; // patientAlpha = queueNoArray[0];
} // patientNumeric = queueNoArray[1];
} else { // }
var queueNoArray = ticketNo.split("-"); // } else {
if (queueNoArray.length > 2) { // var queueNoArray = ticketNo.split("-");
patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}"; // if (queueNoArray.length > 2) {
patientNumeric = queueNoArray[2]; // patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}";
} else { // patientNumeric = queueNoArray[2];
patientAlpha = queueNoArray[0]; // } else {
patientNumeric = queueNoArray[1]; // patientAlpha = queueNoArray[0];
} // patientNumeric = queueNoArray[1];
} // }
// }
patientAlpha = patientAlpha.split('').join(' .. '); //
String roomNo = ""; // patientAlpha = patientAlpha.split('').join(' .. ');
// String roomNo = "";
log("I will now all this:{ $preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice $roomNo } "); //
// log("I will now all this:{ $preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice $roomNo } ");
if (langEnum == LanguageEnum.english) { //
await textToSpeechInstance.speak("$preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice $roomNo"); // if (langEnum == LanguageEnum.english) {
return; // await textToSpeechInstance.speak("$preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice $roomNo");
} // return;
// }
if (isNeedToBreakVoiceForArabic) { //
await textToSpeechInstance.awaitSpeakCompletion(true); // if (isNeedToBreakVoiceForArabic) {
// await textToSpeechInstance.awaitSpeakCompletion(true);
isSpeechCompleted = false; //
if (preVoice.isNotEmpty) { // isSpeechCompleted = false;
await textToSpeechInstance.speak("$preVoice "); // if (preVoice.isNotEmpty) {
} // await textToSpeechInstance.speak("$preVoice ");
try { // }
await textToSpeechInstance.setLanguage(LanguageEnum.english.enumToString()); // try {
} catch (e) { // await textToSpeechInstance.setLanguage(LanguageEnum.english.enumToString());
log("error setting language english: ${e.toString()}"); // } catch (e) {
} // log("error setting language english: ${e.toString()}");
await textToSpeechInstance.speak("$patientAlpha .. $patientNumeric"); // }
// await textToSpeechInstance.speak("$patientAlpha .. $patientNumeric");
try { //
await textToSpeechInstance.setLanguage(langEnum.enumToString()); // try {
} catch (e) { // await textToSpeechInstance.setLanguage(langEnum.enumToString());
log("error setting language langEnum: ${e.toString()}"); // } catch (e) {
} // log("error setting language langEnum: ${e.toString()}");
// }
await textToSpeechInstance.speak("$postVoice $roomNo").whenComplete(() { //
isSpeechCompleted = true; // await textToSpeechInstance.speak("$postVoice $roomNo").whenComplete(() {
}); // isSpeechCompleted = true;
} else { // });
await textToSpeechInstance.speak("$preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice $roomNo"); // } else {
} // await textToSpeechInstance.speak("$preVoice .. $clinicName .. $patientAlpha .. $patientNumeric .. $postVoice $roomNo");
} // }
// }
@override @override
Future<void> speechText({ Future<void> speechText({
@ -151,7 +152,7 @@ class TextToSpeechServiceImp implements TextToSpeechService {
required GlobalConfigurationsModel globalConfigurationsModel, required GlobalConfigurationsModel globalConfigurationsModel,
bool isMute = false, bool isMute = false,
}) async { }) async {
log("ticketdata i got: ${ticket.ticketModel.toString()}"); log("ticket data i got: ${ticket.ticketModel.toString()}");
const ttsGoogleEngine = 'com.google.android.tts'; const ttsGoogleEngine = 'com.google.android.tts';
LanguageEnum langEnum = ticket.ticketModel!.voiceLanguageEnum; LanguageEnum langEnum = ticket.ticketModel!.voiceLanguageEnum;
List engines = await textToSpeechInstance.getEngines; List engines = await textToSpeechInstance.getEngines;
@ -159,6 +160,7 @@ class TextToSpeechServiceImp implements TextToSpeechService {
await textToSpeechInstance.setEngine(ttsGoogleEngine); await textToSpeechInstance.setEngine(ttsGoogleEngine);
} }
log("engines: $engines");
await textToSpeechInstance.setVoice(arabicVoice); await textToSpeechInstance.setVoice(arabicVoice);
if (isMute) { if (isMute) {
@ -166,6 +168,8 @@ class TextToSpeechServiceImp implements TextToSpeechService {
} else { } else {
textToSpeechInstance.setVolume(1.0); textToSpeechInstance.setVolume(1.0);
} }
textToSpeechInstance.setSpeechRate(0.4);
if (langEnum == LanguageEnum.arabic) { if (langEnum == LanguageEnum.arabic) {
try { try {
await textToSpeechInstance.setLanguage(LanguageEnum.arabic.enumToString()); await textToSpeechInstance.setLanguage(LanguageEnum.arabic.enumToString());

@ -191,10 +191,6 @@ class QueuingViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
Future<void> testSpeech() async {
textToSpeechService.speechTextTest(MockJsonRepo.ticket);
}
Future<void> callTicketOnScreen({required TicketData? ticketData}) async { Future<void> callTicketOnScreen({required TicketData? ticketData}) async {
if (ticketData == null) return; if (ticketData == null) return;
ScreenConfigViewModel screenConfigViewModel = getIt.get<ScreenConfigViewModel>(); ScreenConfigViewModel screenConfigViewModel = getIt.get<ScreenConfigViewModel>();

@ -45,7 +45,7 @@ class ScreenConfigViewModel extends ChangeNotifier {
await getLastTimeUpdatedFromCache(); await getLastTimeUpdatedFromCache();
await getLastTimeLogsClearedFromCache(); await getLastTimeLogsClearedFromCache();
listenNetworkConnectivity(); listenNetworkConnectivity();
getTheWidgetsConfigurationsEveryMidnight(); initializeTimer();
} }
Future<void> onAppResumed() async { Future<void> onAppResumed() async {
@ -304,7 +304,7 @@ class ScreenConfigViewModel extends ChangeNotifier {
DateTime lastChecked = DateTime.now(); DateTime lastChecked = DateTime.now();
Timer? _midnightTimer; Timer? _midnightTimer;
Future<void> getTheWidgetsConfigurationsEveryMidnight() async { Future<void> initializeTimer() async {
// Cancel any existing timer to avoid multiple timers running // Cancel any existing timer to avoid multiple timers running
_midnightTimer?.cancel(); _midnightTimer?.cancel();
@ -317,40 +317,46 @@ class ScreenConfigViewModel extends ChangeNotifier {
return; return;
} }
_midnightTimer = Timer.periodic(const Duration(minutes: 10), (timer) async { _midnightTimer = Timer.periodic(
counter++; const Duration(minutes: 10),
DateTime now = DateTime.now(); (timer) async {
log("counterValue: $counter"); counter++;
DateTime now = DateTime.now();
log("counterValue: $counter");
// Every Two hour, update RSS feed if required if (globalConfigurationsModel.id == null) {
if (counter % 12 == 0 && globalConfigurationsModel.isRssFeedReq) { await getGlobalConfigurationsByIP();
await getRssFeedDetailsFromServer(); }
}
log("lastChecked: [${lastChecked.day}]"); // Every Two hour, update RSS feed if required
log("now: [${now.day}]"); if (counter % 12 == 0 && globalConfigurationsModel.isRssFeedReq) {
await getRssFeedDetailsFromServer();
// At midnight, update weather and prayer details if required
if (now.day != lastChecked.day) {
if (now.difference(now.copyWith(hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0)).inMinutes >= 5) {
await nativeMethodChannelService.smartRestart(forceRestart: true, cleanupFirst: true);
// if (globalConfigurationsModel.isRssFeedReq) {
// await getRssFeedDetailsFromServer();
// }
// if (globalConfigurationsModel.isWeatherReq) {
// await getWeatherDetailsFromServer();
// }
// if (globalConfigurationsModel.isPrayerTimeReq) {
// await getPrayerDetailsFromServer();
// }
lastChecked = now;
} }
}
getNextPrayerToShow(); log("lastChecked: [${lastChecked.day}]");
syncHubConnectionState(); log("now: [${now.day}]");
});
// At midnight, update weather and prayer details if required
if (now.day != lastChecked.day) {
if (now.difference(now.copyWith(hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0)).inMinutes >= 5) {
await nativeMethodChannelService.smartRestart(forceRestart: true, cleanupFirst: true);
// if (globalConfigurationsModel.isRssFeedReq) {
// await getRssFeedDetailsFromServer();
// }
// if (globalConfigurationsModel.isWeatherReq) {
// await getWeatherDetailsFromServer();
// }
// if (globalConfigurationsModel.isPrayerTimeReq) {
// await getPrayerDetailsFromServer();
// }
lastChecked = now;
}
}
getNextPrayerToShow();
syncHubConnectionState();
},
);
} }
@override @override

@ -308,23 +308,20 @@ class _AppFooterState extends State<AppFooter> {
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier()! * 0.1), padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier()! * 0.1),
child: Column( child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
mainAxisAlignment: MainAxisAlignment.center, AppText(
children: [ AppStrings.poweredBy,
AppText( fontSize: SizeConfig.getWidthMultiplier()! * 1.5,
AppStrings.poweredBy, fontWeight: FontWeight.w400,
fontSize: SizeConfig.getWidthMultiplier()! * 1.5, color: AppColors.darkGreyTextColor,
fontWeight: FontWeight.w400, ),
color: AppColors.darkGreyTextColor, AppText(
), "v${screenConfigVM.currentScreenIP.replaceAll(".", "-")}(${AppConstants.currentBuildVersion})",
AppText( fontSize: SizeConfig.getWidthMultiplier()! * 1,
"v${screenConfigVM.currentScreenIP.replaceAll(".", "").replaceAll("0", "-")}(${AppConstants.currentBuildVersion})", fontWeight: FontWeight.w400,
fontSize: SizeConfig.getWidthMultiplier()! * 1, color: AppColors.darkGreyTextColor,
fontWeight: FontWeight.w400, ),
color: AppColors.darkGreyTextColor, ]),
),
],
),
), ),
SizedBox(width: SizeConfig.getWidthMultiplier()!), SizedBox(width: SizeConfig.getWidthMultiplier()!),
Padding( Padding(

@ -167,11 +167,12 @@ class _MainQueueScreenState extends State<MainQueueScreen> {
// ) // )
// ], // ],
Expanded( Expanded(
flex: 10, flex: 10,
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: SizeConfig.getWidthMultiplier()! * 4), padding: EdgeInsets.symmetric(horizontal: SizeConfig.getWidthMultiplier()! * 4),
child: dataContent(context: context), child: dataContent(context: context),
)), ),
),
], ],
); );
}, },

Loading…
Cancel
Save