# Conflicts:
#	lib/home/priority_calls_components.dart
master
Faiz Hashmi 8 months ago
commit 10ff8170a0

@ -27,6 +27,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
namespace = "com.example.queuing_system"
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
compileOptions { compileOptions {
@ -51,6 +52,7 @@ android {
targetSdkVersion 31 targetSdkVersion 31
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true
} }
buildTypes { buildTypes {
@ -68,4 +70,6 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
} }

@ -14,7 +14,7 @@
<application <application
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="queuing_system"> android:label="HMG Qline">
<receiver <receiver
android:name="BootReceiver" android:name="BootReceiver"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

@ -6,26 +6,35 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.2.0' classpath 'com.android.tools.build:gradle:8.7.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
allprojects { allprojects {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
} }
rootProject.buildDir = '../build' rootProject.buildDir = '../build'
subprojects { subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}" project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
tasks.register("clean", Delete) { tasks.register("clean", Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017 #Tue Nov 12 09:01:21 AST 2024
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-7.5-all.zip

@ -1,11 +1,26 @@
include ':app' pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
def localPropertiesFile = new File(rootProject.projectDir, "local.properties") includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
def properties = new Properties()
assert localPropertiesFile.exists() repositories {
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } google()
mavenCentral()
gradlePluginPortal()
}
}
def flutterSdkPath = properties.getProperty("flutter.sdk") plugins {
assert flutterSdkPath != null, "flutter.sdk not set in local.properties" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" id "com.android.application" version '8.7.0' apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}
include ":app"

@ -27,16 +27,14 @@ class MyHttpOverrides extends HttpOverrides {
class API { class API {
static getCallRequestInfoByClinicInfo(String deviceIp, static getCallRequestInfoByClinicInfo(String deviceIp,
{required Function(List<PatientTicketModel>, List<PatientTicketModel>, CallConfig callConfig) onSuccess, {required Function(List<PatientTicketModel>, List<PatientTicketModel>, CallConfig callConfig) onSuccess, required Function(dynamic) onFailure}) async {
required Function(dynamic) onFailure}) async {
final body = {"ipAdress": deviceIp, "apiKey": apiKey}; final body = {"ipAdress": deviceIp, "apiKey": apiKey};
bool isDevMode = false; bool isDevMode = false;
if (isDevMode) { if (isDevMode) {
final Map<String, dynamic> response = testPatientsData["data"] as Map<String, dynamic>; final Map<String, dynamic> response = testPatientsData["data"] as Map<String, dynamic>;
CallConfig callConfig = CallConfig.fromJson(response["callConfig"]); CallConfig callConfig = CallConfig.fromJson(response["callConfig"]);
var callPatients = var callPatients = (response["callPatients"] as List).map((j) => PatientTicketModel.fromJson(j)).toList().where((element) => element.callType != 0).toList();
(response["callPatients"] as List).map((j) => PatientTicketModel.fromJson(j)).toList().where((element) => element.callType != 0).toList();
var isQueuePatients = callPatients.where((element) => (element.isQueue == false && element.callType != 0)).toList(); var isQueuePatients = callPatients.where((element) => (element.isQueue == false && element.callType != 0)).toList();
log("callPatients: ${callPatients.toString()}"); log("callPatients: ${callPatients.toString()}");
log("isQueuePatients: ${isQueuePatients.toString()}"); log("isQueuePatients: ${isQueuePatients.toString()}");
@ -50,11 +48,7 @@ class API {
final response = apiResp["data"]; final response = apiResp["data"];
CallConfig callConfig = CallConfig.fromJson(response["callConfig"]); CallConfig callConfig = CallConfig.fromJson(response["callConfig"]);
var callPatients = (response["callPatients"] as List) var callPatients = (response["callPatients"] as List).map((j) => PatientTicketModel.fromJson(j)).toList().where((element) => element.callType != 0).toList();
.map((j) => PatientTicketModel.fromJson(j))
.toList()
.where((element) => element.callType != 0)
.toList();
var isQueuePatients = callPatients.where((element) => (element.isQueue == false && element.callType != 0)).toList(); var isQueuePatients = callPatients.where((element) => (element.isQueue == false && element.callType != 0)).toList();
callPatients.sort((a, b) => a.editedOnTimeStamp.compareTo(b.editedOnTimeStamp)); callPatients.sort((a, b) => a.editedOnTimeStamp.compareTo(b.editedOnTimeStamp));
@ -108,7 +102,10 @@ class API {
body: body, body: body,
onSuccess: (response, status) { onSuccess: (response, status) {
if (status == 200 && response["data"] != null) { if (status == 200 && response["data"] != null) {
widgetsConfigModel = (response["data"] as List).map((e) => WidgetsConfigModel.fromJson(e)).toList().first; List list = (response["data"] as List).map((e) => WidgetsConfigModel.fromJson(e)).toList();
if (list.isNotEmpty) {
widgetsConfigModel = list.first;
}
} }
}, },
onFailure: (error, status) => log("error: ${error.toString()}")); onFailure: (error, status) => log("error: ${error.toString()}"));

@ -10,7 +10,7 @@ class BaseAppClient {
static post(String endPoint, {Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async { static post(String endPoint, {Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async {
String url; String url;
url = "$BASE_URL/api/PatientCall" + endPoint; url = "$BASE_URL/api/PatientCall$endPoint";
// try { // try {
logger.i("URL : $url"); logger.i("URL : $url");
@ -20,13 +20,16 @@ class BaseAppClient {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
}); });
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
logger.i("statusCode : $statusCode");
if (statusCode < 200 || statusCode >= 400) { if (statusCode < 200 || statusCode >= 400) {
if (onFailure != null) { if (onFailure != null) {
onFailure(Utils.generateContactAdminMsg(), statusCode); onFailure(Utils.generateContactAdminMsg(), statusCode);
} }
} else { } else {
logger.i("Response: ${response.body.toString()}"); log("Response: ${response.body.toString()}");
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (onSuccess != null) { if (onSuccess != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -47,7 +50,7 @@ class BaseAppClient {
static get(String endPoint, {Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async { static get(String endPoint, {Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async {
String url; String url;
url = "$BASE_URL/api/PatientCall" + endPoint; url = "$BASE_URL/api/PatientCall$endPoint";
try { try {
// String token = await sharedPref.getString(TOKEN); // String token = await sharedPref.getString(TOKEN);
@ -83,11 +86,11 @@ class BaseAppClient {
//TODO change this fun //TODO change this fun
String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'];
if (parsed["ValidationErrors"] != null) { if (parsed["ValidationErrors"] != null) {
error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; error = "${parsed["ValidationErrors"]["StatusMessage"]}\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) {
error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; error = "${error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0]}\n";
} }
} }
} }

@ -4,9 +4,9 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; // const BASE_URL = 'https://ms.hmg.com/nscapi2'; // Development DB
const BASE_URL = 'https://ms.hmg.com/nscapi'; // UAT // const BASE_URL = 'https://ms.hmg.com/nscapi'; // UAT
// const BASE_URL = 'https://qline.hmg.com'; // LIVE const BASE_URL = 'https://qline.hmg.com'; // LIVE
const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT
// const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST'; // const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';

@ -9,6 +9,8 @@ class WidgetsConfigModel {
double? projectLongitude; double? projectLongitude;
int? cityKey; int? cityKey;
WidgetsConfigModel({ WidgetsConfigModel({
this.waitingAreaID, this.waitingAreaID,
this.waitingAreaName, this.waitingAreaName,

@ -37,7 +37,7 @@ class AppFooter extends StatelessWidget {
fontFamily: 'Poppins-Medium.ttf', fontFamily: 'Poppins-Medium.ttf',
), ),
), ),
Text(appProvider.currentDeviceIp, Text("v${appProvider.currentDeviceIp}",
style: TextStyle(fontWeight: FontWeight.w500, fontSize: SizeConfig.getWidthMultiplier() * 2.2)), style: TextStyle(fontWeight: FontWeight.w500, fontSize: SizeConfig.getWidthMultiplier() * 2.2)),
Row( Row(
children: [ children: [

@ -74,7 +74,7 @@ class AppHeader extends StatelessWidget implements PreferredSizeWidget {
return Consumer( return Consumer(
builder: (BuildContext context, AppProvider appProvider, Widget? child) { builder: (BuildContext context, AppProvider appProvider, Widget? child) {
return Container( return Container(
height: 100, height: 115,
padding: const EdgeInsets.only(left: 20, right: 20), padding: const EdgeInsets.only(left: 20, right: 20),
decoration: BoxDecoration(color: AppGlobal.vitalSignColor), decoration: BoxDecoration(color: AppGlobal.vitalSignColor),
child: Directionality( child: Directionality(

@ -2,7 +2,7 @@ import 'dart:async';
import 'dart:developer'; import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:connectivity/connectivity.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_tts/flutter_tts.dart'; import 'package:flutter_tts/flutter_tts.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -25,7 +25,18 @@ bool isVoiceActualCompletedGlobally = false;
class AppProvider extends ChangeNotifier { class AppProvider extends ChangeNotifier {
AppProvider() { AppProvider() {
callInitializations(); waitForIPAndCallInitializations();
}
Future<void> waitForIPAndCallInitializations() async {
while (currentDeviceIp == "") {
await getCurrentIP();
if (currentDeviceIp != "") {
await callInitializations();
} else {
await Future.delayed(const Duration(seconds: 2));
}
}
} }
Future<void> callInitializations() async { Future<void> callInitializations() async {
@ -87,7 +98,7 @@ class AppProvider extends ChangeNotifier {
); );
} }
logger.i("here logger.ig: ${isQueuePatients.length}"); logger.i("isQueuePatients: ${isQueuePatients.length}");
if (isQueuePatients.isEmpty) { if (isQueuePatients.isEmpty) {
isCallingInProgress = false; isCallingInProgress = false;
@ -198,7 +209,9 @@ class AppProvider extends ChangeNotifier {
Future<void> getPrayerDetailsFromServer() async { Future<void> getPrayerDetailsFromServer() async {
PrayersWidgetModel? prayersWidgetModel = await API.getPrayerDetailsFromServer( PrayersWidgetModel? prayersWidgetModel = await API.getPrayerDetailsFromServer(
latitude: currentWidgetsConfigModel!.projectLatitude ?? 0, longitude: currentWidgetsConfigModel!.projectLongitude ?? 0, onFailure: (error) => logger.i("Api call failed with this error: ${error.toString()}")); latitude: currentWidgetsConfigModel!.projectLatitude ?? 0,
longitude: currentWidgetsConfigModel!.projectLongitude ?? 0,
onFailure: (error) => logger.i("Api call failed with this error: ${error.toString()}"));
if (prayersWidgetModel != null) { if (prayersWidgetModel != null) {
currentPrayersWidgetModel = prayersWidgetModel; currentPrayersWidgetModel = prayersWidgetModel;
@ -224,13 +237,16 @@ class AppProvider extends ChangeNotifier {
// if (currentWidgetsConfigModel == null) return; // if (currentWidgetsConfigModel == null) return;
await getInfoWidgetsConfigurationsFromServer().whenComplete(() async { await getInfoWidgetsConfigurationsFromServer().whenComplete(() async {
if (currentWidgetsConfigModel!.isWeatherReq!) { if (currentWidgetsConfigModel == null) {
return;
}
if (currentWidgetsConfigModel!.isWeatherReq != null && currentWidgetsConfigModel!.isWeatherReq!) {
await getWeatherDetailsFromServer(); await getWeatherDetailsFromServer();
} }
if (currentWidgetsConfigModel!.isPrayerTimeReq!) { if (currentWidgetsConfigModel!.isPrayerTimeReq != null && currentWidgetsConfigModel!.isPrayerTimeReq!) {
await getPrayerDetailsFromServer(); await getPrayerDetailsFromServer();
} }
if (currentWidgetsConfigModel!.isRssFeedReq!) { if (currentWidgetsConfigModel!.isRssFeedReq != null && currentWidgetsConfigModel!.isRssFeedReq!) {
await getRssFeedDetailsFromServer(); await getRssFeedDetailsFromServer();
} }
}); });
@ -243,6 +259,9 @@ class AppProvider extends ChangeNotifier {
Future<void> getTheWidgetsConfigurationsEveryMidnight() async { Future<void> getTheWidgetsConfigurationsEveryMidnight() async {
if (currentWidgetsConfigModel == null) return; if (currentWidgetsConfigModel == null) return;
if (!(currentWidgetsConfigModel!.isWeatherReq ?? false) && !(currentWidgetsConfigModel!.isPrayerTimeReq ?? false) && !(currentWidgetsConfigModel!.isRssFeedReq ?? false)) {
return;
}
if (!currentWidgetsConfigModel!.isWeatherReq! && !currentWidgetsConfigModel!.isPrayerTimeReq! && !currentWidgetsConfigModel!.isRssFeedReq!) { if (!currentWidgetsConfigModel!.isWeatherReq! && !currentWidgetsConfigModel!.isPrayerTimeReq! && !currentWidgetsConfigModel!.isRssFeedReq!) {
return; return;
} }
@ -494,7 +513,13 @@ class AppProvider extends ChangeNotifier {
onDisconnect(exception) { onDisconnect(exception) {
logger.i("SignalR: onDisconnect"); logger.i("SignalR: onDisconnect");
signalRHelper.startSignalRConnection(currentDeviceIp, onUpdateAvailable: onPingReceived, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect,); signalRHelper.startSignalRConnection(
currentDeviceIp,
onUpdateAvailable: onPingReceived,
onConnect: onConnect,
onConnecting: onConnecting,
onDisconnect: onDisconnect,
);
} }
onConnecting() { onConnecting() {
@ -502,9 +527,10 @@ class AppProvider extends ChangeNotifier {
} }
listenNetworkConnectivity() async { listenNetworkConnectivity() async {
Connectivity().onConnectivityChanged.listen((event) async { Connectivity().onConnectivityChanged.listen((List<ConnectivityResult> event) async {
switch (event) { switch (event.first) {
case ConnectivityResult.wifi: case ConnectivityResult.wifi:
case ConnectivityResult.ethernet:
updateInternetConnection(true); updateInternetConnection(true);
await getCurrentIP(); await getCurrentIP();
if (signalRHelper.connection != null) { if (signalRHelper.connection != null) {
@ -517,6 +543,16 @@ class AppProvider extends ChangeNotifier {
break; break;
case ConnectivityResult.mobile: case ConnectivityResult.mobile:
break; break;
case ConnectivityResult.bluetooth:
// TODO: Handle this case.
break;
// TODO: Handle this case.
case ConnectivityResult.vpn:
// TODO: Handle this case.
break;
case ConnectivityResult.other:
// TODO: Handle this case.
break;
} }
}); });
} }

@ -26,7 +26,7 @@ class PriorityTickets extends StatelessWidget {
children: [ children: [
const SizedBox(height: 50), const SizedBox(height: 50),
TicketItem( TicketItem(
ticketNo: firstTicket.queueNo ?? '', ticketNo: firstTicket.queueNo,
callType: firstTicket.getCallType(), callType: firstTicket.getCallType(),
scale: 1.2, scale: 1.2,
blink: true, blink: true,
@ -43,7 +43,7 @@ class PriorityTickets extends StatelessWidget {
.map((ticket) => Padding( .map((ticket) => Padding(
padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 2), padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 2),
child: TicketItem( child: TicketItem(
ticketNo: ticket.queueNo ?? '', ticketNo: ticket.queueNo,
callType: ticket.getCallType(), callType: ticket.getCallType(),
scale: 0.8, scale: 0.8,
roomNo: ticket.roomNo, roomNo: ticket.roomNo,
@ -82,7 +82,7 @@ class TicketItem extends StatelessWidget {
String getFormattedTicket(String ticketNo, bool isClinicAdded) { String getFormattedTicket(String ticketNo, bool isClinicAdded) {
if (isClinicAdded) { if (isClinicAdded) {
var formattedString = ticketNo.split(" "); var formattedString = ticketNo.split(" ");
return formattedString[0] + " " + formattedString[1]; return "${formattedString[0]} ${formattedString[1]}";
} }
return ticketNo; return ticketNo;
} }
@ -94,19 +94,21 @@ class TicketItem extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
BlinkText(getFormattedTicket(ticketNo, isClinicAdded), BlinkText(
style: TextStyle( getFormattedTicket(ticketNo, isClinicAdded),
fontSize: SizeConfig.getWidthMultiplier() * 10, style: TextStyle(
letterSpacing: -1, fontSize: SizeConfig.getWidthMultiplier() * 10,
height: 0.5, letterSpacing: -1,
fontWeight: FontWeight.bold, height: 0.5,
), fontWeight: FontWeight.bold,
beginColor: Colors.black, ),
endColor: blink ? Colors.black.withOpacity(0.1) : Colors.black, beginColor: Colors.black,
// endColor: blink ? AppGlobal.appRedColor : Colors.black, endColor: blink ? Colors.black.withOpacity(0.1) : Colors.black,
times: 0, // endColor: blink ? AppGlobal.appRedColor : Colors.black,
duration: const Duration(seconds: 1)), times: 0,
const SizedBox(height: 13), duration: const Duration(seconds: 1),
),
const SizedBox(height: 25),
Directionality( Directionality(
textDirection: callConfig.textDirection, textDirection: callConfig.textDirection,
child: Row( child: Row(
@ -114,8 +116,8 @@ class TicketItem extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(bottom: callType == CallType.vitalSign ? 0 : 8), padding: EdgeInsets.only(bottom: callType == CallType.vitalSign ? 8 : 8),
child: callType.icon(SizeConfig.getHeightMultiplier() * 3), child: callType.icon(SizeConfig.getHeightMultiplier() * 2),
), ),
const SizedBox(width: 13), const SizedBox(width: 13),
AppText( AppText(
@ -188,7 +190,7 @@ Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, r
log("appProvider.currentScreenRotation: ${appProvider.currentScreenRotation}"); log("appProvider.currentScreenRotation: ${appProvider.currentScreenRotation}");
final List<Widget> children = [ final List<Widget> children = [
Expanded(flex: 7, child: PriorityTickets(callConfig: callConfig, tickets: priorityTickets)), Expanded(flex: 8, child: PriorityTickets(callConfig: callConfig, tickets: priorityTickets)),
Container(color: Colors.grey.withOpacity(0.1), width: 10, margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 50)), Container(color: Colors.grey.withOpacity(0.1), width: 10, margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 50)),
Expanded( Expanded(
flex: 6, flex: 6,

@ -6,7 +6,7 @@ import 'package:logger/logger.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:queuing_system/core/api.dart'; import 'package:queuing_system/core/api.dart';
import 'package:queuing_system/home/app_provider.dart'; import 'package:queuing_system/home/app_provider.dart';
import 'package:wakelock/wakelock.dart'; import 'package:wakelock_plus/wakelock_plus.dart';
import 'core/config/size_config.dart'; import 'core/config/size_config.dart';
import 'home/home_screen.dart'; import 'home/home_screen.dart';
@ -21,7 +21,7 @@ Logger logger = Logger(
void main() { void main() {
HttpOverrides.global = MyHttpOverrides(); HttpOverrides.global = MyHttpOverrides();
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
Wakelock.enable(); WakelockPlus.enable();
runApp(const MyApp()); runApp(const MyApp());
} }
@ -36,12 +36,8 @@ class MyApp extends StatelessWidget {
builder: (context, constraints) { builder: (context, constraints) {
return OrientationBuilder(builder: (context, orientation) { return OrientationBuilder(builder: (context, orientation) {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
SystemChrome.setPreferredOrientations([ SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
DeviceOrientation.portraitUp, SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
// DeviceOrientation.portraitDown,
// DeviceOrientation.landscapeLeft,
// DeviceOrientation.landscapeRight,
]);
return MultiProvider( return MultiProvider(
providers: [ providers: [
@ -49,7 +45,7 @@ class MyApp extends StatelessWidget {
], ],
child: MaterialApp( child: MaterialApp(
showSemanticsDebugger: false, showSemanticsDebugger: false,
title: 'Doctors App', title: 'Qline Appointments',
theme: ThemeData( theme: ThemeData(
primaryColor: Colors.grey, primaryColor: Colors.grey,
fontFamily: 'Poppins', fontFamily: 'Poppins',

@ -58,7 +58,7 @@ class CallByVoice {
flutterTts.setVolume(1.0); flutterTts.setVolume(1.0);
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");
return; return;
} }
@ -69,9 +69,9 @@ class CallByVoice {
await flutterTts.awaitSpeakCompletion(true); await flutterTts.awaitSpeakCompletion(true);
// 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 .. $patientAlpha .. $patientNumeric .. ");
await flutterTts.setLanguage(lang); await flutterTts.setLanguage(lang);
isVoiceActualCompletedGlobally = true; isVoiceActualCompletedGlobally = true;
await flutterTts.speak(postVoice); await flutterTts.speak(postVoice);

@ -34,14 +34,14 @@ class SignalRHelper {
required VoidCallback onConnecting, required VoidCallback onConnecting,
}) async { }) async {
logger.i("Connecting Signal R with: $deviceIp"); logger.i("Connecting Signal R with: $deviceIp");
final url = hubBaseURL + "?IPAddress=$deviceIp"; final url = "$hubBaseURL?IPAddress=$deviceIp";
// final url = hubBaseURL; // final url = hubBaseURL;
connection = HubConnectionBuilder() connection = HubConnectionBuilder()
.withUrl( .withUrl(
url, url,
HttpConnectionOptions( HttpConnectionOptions(
client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true),
// transport: HttpTransportType.webSockets, transport: HttpTransportType.webSockets,
logging: (level, message) => log(message), logging: (level, message) => log(message),
)) ))
.withAutomaticReconnect() .withAutomaticReconnect()
@ -55,7 +55,11 @@ class SignalRHelper {
connection!.on('addChatMessage', (message) => onUpdateAvailable(message)); connection!.on('addChatMessage', (message) => onUpdateAvailable(message));
await connection!.start(); try {
await connection!.start();
} catch (e) {
logger.i("Exception while connecting: ${e.toString()}");
}
} }
void sendMessage(List<dynamic> args) async { void sendMessage(List<dynamic> args) async {

@ -1,5 +1,6 @@
import 'package:connectivity/connectivity.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:queuing_system/core/config/size_config.dart'; import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/main.dart';
class Utils { class Utils {
static getHeight() { static getHeight() {
@ -16,12 +17,20 @@ class Utils {
} }
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); List<ConnectivityResult> connectivityResult = await (Connectivity().checkConnectivity());
if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { int indexEthernet = connectivityResult.indexWhere((element) => element == ConnectivityResult.ethernet);
if (indexEthernet != -1) {
return true;
}
int indexWifi = connectivityResult.indexWhere((element) => element == ConnectivityResult.wifi);
if (indexWifi != -1) {
return true; return true;
} else {
return false;
} }
return false;
} }
// static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); // static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor);
// //

@ -6,19 +6,21 @@ import FlutterMacOS
import Foundation import Foundation
import audio_session import audio_session
import connectivity_macos import connectivity_plus
import flutter_tts import flutter_tts
import just_audio import just_audio
import package_info_plus
import path_provider_foundation import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation
import wakelock_macos import wakelock_plus
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin")) FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin")) WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
} }

@ -33,22 +33,23 @@ dependencies:
# Base packages # Base packages
provider: ^6.0.1 provider: ^6.0.1
get_it: ^7.1.3 get_it: ^8.0.2
connectivity: ^3.0.6 connectivity_plus: ^6.1.0
# flutter_gifimage: ^1.0.1 # flutter_gifimage: ^1.0.1
flutter_svg: ^1.0.3 flutter_svg: ^2.0.14
http: ^0.13.0 http: ^1.2.2
blinking_text: ^1.0.2 blinking_text: ^1.0.2
just_audio: 0.9.31 just_audio: ^0.9.42
flutter_tts: 3.6.3 flutter_tts: ^4.1.0
# flutter_tts: ^4.0.2 # flutter_tts: ^4.0.2
wakelock: ^0.6.2 wakelock_plus: ^1.2.8
shared_preferences: ^2.2.1 shared_preferences: ^2.3.5
#signalr core #signalr core
signalr_core: ^1.1.1 signalr_core: ^1.1.1
intl: ^0.18.1 intl: ^0.19.0
marquee: ^2.2.3 marquee: ^2.2.3
logger: ^2.4.0 logger: ^2.4.0
win32: ^5.8.0
@ -61,7 +62,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint # package. See that file for information about deactivating specific lint
# rules and activating additional ones. # rules and activating additional ones.
flutter_lints: ^1.0.0 flutter_lints: ^5.0.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec

@ -6,9 +6,12 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <flutter_tts/flutter_tts_plugin.h> #include <flutter_tts/flutter_tts_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
FlutterTtsPluginRegisterWithRegistrar( FlutterTtsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterTtsPlugin")); registry->GetRegistrarForPlugin("FlutterTtsPlugin"));
} }

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
flutter_tts flutter_tts
) )

Loading…
Cancel
Save