|
|
|
|
@ -51,7 +51,10 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
authProv = Provider.of<AuthProvider>(context);
|
|
|
|
|
|
|
|
|
|
final focusD1 = FocusNode();
|
|
|
|
|
final focusD2 = FocusNode();
|
|
|
|
|
final focusD3 = FocusNode();
|
|
|
|
|
final focusD4 = FocusNode();
|
|
|
|
|
return FutureBuilder(
|
|
|
|
|
future: Future.wait([_loggedUserFuture]),
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
|
|
|
|
@ -78,6 +81,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
textInputAction: TextInputAction.next,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
@ -89,24 +93,37 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
val;
|
|
|
|
|
},
|
|
|
|
|
validator: validateCodeDigit,
|
|
|
|
|
onFieldSubmitted: (_) {
|
|
|
|
|
FocusScope.of(context)
|
|
|
|
|
.requestFocus(focusD2);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration:
|
|
|
|
|
buildInputDecoration(context),
|
|
|
|
|
onSaved: (val) {
|
|
|
|
|
verifyAccountFormValue['digit2'] =
|
|
|
|
|
val;
|
|
|
|
|
},
|
|
|
|
|
validator: validateCodeDigit)),
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD2,
|
|
|
|
|
textInputAction: TextInputAction.next,
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration:
|
|
|
|
|
buildInputDecoration(context),
|
|
|
|
|
onSaved: (val) {
|
|
|
|
|
verifyAccountFormValue['digit2'] =
|
|
|
|
|
val;
|
|
|
|
|
},
|
|
|
|
|
onFieldSubmitted: (_) {
|
|
|
|
|
FocusScope.of(context)
|
|
|
|
|
.requestFocus(focusD3);
|
|
|
|
|
},
|
|
|
|
|
validator: validateCodeDigit),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD3,
|
|
|
|
|
textInputAction: TextInputAction.next,
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
@ -116,11 +133,15 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
onSaved: (val) {
|
|
|
|
|
verifyAccountFormValue['digit3'] =
|
|
|
|
|
val;
|
|
|
|
|
},
|
|
|
|
|
},onFieldSubmitted: (_) {
|
|
|
|
|
FocusScope.of(context)
|
|
|
|
|
.requestFocus(focusD4);
|
|
|
|
|
},
|
|
|
|
|
validator: validateCodeDigit)),
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD4,
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
@ -294,18 +315,19 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
|
|
|
|
|
if (res['List_DoctorProfile'] != null) {
|
|
|
|
|
loginProcessCompleted(res['List_DoctorProfile'][0],changeLoadingStata);
|
|
|
|
|
loginProcessCompleted(
|
|
|
|
|
res['List_DoctorProfile'][0], changeLoadingStata);
|
|
|
|
|
} else {
|
|
|
|
|
_asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName',
|
|
|
|
|
'Please Select Clinic')
|
|
|
|
|
.then((clinicInfo) {
|
|
|
|
|
ClinicModel clinic = ClinicModel.fromJson(clinicInfo);
|
|
|
|
|
print(clinicInfo);
|
|
|
|
|
getDocProfiles(clinic, changeLoadingStata);
|
|
|
|
|
getDocProfiles(clinic, changeLoadingStata);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
changeLoadingStata(false);
|
|
|
|
|
changeLoadingStata(false);
|
|
|
|
|
helpers.showErrorToast(res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
@ -319,7 +341,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*@author: Elham Rababah
|
|
|
|
|
*@Date:17/5/2020
|
|
|
|
|
@ -327,7 +348,8 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
*@return:
|
|
|
|
|
*@desc: loginProcessCompleted
|
|
|
|
|
*/
|
|
|
|
|
loginProcessCompleted(Map<String, dynamic> profile, Function changeLoadingStata) {
|
|
|
|
|
loginProcessCompleted(
|
|
|
|
|
Map<String, dynamic> profile, Function changeLoadingStata) {
|
|
|
|
|
changeLoadingStata(false);
|
|
|
|
|
sharedPref.setObj(DOCTOR_PROFILE, profile);
|
|
|
|
|
Navigator.of(context).pushNamed(HOME);
|
|
|
|
|
@ -375,7 +397,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
print("DoctorProfileList ${res['DoctorProfileList'][0]}");
|
|
|
|
|
loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata);
|
|
|
|
|
} else {
|
|
|
|
|
changeLoadingStata(false);
|
|
|
|
|
changeLoadingStata(false);
|
|
|
|
|
helpers.showErrorToast(res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|