Pushing after Testing on Panel

dev_faiz
Faiz Hashmi 3 years ago
parent 7e82746ce3
commit 54f6c7c185

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>9.0</string> <string>11.0</string>
</dict> </dict>
</plist> </plist>

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '9.0' # platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'

@ -1,29 +1,47 @@
PODS: PODS:
- audio_session (0.0.1):
- Flutter
- connectivity (0.0.1): - connectivity (0.0.1):
- Flutter - Flutter
- Reachability - Reachability
- Flutter (1.0.0) - Flutter (1.0.0)
- just_audio (0.0.1):
- Flutter
- path_provider_ios (0.0.1):
- Flutter
- Reachability (3.2) - Reachability (3.2)
DEPENDENCIES: DEPENDENCIES:
- audio_session (from `.symlinks/plugins/audio_session/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`) - connectivity (from `.symlinks/plugins/connectivity/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- Reachability - Reachability
EXTERNAL SOURCES: EXTERNAL SOURCES:
audio_session:
:path: ".symlinks/plugins/audio_session/ios"
connectivity: connectivity:
:path: ".symlinks/plugins/connectivity/ios" :path: ".symlinks/plugins/connectivity/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
COCOAPODS: 1.11.2 COCOAPODS: 1.11.3

@ -340,7 +340,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -418,7 +418,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -467,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;

@ -43,5 +43,7 @@
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<true/> <true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict> </dict>
</plist> </plist>

@ -1,47 +1,57 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:queuing_system/core/base/base_app_client.dart'; import 'package:queuing_system/core/base/base_app_client.dart';
import 'package:queuing_system/core/response_model/patient_call.dart'; import 'package:queuing_system/core/response_model/patient_call.dart';
const _getCallRequestInfoByClinicInfo = "/GetCallRequestInfoByClinincInfo"; const _getCallRequestInfoByClinicInfo = "/GetCallRequestInfoByClinincInfo";
const _call_UpdateNotIsQueueRecordByIDAsync = "/Call_UpdateNotIsQueueRecordByIDAsync"; const _call_UpdateNotIsQueueRecordByIDAsync = "/Call_UpdateNotIsQueueRecordByID";
class API { class API {
static GetCallRequestInfoByClinincInfo(String deviceIp, {@required Function(List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async {
static GetCallRequestInfoByClinincInfo(String deviceIp, {@required Function(List<Tickets>, List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async{
final body = {"IPAdress": deviceIp}; final body = {"IPAdress": deviceIp};
BaseAppClient.post(_getCallRequestInfoByClinicInfo, body: body, onSuccess: (response, status){ BaseAppClient.post(_getCallRequestInfoByClinicInfo,
body: body,
onSuccess: (response, status) {
if (status == 200) { if (status == 200) {
final calledByNurse = (response["CalledByNurse"] as List).map((j) => Tickets.fromJson(j)).toList(); var calledByNurse = (response["CalledByNurse"] as List).map((j) => Tickets.fromJson(j)).toList();
final clinicCurrentPatient = (response["ClinicCurrentPatient"] as List).map((j) => Tickets.fromJson(j)).toList(); final patients = (response["ClinicCurrentPatient"] as List).map((j) => Tickets.fromJson(j)).toList();
onSuccess(calledByNurse, clinicCurrentPatient); calledByNurse.addAll(patients);
calledByNurse.sort((a, b) => a.callNo.compareTo(b.callNo));
// final clinicCurrentPatient = (response["ClinicCurrentPatient"] as List).map((j) => Tickets.fromJson(j)).toList();
onSuccess(calledByNurse);
} else { } else {
onFailure(response); onFailure(response);
} }
}, onFailure: (error, status) => onFailure(error)); },
} onFailure: (error, status) => onFailure(error));
}
// static Call_UpdateNotIsQueueRecordByIDAsync(String deviceIp, {@required List<Tickets> tickets, @required Function(List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async{
// if(tickets.isEmpty) { static Call_UpdateNotIsQueueRecordByIDAsync(String deviceIp, {@required List<Tickets> tickets, @required Function(List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async {
// return; if (tickets.isEmpty) {
// } return;
// }
// List<Tickets> _ticketsUpdated = [];
// List<Tickets> _ticketsUpdated = [];
// for (var ticket in tickets) {
// final body = { "CallID" : ticket.callNo}; for (var ticket in tickets) {
// await BaseAppClient.post(_call_UpdateNotIsQueueRecordByIDAsync, body: body, onSuccess: (response, status){ final body = {"CallID": ticket.callNo};
// if(status == 200){ await BaseAppClient.post(_call_UpdateNotIsQueueRecordByIDAsync,
// ticket.call_updated = true; body: body,
// _ticketsUpdated.add(ticket); onSuccess: (response, status) {
// } print("response: $response");
// }, onFailure: (error, status) => onFailure(error)); if (status == 200) {
// } ticket.call_updated = true;
// _ticketsUpdated.add(ticket);
// if(_ticketsUpdated.isNotEmpty) { }
// onSuccess(_ticketsUpdated); },
// }else{ onFailure: (error, status) => onFailure(error));
// onFailure(false); }
// }
// } if (_ticketsUpdated.isNotEmpty) {
onSuccess(_ticketsUpdated);
} else {
onFailure(false);
}
}
} }

@ -4,6 +4,7 @@ import 'package:connectivity/connectivity.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:queuing_system/core/api.dart'; import 'package:queuing_system/core/api.dart';
import 'package:queuing_system/core/base/app_scaffold_widget.dart'; import 'package:queuing_system/core/base/app_scaffold_widget.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_model/patient_call.dart'; import 'package:queuing_system/core/response_model/patient_call.dart';
import 'package:queuing_system/header/app_header.dart'; import 'package:queuing_system/header/app_header.dart';
@ -15,6 +16,9 @@ import 'package:queuing_system/utils/utils.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
var DEVICE_IP = "10.10.14.11"; // Testing IP var DEVICE_IP = "10.10.14.11"; // Testing IP
// var DEVICE_IP = "10.10.14.11"; // Testing IP
// var DEVICE_IP = "10.10.15.11";
// var DEVICE_IP = "10.70.249.21"; // (Make sure by Haroon before use it) Production IP // var DEVICE_IP = "10.70.249.21"; // (Make sure by Haroon before use it) Production IP
class MyHomePage extends StatefulWidget { class MyHomePage extends StatefulWidget {
@ -30,31 +34,25 @@ class _MyHomePageState extends State<MyHomePage> {
List<Tickets> waitings = []; List<Tickets> waitings = [];
List<Tickets> currents = []; List<Tickets> currents = [];
bool isLoading = false;
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
} }
@override @override
void initState() { void initState() {
listenNetworkConnectivity(); listenNetworkConnectivity();
if (!signalRHelper.getConnectionState()) { if (!signalRHelper.getConnectionState()) {
signalRHelper.startSignalRConnection( signalRHelper.startSignalRConnection(DEVICE_IP, onUpdateAvailable: onUpdateAvailable, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect);
DEVICE_IP,
onUpdateAvailable: onUpdateAvailable,
onConnect: onConnect,
onConnecting: onConnecting,
onDisconnect: onDisconnect
);
} }
super.initState(); super.initState();
} }
TextEditingController controller = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -66,6 +64,9 @@ class _MyHomePageState extends State<MyHomePage> {
width: double.infinity, width: double.infinity,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
const SizedBox(width: 20), const SizedBox(width: 20),
AppText( AppText(
@ -78,13 +79,56 @@ class _MyHomePageState extends State<MyHomePage> {
"assets/images/cloud_logo.png", "assets/images/cloud_logo.png",
height: SizeConfig.getHeightMultiplier() * 4, height: SizeConfig.getHeightMultiplier() * 4,
), ),
],
),
Row(
children: [
const SizedBox(width: 60),
SizedBox(
width: 200,
child: TextField(
controller: controller,
)),
const SizedBox(width: 30),
isLoading
? const CircularProgressIndicator()
: ElevatedButton(
onPressed: onUpdateIPPressed,
child: const Text(
"Update IP",
style: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(backgroundColor: AppGlobal.appRedColor),
),
const SizedBox(width: 30),
Text("IP: $DEVICE_IP", style: const TextStyle(fontWeight: FontWeight.w600)),
const SizedBox(width: 20), const SizedBox(width: 20),
], ],
), ),
],
),
), ),
); );
} }
onUpdateIPPressed() async {
if (controller.text.isNotEmpty) {
isLoading = true;
setState(() {});
DEVICE_IP = controller.text;
await signalRHelper.connection.stop();
if (!signalRHelper.getConnectionState()) {
await signalRHelper.startSignalRConnection(DEVICE_IP, onUpdateAvailable: onUpdateAvailable, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect);
}
controller.clear();
waitings.clear();
isLoading = false;
setState(() {});
}
}
Widget content() { Widget content() {
// waitings = waitings.sublist(0,3); // waitings = waitings.sublist(0,3);
voiceCall(); voiceCall();
@ -92,20 +136,17 @@ class _MyHomePageState extends State<MyHomePage> {
if (waitings.isEmpty) { if (waitings.isEmpty) {
// No Patient in Queue // No Patient in Queue
return noPatientInQueue(); return noPatientInQueue();
} else if (waitings.length > 4) { } else if (waitings.length > 4) {
// Return Content With Side List // Return Content With Side List
return priorityTicketsWithSideList(waitings); return priorityTicketsWithSideList(waitings);
} else { } else {
// Return Content In Center Aligned // Return Content In Center Aligned
return priorityTickets(waitings); return priorityTickets(waitings);
} }
} }
CallByVoice voiceCaller; CallByVoice voiceCaller;
voiceCall() async { voiceCall() async {
if (waitings.isNotEmpty && voiceCaller == null) { if (waitings.isNotEmpty && voiceCaller == null) {
final postVoice = waitings.first.getCallType().audio('en'); final postVoice = waitings.first.getCallType().audio('en');
@ -116,46 +157,39 @@ class _MyHomePageState extends State<MyHomePage> {
} }
onUpdateAvailable(data) async { onUpdateAvailable(data) async {
API.GetCallRequestInfoByClinincInfo( API.GetCallRequestInfoByClinincInfo(DEVICE_IP, onSuccess: (waitingCalls) {
DEVICE_IP,
onSuccess: (waitingCalls, currentInClinic){
setState(() { setState(() {
waitings = waitingCalls; waitings = waitingCalls;
currents = currentInClinic; // currents = currentInClinic;
}); });
log("\n\n"); log("\n\n");
log("--------------------"); log("--------------------");
log("Current: $currentInClinic"); // log("Current: $currentInClinic");
log("Waiting: $waitingCalls"); log("Waiting: $waitingCalls");
log("--------------------"); log("--------------------");
log("\n\n"); log("\n\n");
updateTickets(); updateTickets();
}, onFailure: (error) {});
}, onFailure: (error){
});
} }
updateTickets() { updateTickets() {
// List<Tickets> _ticketsToUpdate = waitings.where((t) => t.call_updated == false); List<Tickets> _ticketsToUpdate = waitings.where((t) => t.call_updated == false).toList();
// API.Call_UpdateNotIsQueueRecordByIDAsync(DEVICE_IP, tickets: _ticketsToUpdate, onSuccess: (tickets_updated){ API.Call_UpdateNotIsQueueRecordByIDAsync(DEVICE_IP, tickets: _ticketsToUpdate, onSuccess: (tickets_updated) {
// print("[${tickets_updated.length}] Tickets Updated: $tickets_updated"); print("[${tickets_updated.length}] Tickets Updated: $tickets_updated");
// }, onFailure: (e){ }, onFailure: (e) {
// print("API UPDate Tickets Failed with : ${e.toString()}");
// }); });
} }
onConnect() { onConnect() {
log("SignalR: onConnect"); log("SignalR: onConnect");
} }
onDisconnect(exception) { onDisconnect(exception) {
log("SignalR: onDisconnect"); log("SignalR: onDisconnect");
signalRHelper.startSignalRConnection(DEVICE_IP, onUpdateAvailable: onUpdateAvailable, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect);
} }
onConnecting() { onConnecting() {

@ -1,9 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:just_audio/just_audio.dart'; import 'package:just_audio/just_audio.dart';
import 'package:queuing_system/utils/call_type.dart';
class CallByVoice { class CallByVoice {
final String lang; final String lang;
final String preVoice; final String preVoice;
final String ticketNo; final String ticketNo;
@ -12,8 +10,8 @@ class CallByVoice{
CallByVoice(this.ticketNo, {this.lang = 'en', @required this.preVoice, @required this.postVoice}); CallByVoice(this.ticketNo, {this.lang = 'en', @required this.preVoice, @required this.postVoice});
final _player = AudioPlayer(); final _player = AudioPlayer();
start() async{
start() async {
// Create Pre Voice Players // Create Pre Voice Players
if (preVoice != null && preVoice.isNotEmpty) { if (preVoice != null && preVoice.isNotEmpty) {
await _player.setAsset('assets/voice_$lang/$preVoice'); await _player.setAsset('assets/voice_$lang/$preVoice');
@ -33,7 +31,6 @@ class CallByVoice{
} }
} }
// Create Post Voice Players // Create Post Voice Players
if (postVoice != null && postVoice.isNotEmpty) { if (postVoice != null && postVoice.isNotEmpty) {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 1000));
@ -45,4 +42,9 @@ class CallByVoice{
_player.dispose(); _player.dispose();
} }
stop() async {
await _player.stop();
}
} }

@ -25,7 +25,8 @@ class SignalRHelper{
startSignalRConnection(String deviceIp, {@required Function(dynamic) onUpdateAvailable, @required VoidCallback onConnect, @required Function(dynamic) onDisconnect, @required VoidCallback onConnecting}) async { startSignalRConnection(String deviceIp, {@required Function(dynamic) onUpdateAvailable, @required VoidCallback onConnect, @required Function(dynamic) onDisconnect, @required VoidCallback onConnecting}) async {
// Hardcoded IP For Testing // Hardcoded IP For Testing
deviceIp = "10.10.14.11"; // deviceIp = "10.10.14.11";
print("Connecting Signal R with: $deviceIp");
final url = hubBaseURL+"?IPAddress=$deviceIp"; final url = hubBaseURL+"?IPAddress=$deviceIp";
connection = HubConnectionBuilder() connection = HubConnectionBuilder()

Loading…
Cancel
Save