|
|
|
|
@ -84,19 +84,22 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
bool disbaleChatForThisUser = false;
|
|
|
|
|
bool isCall = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userLoginToken.UserAutoLoginModel userLoginData = userLoginToken.UserAutoLoginModel();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> getUserAutoLoginToken() async {
|
|
|
|
|
userLoginToken.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken();
|
|
|
|
|
if (userLoginResponse.response != null) {
|
|
|
|
|
AppState().setchatUserDetails = userLoginResponse;
|
|
|
|
|
} else {
|
|
|
|
|
AppState().setchatUserDetails = userLoginResponse;
|
|
|
|
|
Utils.showToast(
|
|
|
|
|
userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr",
|
|
|
|
|
);
|
|
|
|
|
try {
|
|
|
|
|
userLoginToken.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken();
|
|
|
|
|
if (userLoginResponse.response != null) {
|
|
|
|
|
AppState().setchatUserDetails = userLoginResponse;
|
|
|
|
|
} else {
|
|
|
|
|
AppState().setchatUserDetails = userLoginResponse;
|
|
|
|
|
Utils.showToast(
|
|
|
|
|
userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr",
|
|
|
|
|
);
|
|
|
|
|
disbaleChatForThisUser = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
disbaleChatForThisUser = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
@ -105,7 +108,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
Future<void> buildHubConnection({required BuildContext context, required ChatCallProvider ccProvider}) async {
|
|
|
|
|
try {
|
|
|
|
|
chatHubConnection = await getHubConnection();
|
|
|
|
|
}catch(e){
|
|
|
|
|
} catch (e) {
|
|
|
|
|
Utils.showToast(e.toString());
|
|
|
|
|
}
|
|
|
|
|
await chatHubConnection.start();
|
|
|
|
|
|