diff --git a/lib/core/api.dart b/lib/core/api.dart index 2f7b525..c7a66fc 100644 --- a/lib/core/api.dart +++ b/lib/core/api.dart @@ -7,9 +7,9 @@ import 'package:queuing_system/core/response_models/call_config_model.dart'; import 'package:queuing_system/core/response_models/patient_ticket_model.dart'; import 'package:queuing_system/core/response_models/prayers_widget_model.dart'; import 'package:queuing_system/core/response_models/rss_feed_model.dart'; +import 'package:queuing_system/core/response_models/test_patients.dart'; import 'package:queuing_system/core/response_models/weathers_widget_model.dart'; import 'package:queuing_system/core/response_models/widgets_config_model.dart'; -import 'package:queuing_system/core/response_models/test_patients.dart'; const _getCallRequestInfoByClinicInfo = "/GetCallRequestInfo_ByIP"; const _callUpdateNotIsQueueRecordByIDAsync = "/CallRequest_QueueUpdate"; @@ -27,14 +27,16 @@ class MyHttpOverrides extends HttpOverrides { class API { static getCallRequestInfoByClinicInfo(String deviceIp, - {required Function(List, List, CallConfig callConfig) onSuccess, required Function(dynamic) onFailure}) async { + {required Function(List, List, CallConfig callConfig) onSuccess, + required Function(dynamic) onFailure}) async { final body = {"ipAdress": deviceIp, "apiKey": apiKey}; bool isDevMode = false; if (isDevMode) { final Map response = testPatientsData["data"] as Map; CallConfig callConfig = CallConfig.fromJson(response["callConfig"]); - var callPatients = (response["callPatients"] as List).map((j) => PatientTicketModel.fromJson(j)).toList().where((element) => element.callType != 0).toList(); + var callPatients = + (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(); log("callPatients: ${callPatients.toString()}"); log("isQueuePatients: ${isQueuePatients.toString()}"); @@ -48,15 +50,20 @@ class API { final response = apiResp["data"]; CallConfig callConfig = CallConfig.fromJson(response["callConfig"]); - var callPatients = (response["callPatients"] as List).map((j) => PatientTicketModel.fromJson(j)).toList().where((element) => element.callType != 0).toList(); + var callPatients = (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(); callPatients.sort((a, b) => a.editedOnTimeStamp.compareTo(b.editedOnTimeStamp)); isQueuePatients.sort((a, b) => a.editedOnTimeStamp.compareTo(b.editedOnTimeStamp)); - - log("callPatients: ${callPatients.toList().toString()}"); + callPatients.removeWhere((element) => element.isQueue == false); + callPatients.addAll(isQueuePatients); + log("callPatients: ${callPatients.reversed.toList().toString()}"); log("isQueuePatients: ${isQueuePatients.reversed.toList().toString()}"); - onSuccess(callPatients.toList(), isQueuePatients.reversed.toList(), callConfig); + onSuccess(callPatients.reversed.toList(), isQueuePatients.reversed.toList(), callConfig); } else { onFailure(apiResp); } diff --git a/lib/home/app_provider.dart b/lib/home/app_provider.dart index efe3a5b..6250047 100644 --- a/lib/home/app_provider.dart +++ b/lib/home/app_provider.dart @@ -421,7 +421,7 @@ class AppProvider extends ChangeNotifier { // for (int i = 0; i < length; i++) { await Future.delayed(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec)).whenComplete(() async { PatientTicketModel temp = PatientTicketModel(); - if (patientTickets.isNotEmpty) { + if (patientTickets.isNotEmpty && isQueuePatients.length > 1) { temp = patientTickets.elementAt(0); patientTickets.removeAt(0); } @@ -429,17 +429,21 @@ class AppProvider extends ChangeNotifier { if (isQueuePatients.isNotEmpty) { isQueuePatients.removeAt(0); } - patientTickets.add(temp); + if (patientTickets.isNotEmpty && isQueuePatients.length > 1) { + patientTickets.add(temp); + } notifyListeners(); await voiceCallPatientTicket(patientTickets.first, "setCompletionHandler"); updatePatientTicket(patientTickets.first); }); // } } - isCallingInProgress = false; - log("Setting isCallingInProgress : $isCallingInProgress"); - if (isApiCallNeeded) { + //[OBG M-29, OBG W-E-8, OBG W-I-10, OBG U-33, OBG H-25, OBG H-29, OBG M-37, OBG H-31, OBG H-27, OBG W-P-1, OBG P-25, OBG E-13, OBG P-23, OBG U-21, OBG M-25, OBG W-J-3, OBG V-25, OBG W-D-5, OBG W-G-3, OBG L-63, OBG W-L-2, OBG H-5, OBG G-17, OBG S-19, OBG S-17, OBG S-21, OBG C-39, OBG J-19, OBG G-19, OBG G-15, OBG W-N-9, OBG N-39, OBG H-21, OBG C-37, OBG W-J-1, OBG W-T-2] + + if (isApiCallNeeded && isQueuePatients.isEmpty) { + isCallingInProgress = false; + log("Setting isCallingInProgress : $isCallingInProgress"); Timer(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec), () async { await callPatientsAPI(); isApiCallNeeded = false; diff --git a/lib/home/priority_calls_components.dart b/lib/home/priority_calls_components.dart index fc177e1..008be96 100644 --- a/lib/home/priority_calls_components.dart +++ b/lib/home/priority_calls_components.dart @@ -203,7 +203,7 @@ Widget priorityTicketsWithSideList({required List tickets, r mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Expanded( - flex: 3, + flex: 5, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -279,7 +279,7 @@ Widget priorityTicketsWithSideList({required List tickets, r crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( - flex: 3, + flex: 5, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -288,7 +288,7 @@ Widget priorityTicketsWithSideList({required List tickets, r letterSpacing: -1, fontHeight: 0.5, fontWeight: FontWeight.bold, - fontSize: SizeConfig.getWidthMultiplier() * 4, + fontSize: SizeConfig.getWidthMultiplier() * 3.5, textAlign: TextAlign.center, ), ], @@ -337,7 +337,8 @@ Widget priorityTicketsWithSideList({required List tickets, r mainAxisAlignment: MainAxisAlignment.center, children: [ AppText( - itm.roomNo, // callConfig.textDirection == TextDirection.ltr ? "${callConfig.roomText}: ${itm.roomNo}" : " ${itm.roomNo} ${callConfig.roomText}: ", + itm.roomNo, + // callConfig.textDirection == TextDirection.ltr ? "${callConfig.roomText}: ${itm.roomNo}" : " ${itm.roomNo} ${callConfig.roomText}: ", color: itm.getCallType().color(), letterSpacing: -1.5, fontSize: SizeConfig.getWidthMultiplier() * 3.3, @@ -357,7 +358,8 @@ Widget priorityTicketsWithSideList({required List tickets, r ), ) ]; - return (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown) + return (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || + appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown) ? Row(children: children) : Column(children: children); } diff --git a/macos/Podfile b/macos/Podfile index dade8df..049abe2 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 6b9af40..2e16606 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -203,7 +203,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -256,6 +256,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -404,7 +405,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -483,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -530,7 +531,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 1047bb5..a659ddf 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@