|
|
|
|
@ -5,6 +5,7 @@ import 'package:mohem_flutter_app/api/chat/chat_api_client.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/api/offers_and_discounts_api_client.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/consts.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/utils.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/config/routes.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
|
@ -24,6 +25,7 @@ import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
import 'package:signalr_netcore/signalr_client.dart';
|
|
|
|
|
|
|
|
|
|
/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool
|
|
|
|
|
// ignore: prefer_mixin
|
|
|
|
|
@ -40,6 +42,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
|
|
|
|
|
//Chat
|
|
|
|
|
bool isChatCounterLoding = true;
|
|
|
|
|
bool isChatHubLoding = true;
|
|
|
|
|
int chatUConvCounter = 0;
|
|
|
|
|
|
|
|
|
|
//Misssing Swipe
|
|
|
|
|
@ -100,6 +103,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
leaveBalanceAccrual = null;
|
|
|
|
|
|
|
|
|
|
isChatCounterLoding = true;
|
|
|
|
|
isChatHubLoding = true;
|
|
|
|
|
chatUConvCounter = 0;
|
|
|
|
|
|
|
|
|
|
ticketBalance = 0;
|
|
|
|
|
@ -302,6 +306,16 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<HubConnection> getHubConnection() async {
|
|
|
|
|
HubConnection hub;
|
|
|
|
|
HttpConnectionOptions httpOp = HttpConnectionOptions(skipNegotiation: false, logMessageContent: true);
|
|
|
|
|
hub = HubConnectionBuilder()
|
|
|
|
|
.withUrl(ApiConsts.chatHubConnectionUrl + "?UserId=${AppState().chatDetails!.response!.id}&source=Web&access_token=${AppState().chatDetails!.response!.token}", options: httpOp)
|
|
|
|
|
.withAutomaticReconnect(retryDelays: <int>[2000, 5000, 10000, 20000]).build();
|
|
|
|
|
isChatHubLoding = false;
|
|
|
|
|
return hub;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void notify() {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|