dev_v3.13.6_BLE_Faiz
Sultan khan 2 years ago
parent eee2ccf148
commit 63f5f7890e

@ -47,7 +47,12 @@ class ConfirmLogin extends StatefulWidget {
final fromRegistration; final fromRegistration;
final bool isDubai; final bool isDubai;
const ConfirmLogin({Key? key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key); const ConfirmLogin(
{Key? key,
this.changePageViewIndex,
this.fromRegistration = false,
this.isDubai = false})
: super(key: key);
@override @override
_ConfirmLogin createState() => _ConfirmLogin(); _ConfirmLogin createState() => _ConfirmLogin();
@ -59,7 +64,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var sharedPref = AppSharedPreferences(); var sharedPref = AppSharedPreferences();
bool authenticated = false; bool authenticated = false;
final authService = AuthProvider(); final authService = AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
late int mobileNumber; late int mobileNumber;
String errorMsg = ''; String errorMsg = '';
SelectDeviceIMEIRES? user; SelectDeviceIMEIRES? user;
@ -89,8 +95,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
int fingrePrintBefore = 0; int fingrePrintBefore = 0;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); locator<AuthenticatedUserObject>();
AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();
late ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
late ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
@ -138,16 +146,30 @@ class _ConfirmLogin extends State<ConfirmLogin> {
children: [ children: [
Text( Text(
TranslationBase.of(context).welcomeBack, TranslationBase.of(context).welcomeBack,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64),
), ),
Text( Text(
user!.name!.toLowerCase().capitalizeFirstofEach, user!.name!.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44), style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
height: 1,
letterSpacing: -1.44),
), ),
SizedBox(height: 10), SizedBox(height: 10),
Text( Text(
TranslationBase.of(context).accountInfo, TranslationBase.of(context).accountInfo,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 25 / 16),
), ),
Container( Container(
height: 72, height: 72,
@ -166,29 +188,46 @@ class _ConfirmLogin extends State<ConfirmLogin> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
TranslationBase.of(context).lastLoginAt.toCamelCase, TranslationBase.of(context)
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), .lastLoginAt
.toCamelCase,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64),
), ),
Text( Text(
user!.editedOn != null // user!.editedOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!)) // ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!))
: user!.createdOn != null // :
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.createdOn!)) user!.createdOn != null
: '--', ? DateUtil.getDayMonthYearDateFormatted(
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), DateUtil.convertStringToDate(
user!.createdOn!))
: '--',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.48),
), ),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
TranslationBase.of(context).lastLoginWith.toCamelCase, TranslationBase.of(context)
.lastLoginWith
.toCamelCase,
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -205,12 +244,23 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Text( Text(
user!.editedOn != null // user!.editedOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.editedOn!), false) // ? DateUtil.formatDateToTimeLang(
: user!.createdOn != null // DateUtil.convertStringToDate(
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.createdOn!), false) // user!.editedOn!),
: '--', // false)
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), // :
user!.createdOn != null
? DateUtil.formatDateToTimeLang(
DateUtil.convertStringToDate(
user!.createdOn!),
false)
: '--',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.48),
), ),
], ],
) )
@ -219,10 +269,18 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
TranslationBase.of(context).pleaseVerify, TranslationBase.of(context).pleaseVerify,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64),
), ),
GridView( GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 13,
mainAxisSpacing: 9),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(top: 9), padding: EdgeInsets.only(top: 9),
shrinkWrap: true, shrinkWrap: true,
@ -236,40 +294,62 @@ class _ConfirmLogin extends State<ConfirmLogin> {
], ],
) )
else else
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Column(
Image.asset( mainAxisAlignment: MainAxisAlignment.start,
'assets/images/habib-logo.png', crossAxisAlignment: CrossAxisAlignment.start,
height: 90, children: <Widget>[
width: 90, Image.asset(
), 'assets/images/habib-logo.png',
SizedBox(height: 23), height: 90,
this.onlySMSBox == false width: 90,
? Text( ),
TranslationBase.of(context).verifyLoginWith, SizedBox(height: 23),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), this.onlySMSBox == false
) ? Text(
: Text( TranslationBase.of(context).verifyLoginWith,
TranslationBase.of(context).verifyFingerprint2, style: TextStyle(
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), fontSize: 16,
), fontWeight: FontWeight.w600,
SizedBox(height: 23), color: Color(0xff2B353E),
Text( letterSpacing: -0.64,
TranslationBase.of(context).pleaseVerify, height: 25 / 16),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), )
), : Text(
GridView( TranslationBase.of(context)
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), .verifyFingerprint2,
physics: NeverScrollableScrollPhysics(), style: TextStyle(
padding: EdgeInsets.only(top: 9), fontSize: 16,
shrinkWrap: true, fontWeight: FontWeight.w600,
children: [ color: Color(0xff2B353E),
if (onlySMSBox == false) getButton(3), letterSpacing: -0.64,
if (onlySMSBox == false) getButton(2), height: 25 / 16),
getButton(1), ),
getButton(4), SizedBox(height: 23),
], Text(
), TranslationBase.of(context).pleaseVerify,
]), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64),
),
GridView(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 13,
mainAxisSpacing: 9),
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(top: 9),
shrinkWrap: true,
children: [
if (onlySMSBox == false) getButton(3),
if (onlySMSBox == false) getButton(2),
getButton(1),
getButton(4),
],
),
]),
], ],
), ),
), ),
@ -280,7 +360,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
TranslationBase.of(context).useAnotherAccount, TranslationBase.of(context).useAnotherAccount,
() { () {
Navigator.of(context).pushNamed(LOGIN_TYPE); Navigator.of(context).pushNamed(LOGIN_TYPE);
projectViewModel.analytics.loginRegistration.login_with_other_account(); projectViewModel.analytics.loginRegistration
.login_with_other_account();
}, },
), ),
], ],
@ -290,7 +371,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
Future<void> _getAvailableBiometrics() async { Future<void> _getAvailableBiometrics() async {
final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics; final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics;
final bool canAuthenticate = final bool canAuthenticate =
canAuthenticateWithBiometrics || await auth.isDeviceSupported(); canAuthenticateWithBiometrics || await auth.isDeviceSupported();
@ -322,7 +402,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
login_method = type; login_method = type;
LoginRegistration.verificationMethod = type; LoginRegistration.verificationMethod = type;
// if(!widget.fromRegistration) // if(!widget.fromRegistration)
projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); projectViewModel.analytics.loginRegistration
.login_verfication(forRegistration: widget.fromRegistration);
switch (type) { switch (type) {
case 1: case 1:
@ -340,7 +421,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
default: default:
break; break;
} }
sharedPref.setInt(LAST_LOGIN, this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); sharedPref.setInt(LAST_LOGIN,
this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN);
} }
loginWithSMS(type) { loginWithSMS(type) {
@ -396,7 +478,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null || widget.isDubai) { if (healthId != null || widget.isDubai) {
if (!widget.isDubai) { if (!widget.isDubai) {
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); request.dob =
dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
} }
request.healthId = healthId; request.healthId = healthId;
request.isHijri = isHijri; request.isHijri = isHijri;
@ -452,7 +535,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
stickyAuth: true, stickyAuth: true,
), ),
authMessages: [ authMessages: [
IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'), IOSAuthMessages(
cancelButton: 'cancel',
goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID'),
], ],
); );
} on PlatformException catch (e) { } on PlatformException catch (e) {
@ -508,14 +595,19 @@ class _ConfirmLogin extends State<ConfirmLogin> {
setDefault() async { setDefault() async {
showLoader(true); showLoader(true);
if (await sharedPref.getObject(IMEI_USER_DATA) != null) user = SelectDeviceIMEIRES.fromJson(await sharedPref.getObject(IMEI_USER_DATA)); if (await sharedPref.getObject(IMEI_USER_DATA) != null)
user = SelectDeviceIMEIRES.fromJson(
await sharedPref.getObject(IMEI_USER_DATA));
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
isMoreOption = true; isMoreOption = true;
this.registerd_data = await CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); this.registerd_data = await CheckPatientAuthenticationReq.fromJson(
await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
} }
this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user!.mobile!); this.mobileNumber = this.registerd_data != null
? this.registerd_data.patientMobileNumber
: int.parse(this.user!.mobile!);
this.zipCode = this.registerd_data != null this.zipCode = this.registerd_data != null
? this.registerd_data.zipCode ? this.registerd_data.zipCode
: this.user!.outSA == true : this.user!.outSA == true
@ -534,7 +626,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (nhic != null) { if (nhic != null) {
final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); dob = nhic['IsHijri']
? nhic['DateOfBirth']
: dateFormat2.format(dateFormat.parse(nhic['DateOfBirth']));
isHijri = nhic['IsHijri'] ? 1 : 0; isHijri = nhic['IsHijri'] ? 1 : 0;
healthId = nhic['HealthId']; healthId = nhic['HealthId'];
@ -557,22 +651,34 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.deviceToken = this.deviceToken; request.deviceToken = this.deviceToken;
request.projectOutSA = this.patientOutSA == true ? true : false; request.projectOutSA = this.patientOutSA == true ? true : false;
request.loginType = this.selectedOption; request.loginType = this.selectedOption;
request.oTPSendType = type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2; request.oTPSendType =
type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2;
request.zipCode = this.zipCode; request.zipCode = this.zipCode;
request.logInTokenID = this.loginTokenID ?? ""; request.logInTokenID = this.loginTokenID ?? "";
if (this.registerd_data != null) { if (this.registerd_data != null) {
request.searchType = this.registerd_data.searchType != null ? this.registerd_data.searchType : 1; request.searchType = this.registerd_data.searchType != null
request.patientID = this.registerd_data.patientID != null ? this.registerd_data.patientID : 0; ? this.registerd_data.searchType
request.patientIdentificationID = request.nationalID = this.registerd_data.patientIdentificationID != null ? this.registerd_data.patientIdentificationID : '0'; : 1;
request.patientID = this.registerd_data.patientID != null
? this.registerd_data.patientID
: 0;
request.patientIdentificationID = request.nationalID =
this.registerd_data.patientIdentificationID != null
? this.registerd_data.patientIdentificationID
: '0';
request.dob = this.registerd_data.dob; request.dob = this.registerd_data.dob;
request.isRegister = this.registerd_data.isRegister; request.isRegister = this.registerd_data.isRegister;
} else { } else {
request.searchType = request.searchType != null ? request.searchType : 2; request.searchType = request.searchType != null ? request.searchType : 2;
request.patientID = this.user!.patientID != null ? this.user!.patientID : 0; request.patientID =
request.nationalID = request.nationalID != null ? request.nationalID : '0'; this.user!.patientID != null ? this.user!.patientID : 0;
request.patientIdentificationID = request.patientIdentificationID != null ? request.patientIdentificationID : '0'; request.nationalID =
request.nationalID != null ? request.nationalID : '0';
request.patientIdentificationID = request.patientIdentificationID != null
? request.patientIdentificationID
: '0';
request.isRegister = false; request.isRegister = false;
} }
request.deviceTypeID = request.searchType; request.deviceTypeID = request.searchType;
@ -597,14 +703,19 @@ class _ConfirmLogin extends State<ConfirmLogin> {
res = result, res = result,
if (result is Map) if (result is Map)
{ {
result = CheckActivationCode.fromJson(result as Map<String, dynamic>), result = CheckActivationCode.fromJson(
if (this.registerd_data != null && this.registerd_data.isRegister == true) result as Map<String, dynamic>),
if (this.registerd_data != null &&
this.registerd_data.isRegister == true)
{ {
// if(widget.isDubai ==false){ // if(widget.isDubai ==false){
widget.changePageViewIndex!(1), widget.changePageViewIndex!(1),
// if(widget.isDubai ==false){ // if(widget.isDubai ==false){
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), Navigator.popUntil(
context,
(route) =>
Utils.route(route, equalsTo: RegisterNew)),
} }
} }
else else
@ -614,8 +725,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: result); AppToast.showErrorToast(message: result);
}), }),
projectViewModel.analytics.loginRegistration.login_fail(error: result), projectViewModel.analytics.loginRegistration
projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result), .login_fail(error: result),
projectViewModel.analytics.errorTracking.log(
'otp_verification_at_confirm_login',
error: result),
} }
}) })
.catchError((err) { .catchError((err) {
@ -633,27 +747,36 @@ class _ConfirmLogin extends State<ConfirmLogin> {
res = result, res = result,
if (result is Map) if (result is Map)
{ {
result = CheckActivationCode.fromJson(result as Map<String, dynamic>), result = CheckActivationCode.fromJson(
if (this.registerd_data != null && this.registerd_data.isRegister == true) result as Map<String, dynamic>),
if (this.registerd_data != null &&
this.registerd_data.isRegister == true)
{ {
widget.changePageViewIndex!(1), widget.changePageViewIndex!(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), Navigator.popUntil(
context,
(route) =>
Utils.route(route, equalsTo: RegisterNew)),
} }
else else
{ {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false, result.list.isFamily = false,
userData = result.list, userData = result.list,
sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? "O+"), sharedPref.setString(
BLOOD_TYPE, result.patientBloodType ?? "O+"),
//Remove o+ from here Added by Aamir //Remove o+ from here Added by Aamir
authenticatedUserObject.user = result.list, authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res), projectViewModel.setPrivilege(privilegeList: res),
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), sharedPref.setObject(
sharedPref.setString(TOKEN, result.authenticationTokenID), LOGIN_TOKEN_ID, result.logInTokenID),
projectViewModel.analytics.loginRegistration.login_successful(), sharedPref.setString(
TOKEN, result.authenticationTokenID),
projectViewModel.analytics.loginRegistration
.login_successful(),
checkIfUserAgreedBefore(result), checkIfUserAgreedBefore(result),
} }
} }
@ -666,8 +789,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
startSMSService(tempType); startSMSService(tempType);
}), }),
projectViewModel.analytics.loginRegistration.login_fail(error: result), projectViewModel.analytics.loginRegistration
projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result) .login_fail(error: result),
projectViewModel.analytics.errorTracking
.log('otp_verification_at_confirm_login', error: result)
} }
}) })
.catchError((err) { .catchError((err) {
@ -703,17 +828,25 @@ class _ConfirmLogin extends State<ConfirmLogin> {
print("Has Admission Request: $hasAdmissionRequest"); print("Has Admission Request: $hasAdmissionRequest");
if (isAdmitted) { if (isAdmitted) {
if (res['PatientAdmittedInformation'].length != 0) { if (res['PatientAdmittedInformation'].length != 0) {
getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]); getAdmissionInfoResponseModel =
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']); GetAdmissionInfoResponseModel.fromJson(
projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel); res['PatientAdmittedInformation'][0]);
projectViewModel.setInPatientProjectID(
res['PatientAdmittedInformation'][0]['ProjectID']);
projectViewModel
.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
projectViewModel.setIsPatientAdmitted(true); projectViewModel.setIsPatientAdmitted(true);
} }
} }
if (hasAdmissionRequest) { if (hasAdmissionRequest) {
if (res['MedicalInstruction'].length != 0) { if (res['MedicalInstruction'].length != 0) {
getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel.fromJson(res['MedicalInstruction'][0]); getAdmissionRequestInfoResponseModel =
projectViewModel.setInPatientProjectID(res['MedicalInstruction'][0]['ProjectID']); GetAdmissionRequestInfoResponseModel.fromJson(
projectViewModel.setInPatientAdmissionRequest(getAdmissionRequestInfoResponseModel); res['MedicalInstruction'][0]);
projectViewModel.setInPatientProjectID(
res['MedicalInstruction'][0]['ProjectID']);
projectViewModel.setInPatientAdmissionRequest(
getAdmissionRequestInfoResponseModel);
projectViewModel.setPatientHasAdmissionRequest(true); projectViewModel.setPatientHasAdmissionRequest(true);
} }
} }
@ -722,7 +855,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
insertIMEI() { insertIMEI() {
authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) { authService
.insertDeviceImei(selectedOption)
.then((value) => {})
.catchError((err) {
print(err); print(err);
}); });
} }
@ -732,7 +868,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0"); toDoProvider.setState(res['AppointmentActiveNumber'],
res['AncillaryOrderListCount'], true, "0");
// toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
@ -794,8 +931,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}); });
} }
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { Widget _loginOptionButton(
bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) || _flag == 2 && !checkIfBiometricAvailable(BiometricType.fingerprint) && _flag == 2 && !checkIfBiometricAvailable(BiometricType.strong)); String _title, String _icon, int _flag, int? _loginIndex) {
bool isDisable =
(_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) ||
_flag == 2 &&
!checkIfBiometricAvailable(BiometricType.fingerprint) &&
_flag == 2 &&
!checkIfBiometricAvailable(BiometricType.strong));
return InkWell( return InkWell(
onTap: isDisable onTap: isDisable
? null ? null
@ -806,7 +949,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}); });
} else { } else {
authenticateUser(_flag, isActive: _loginIndex); authenticateUser(_flag, isActive: _loginIndex);
projectViewModel.analytics.loginRegistration.verify_otp_method(forRegistration: widget.fromRegistration); projectViewModel.analytics.loginRegistration.verify_otp_method(
forRegistration: widget.fromRegistration);
} }
}, },
child: Container( child: Container(
@ -831,7 +975,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
TranslationBase.of(context).verifyThrough + " " + _title, TranslationBase.of(context).verifyThrough + " " + _title,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: isDisable ? Color(0xff2B353E).withOpacity(0.7) : Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: isDisable
? Color(0xff2B353E).withOpacity(0.7)
: Color(0xff2B353E),
letterSpacing: -0.48,
height: 20 / 16),
), ),
], ],
), ),
@ -843,16 +994,26 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Widget getButton(int flag) { Widget getButton(int flag) {
switch (flag) { switch (flag) {
case 4: case 4:
return _loginOptionButton(TranslationBase.of(context).verifyWhatsApp, 'assets/images/new/verify_whatsapp.svg', flag, null); return _loginOptionButton(TranslationBase.of(context).verifyWhatsApp,
'assets/images/new/verify_whatsapp.svg', flag, null);
break; break;
case 1: case 1:
return _loginOptionButton(TranslationBase.of(context).verifySMS, 'assets/images/new/verify_sms.svg', flag, null); return _loginOptionButton(TranslationBase.of(context).verifySMS,
'assets/images/new/verify_sms.svg', flag, null);
break; break;
case 2: case 2:
return _loginOptionButton(TranslationBase.of(context).verifyFingerprint, 'assets/images/new/verify_thumb.svg', flag, BiometricType.fingerprint.index); return _loginOptionButton(
TranslationBase.of(context).verifyFingerprint,
'assets/images/new/verify_thumb.svg',
flag,
BiometricType.fingerprint.index);
break; break;
case 3: case 3:
return _loginOptionButton(TranslationBase.of(context).verifyFaceID, 'assets/images/new/verify_face.svg', flag, BiometricType.face.index); return _loginOptionButton(
TranslationBase.of(context).verifyFaceID,
'assets/images/new/verify_face.svg',
flag,
BiometricType.face.index);
break; break;
default: default:
@ -864,7 +1025,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}, },
child: RoundedContainer( child: RoundedContainer(
height: 150, height: 150,
backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey, borderColor: Colors.grey,
showBorder: true, showBorder: true,
child: Padding( child: Padding(
@ -883,7 +1046,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: SizedBox( : SizedBox(
height: 20, height: 20,
), ),
Texts(TranslationBase.of(context).moreVerification, fontSize: SizeConfig.textMultiplier! * 1.8, textAlign: TextAlign.center, color: Colors.black) Texts(TranslationBase.of(context).moreVerification,
fontSize: SizeConfig.textMultiplier! * 1.8,
textAlign: TextAlign.center,
color: Colors.black)
], ],
), ),
), ),

Loading…
Cancel
Save