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