Till the Khobar Team Demo

master
Faiz Hashmi 2 years ago
parent 3982491386
commit 07b337ba70

@ -5,8 +5,8 @@ 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_LIVE_CARE = 'https://livecare.hmg.com/';
// 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/';

@ -18,6 +18,7 @@ import 'package:queuing_system/utils/call_by_voice.dart';
import 'package:queuing_system/utils/call_type.dart'; import 'package:queuing_system/utils/call_type.dart';
import 'package:queuing_system/utils/signalR_utils.dart'; import 'package:queuing_system/utils/signalR_utils.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:signalr_core/signalr_core.dart';
bool isVoiceActualCompletedGlobally = false; bool isVoiceActualCompletedGlobally = false;
@ -87,7 +88,7 @@ class AppProvider extends ChangeNotifier {
log("Api call failed with this error: ${error.toString()}"); log("Api call failed with this error: ${error.toString()}");
}); });
currentWidgetsConfigModel = widgetsConfigModel; if (widgetsConfigModel != null) currentWidgetsConfigModel = widgetsConfigModel;
notifyListeners(); notifyListeners();
} }
@ -162,8 +163,7 @@ class AppProvider extends ChangeNotifier {
RssFeedModel currentRssFeedModel = RssFeedModel(); RssFeedModel currentRssFeedModel = RssFeedModel();
Future<void> getRssFeedDetailsFromServer() async { Future<void> getRssFeedDetailsFromServer() async {
RssFeedModel? rssFeedModel = RssFeedModel? rssFeedModel = await API.getRssFeedDetailsFromServer(languageId: 0, onFailure: (error) => log("Api call failed with this error: ${error.toString()}"));
await API.getRssFeedDetailsFromServer(languageId: 0, onFailure: (error) => log("Api call failed with this error: ${error.toString()}"));
if (rssFeedModel != null) { if (rssFeedModel != null) {
currentRssFeedModel = rssFeedModel; currentRssFeedModel = rssFeedModel;
@ -173,7 +173,7 @@ class AppProvider extends ChangeNotifier {
} }
Future<void> getInfoWidgetsDetailsFromServer() async { Future<void> getInfoWidgetsDetailsFromServer() async {
if (currentWidgetsConfigModel == null) return; // if (currentWidgetsConfigModel == null) return;
await getInfoWidgetsConfigurationsFromServer().whenComplete(() async { await getInfoWidgetsConfigurationsFromServer().whenComplete(() async {
if (currentWidgetsConfigModel!.isWeatherReq!) { if (currentWidgetsConfigModel!.isWeatherReq!) {
@ -471,7 +471,7 @@ class AppProvider extends ChangeNotifier {
updatePatientTicket(PatientTicketModel patientTicket) { updatePatientTicket(PatientTicketModel patientTicket) {
if (!patientTicket.isQueue) { if (!patientTicket.isQueue) {
API.callUpdateNotIsQueueRecordByIDAsync(currentDeviceIp, ticket: patientTicket, onSuccess: (ticketsUpdated) { API.callUpdateNotIsQueueRecordByIDAsync(currentDeviceIp, ticket: patientTicket, onSuccess: (ticketsUpdated) {
log("[${patientTicket.callNoStr}] Ticket Updated: $ticketsUpdated"); log("[${patientTicket.callNoStr}] Ticket Updated: $ticketsUpdated");
}, onFailure: (e) { }, onFailure: (e) {
log(" Tickets Update ${patientTicket.callNoStr} Failed with Error : ${e.toString()}"); log(" Tickets Update ${patientTicket.callNoStr} Failed with Error : ${e.toString()}");
@ -485,8 +485,7 @@ class AppProvider extends ChangeNotifier {
onDisconnect(exception) { onDisconnect(exception) {
log("SignalR: onDisconnect"); log("SignalR: onDisconnect");
signalRHelper.startSignalRConnection(currentDeviceIp, signalRHelper.startSignalRConnection(currentDeviceIp, onUpdateAvailable: onPingReceived, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect);
onUpdateAvailable: onPingReceived, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect);
} }
onConnecting() { onConnecting() {
@ -499,8 +498,8 @@ class AppProvider extends ChangeNotifier {
case ConnectivityResult.wifi: case ConnectivityResult.wifi:
updateInternetConnection(true); updateInternetConnection(true);
await getCurrentIP(); await getCurrentIP();
if (signalRHelper.connection == null || signalRHelper.connection!.state != ConnectionState.active) { if (signalRHelper.connection != null) {
signalRHelper.connection!.start(); if (signalRHelper.connection!.state != HubConnectionState.connected) signalRHelper.connection!.start();
} }
break; break;
case ConnectivityResult.none: case ConnectivityResult.none:

@ -22,8 +22,6 @@ class SignalRHelper {
// String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub"; // String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub";
String hubBaseURL = "$BASE_URL/PatientCallingHub"; String hubBaseURL = "$BASE_URL/PatientCallingHub";
// String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub?IPAddress=10.10.14.20"; // String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub?IPAddress=10.10.14.20";
// "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273"; // "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273";
HubConnection? connection; HubConnection? connection;
@ -72,10 +70,10 @@ class SignalRHelper {
} }
} }
startConnection(BuildContext context) async { // startConnection(BuildContext context) async {
if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) { // if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) {
connection!.off('addChatMessage'); // connection!.off('addChatMessage');
await connection!.start(); // await connection!.start();
} // }
} // }
} }

Loading…
Cancel
Save