merge-requests/188/head
Aamir Muhammad 3 years ago
parent 5a338199b9
commit 55cf39a364

@ -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();

@ -127,6 +127,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
if (chatHubConnection.state == HubConnectionState.Connected) {
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.chat);
Utils.saveStringFromPrefs("isAppOpendByChat", "false");
}
}

Loading…
Cancel
Save