From 9a614b25b5dd6b3866abf79cfa18c1ab40769bba Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 27 Dec 2020 12:18:01 +0200 Subject: [PATCH] Finish the login --- lib/widgets/auth/verfiy_account.dart | 2 +- lib/widgets/auth/verification_methods.dart | 29 ++-------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 295a3feb..56c2ba09 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -386,7 +386,7 @@ class _VerifyAccountState extends State { zipCode: _loggedUser['ZipCode'], mobileNumber: _loggedUser['MobileNumber'], projectID: await sharedPref.getInt(PROJECT_ID), - logInTokenID: await sharedPref.getInt(LOGIN_TOKEN_ID), + logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), doctorID: 1485, // TODO do it dynamic activationCode: activationCode, diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 6959d45a..32c541a3 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -293,6 +293,7 @@ class _VerificationMethodsState extends State { widget.changeLoadingStata(false); if (res['MessageStatus'] == 1) { + print("VerificationCode : "+ res["VerificationCode"]); sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); @@ -311,33 +312,7 @@ class _VerificationMethodsState extends State { }); } catch (e) {} - // Map model = { - // "LogInTokenID": _loggedUser['LogInTokenID'], - // "Channel": 9, - // "MobileNumber": _loggedUser['MobileNumber'], - // "IPAdress": "11.11.11.11", - // "LanguageID": 2, - // "ProjectID": 15, //TODO : this should become daynamci - // "ZipCode": _loggedUser['ZipCode'], - // "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], - // "OTP_SendType": oTPSendType - // }; - // authProv.sendActivationCodeByOtpNotificationType(model).then((res) { - // widget.changeLoadingStata(false); - // - // if (res['MessageStatus'] == 1) { - // Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, - // arguments: {'model': model}); - // } else { - // print(res['ErrorEndUserMessage']); - // helpers.showErrorToast(res['ErrorEndUserMessage']); - // } - // }).catchError((err) { - // print('$err'); - // widget.changeLoadingStata(false); - // - // helpers.showErrorToast(); - // }); + } else { // TODO route to this page with parameters to inicate we should present 2 option if (Platform.isAndroid && oTPSendType == 3) {