|
|
|
@ -304,7 +304,8 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
_navigationService.pushPage(page: LoginScreen());
|
|
|
|
_navigationService.pushPage(page: LoginScreen());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, onError: (String error) {
|
|
|
|
},
|
|
|
|
|
|
|
|
onError: (String error) {
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
_dialogService.showErrorBottomSheet(message: error, onOkPressed: () {});
|
|
|
|
_dialogService.showErrorBottomSheet(message: error, onOkPressed: () {});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -631,8 +632,8 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
if (isSwitchUser) {
|
|
|
|
if (isSwitchUser) {
|
|
|
|
if (_appState.getIsChildLoggedIn) {
|
|
|
|
if (_appState.getIsChildLoggedIn) {
|
|
|
|
_appState.setSuperUserID = null;
|
|
|
|
_appState.setSuperUserID = null;
|
|
|
|
_appState.setIsChildLoggedIn = false;
|
|
|
|
// _appState.setIsChildLoggedIn = false;
|
|
|
|
activation.list!.first.isParentUser = true;
|
|
|
|
activation.list!.first.isParentUser = false;
|
|
|
|
var allUsersPayload = _appState.getUserSwitchPayloads;
|
|
|
|
var allUsersPayload = _appState.getUserSwitchPayloads;
|
|
|
|
if ((allUsersPayload.containsKey('superUser') && allUsersPayload['superUser'] != null)) {
|
|
|
|
if ((allUsersPayload.containsKey('superUser') && allUsersPayload['superUser'] != null)) {
|
|
|
|
_appState.addUserSwitchPayload(activation.list!.first.toJson(), isSuperUser: false);
|
|
|
|
_appState.addUserSwitchPayload(activation.list!.first.toJson(), isSuperUser: false);
|
|
|
|
@ -641,9 +642,9 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
_appState.setSuperUserID = _appState.getAuthenticatedUser()?.patientId;
|
|
|
|
_appState.setSuperUserID = _appState.getAuthenticatedUser()?.patientId;
|
|
|
|
_appState.setIsChildLoggedIn = true;
|
|
|
|
// _appState.setIsChildLoggedIn = false;
|
|
|
|
activation.list!.first.isParentUser = false;
|
|
|
|
activation.list!.first.isParentUser = true;
|
|
|
|
_appState.addUserSwitchPayload(activation.list!.first.toJson(), isSuperUser: false);
|
|
|
|
_appState.addUserSwitchPayload(activation.list!.first.toJson(), isSuperUser: true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
activation.list!.first.isParentUser = true;
|
|
|
|
activation.list!.first.isParentUser = true;
|
|
|
|
|