family switch parent child and child and child ... #214

Merged
Haroon6138 merged 1 commits from dev_aamir into master 4 weeks ago

@ -313,7 +313,11 @@ class AuthenticationRepoImp implements AuthenticationRepo {
requestBody['ProjectOutSA'] = 0;
requestBody['PatientIdentificationID'] = "";
requestBody.removeWhere((key, value) => ['NationalID', 'isDentalAllowedBackend', 'ForRegisteration'].contains(key));
appState.setIsChildLoggedIn = false;
appState.clearUserSwitchPayloads();
}
} else {
appState.setIsChildLoggedIn = true;
}
}

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

Loading…
Cancel
Save