fix login issue and add new localizedValues

merge-requests/803/head
Mohammad Aljammal 3 years ago
parent a33c0312b7
commit d5cff77743

@ -26,7 +26,8 @@ class BaseAppClient {
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isLiveCare = false}) async {
bool isLiveCare = false,
bool isFallLanguage=false}) async {
String url;
if (isLiveCare)
url = BASE_URL_LIVE_CARE + endPoint;
@ -58,12 +59,13 @@ class BaseAppClient {
body['TokenID'] = token ?? '';
}
// body['TokenID'] = "@dm!n" ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
body['LanguageID'] = 2;
if(!isFallLanguage) {
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
body['LanguageID'] = 2;
}
body['stamp'] = DateTime.now().toIso8601String();
// if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS;

File diff suppressed because it is too large Load Diff

@ -21,6 +21,6 @@ class ScheduleService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestSchedule.toJson(),);
}, body: _requestSchedule.toJson(),isFallLanguage: true);
}
}

@ -142,7 +142,7 @@ class AuthenticationViewModel extends BaseViewModel {
iMEI: user.iMEI,
facilityId: user.projectID,
memberID: user.doctorID,
loginDoctorID: user.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()),
zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile,
oTPSendType: authMethodType.getTypeIdService(),
@ -172,7 +172,7 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
await sharedPref.setString(LOGIN_TOKEN_ID,
await sharedPref.setString(TOKEN,
_authService.activationCodeForDoctorAppRes.logInTokenID);
setState(ViewState.Idle);
}
@ -191,14 +191,14 @@ class AuthenticationViewModel extends BaseViewModel {
projectID: await sharedPref.getInt(PROJECT_ID) != null
? await sharedPref.getInt(PROJECT_ID)
: user.projectID,
logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID),
logInTokenID: await sharedPref.getString(TOKEN),
activationCode: activationCode ?? '0000',
memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID ,
password: userInfo.password,
facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken,
loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID,// loggedUser.listMemberInformation[0].employeeID,
loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin:isSilentLogin,
generalid: "Cs2020@2016\$2958");
await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);
@ -258,7 +258,7 @@ class AuthenticationViewModel extends BaseViewModel {
sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(LOGIN_TOKEN_ID,
await sharedPref.setString(TOKEN,
sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
}

@ -55,7 +55,7 @@ class RequestSchedule {
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['DoctorWorkingHoursDays'] = this.doctorWorkingHoursDays;
data['LanguageID'] = this.languageID;
data['LanguageID'] = 2;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;

@ -455,7 +455,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(authenticationViewModel.error);
} else {
await sharedPref.setString(LOGIN_TOKEN_ID,
await sharedPref.setString(TOKEN,
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {

@ -249,7 +249,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen>
TranslationBase.of(context).inPatientAll,
counter: model.inPatientList.length),
tabWidget(
screenSize, _activeTab == 1, "My InPatients",
screenSize, _activeTab == 1, TranslationBase.of(context).inPatient,
counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2,
TranslationBase.of(context).discharged),

Loading…
Cancel
Save