|
|
|
|
@ -270,6 +270,8 @@ class _LoginsreenState extends State<Loginsreen> {
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
if (value !=
|
|
|
|
|
null)
|
|
|
|
|
setState(() {
|
|
|
|
|
userInfo
|
|
|
|
|
.password =
|
|
|
|
|
@ -278,6 +280,8 @@ class _LoginsreenState extends State<Loginsreen> {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onChanged: (value){
|
|
|
|
|
if (value !=
|
|
|
|
|
null)
|
|
|
|
|
setState(() {
|
|
|
|
|
userInfo
|
|
|
|
|
.password =
|
|
|
|
|
@ -456,19 +460,21 @@ class _LoginsreenState extends State<Loginsreen> {
|
|
|
|
|
await model.login(userInfo);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if (model.loginInfo['MessageStatus'] == 1) {
|
|
|
|
|
saveObjToString(LOGGED_IN_USER, model.loginInfo);
|
|
|
|
|
sharedPref.remove(LAST_LOGIN_USER);
|
|
|
|
|
sharedPref.setString(TOKEN, model.loginInfo['LogInTokenID']);
|
|
|
|
|
Navigator.of(AppGlobal.CONTEX).pushReplacement(MaterialPageRoute(
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
|
|
Navigator.of(context).pushReplacement(MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
VerificationMethodsScreen(
|
|
|
|
|
password: userInfo.password,
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -492,20 +498,17 @@ class _LoginsreenState extends State<Loginsreen> {
|
|
|
|
|
primaryFocus.unfocus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getProjects(memberID, IMEIViewModel model) {
|
|
|
|
|
getProjects(memberID, IMEIViewModel model)async {
|
|
|
|
|
if (memberID != null && memberID != '') {
|
|
|
|
|
if (projectsList.length == 0) {
|
|
|
|
|
model.getHospitalsList(memberID).then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
projectsList = res['ProjectInfo'];
|
|
|
|
|
setState(() {
|
|
|
|
|
userInfo.projectID = projectsList[0]["facilityId"];
|
|
|
|
|
projectIdController.text = projectsList[0]['facilityName'];
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
print(res);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
await model.getHospitalsList(memberID);
|
|
|
|
|
if(model.state == ViewState.Idle) {
|
|
|
|
|
projectsList = model.hospitals;
|
|
|
|
|
setState(() {
|
|
|
|
|
userInfo.projectID = projectsList[0]["facilityId"];
|
|
|
|
|
projectIdController.text = projectsList[0]['facilityName'];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|