|
|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/home/home_item.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
@ -16,6 +15,8 @@ DrAppToastMsg toastMsg = DrAppToastMsg();
|
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
|
|
|
|
|
|
class VerifyAccount extends StatefulWidget {
|
|
|
|
|
VerifyAccount({this.changeLoadingStata});
|
|
|
|
|
final Function changeLoadingStata;
|
|
|
|
|
@override
|
|
|
|
|
_VerifyAccountState createState() => _VerifyAccountState();
|
|
|
|
|
}
|
|
|
|
|
@ -72,6 +73,10 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration:
|
|
|
|
|
buildInputDecoration(context),
|
|
|
|
|
onSaved: (val) {
|
|
|
|
|
@ -83,6 +88,11 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration:
|
|
|
|
|
buildInputDecoration(context),
|
|
|
|
|
onSaved: (val) {
|
|
|
|
|
@ -93,6 +103,10 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration:
|
|
|
|
|
buildInputDecoration(context),
|
|
|
|
|
onSaved: (val) {
|
|
|
|
|
@ -103,6 +117,10 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.20,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration:
|
|
|
|
|
buildInputDecoration(context),
|
|
|
|
|
onSaved: (val) {
|
|
|
|
|
@ -123,7 +141,8 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
// buildSizedBox(),
|
|
|
|
|
RaisedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
verifyAccount(authProv);
|
|
|
|
|
verifyAccount(
|
|
|
|
|
authProv, widget.changeLoadingStata);
|
|
|
|
|
// Navigator.of(context).pushNamed(HOME);
|
|
|
|
|
},
|
|
|
|
|
elevation: 0.0,
|
|
|
|
|
@ -133,7 +152,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
'Verfiy'.toUpperCase(),
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize:
|
|
|
|
|
@ -163,6 +181,19 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*@author: Elham Rababah
|
|
|
|
|
*@Date:19/4/2020
|
|
|
|
|
*@param:
|
|
|
|
|
*@return:
|
|
|
|
|
*@desc: change the style for the input field
|
|
|
|
|
*/
|
|
|
|
|
TextStyle buildTextStyle() {
|
|
|
|
|
return TextStyle(
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 3,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String validateCodeDigit(value) {
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
return 'Please enter your Password';
|
|
|
|
|
@ -205,7 +236,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*@author: Elham Rababah
|
|
|
|
|
*@Date:15/4/2020
|
|
|
|
|
@ -213,8 +243,10 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
*@return:
|
|
|
|
|
*@desc: verify Account func call sendActivationCodeByOtpNotificationType service
|
|
|
|
|
*/
|
|
|
|
|
verifyAccount(AuthProvider authProv) {
|
|
|
|
|
verifyAccount(AuthProvider authProv, Function changeLoadingStata) {
|
|
|
|
|
if (verifyAccountForm.currentState.validate()) {
|
|
|
|
|
changeLoadingStata(true);
|
|
|
|
|
|
|
|
|
|
verifyAccountForm.currentState.save();
|
|
|
|
|
final activationCode = verifyAccountFormValue['digit1'] +
|
|
|
|
|
verifyAccountFormValue['digit2'] +
|
|
|
|
|
@ -237,18 +269,24 @@ class _VerifyAccountState extends State<VerifyAccount> {
|
|
|
|
|
"IsLoginForDoctorApp": true,
|
|
|
|
|
"IsSilentLogIN": false
|
|
|
|
|
};
|
|
|
|
|
changeLoadingStata(true);
|
|
|
|
|
Navigator.of(context).pushNamed(HOME);
|
|
|
|
|
|
|
|
|
|
// authProv.memberCheckActivationCodeNew(model).then((res) {
|
|
|
|
|
// changeLoadingStata(false);
|
|
|
|
|
// if (res['MessageStatus'] == 1) {
|
|
|
|
|
// Navigator.of(context).pushNamed(HOME);
|
|
|
|
|
// } else {
|
|
|
|
|
// helpers.showErrorToast(res['ErrorEndUserMessage']);
|
|
|
|
|
// }
|
|
|
|
|
// }).catchError((err) {
|
|
|
|
|
// changeLoadingStata(false);
|
|
|
|
|
|
|
|
|
|
authProv.memberCheckActivationCodeNew(model).then((res) {
|
|
|
|
|
// Navigator.of(context).pushNamed(VERIFY_ACCOUNT);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
Navigator.of(context).pushNamed(HOME);
|
|
|
|
|
} else {
|
|
|
|
|
helpers.showErrorToast(res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print('$err');
|
|
|
|
|
helpers.showErrorToast();
|
|
|
|
|
});
|
|
|
|
|
// print('$err');
|
|
|
|
|
// helpers.showErrorToast();
|
|
|
|
|
// });
|
|
|
|
|
} else {
|
|
|
|
|
// changeLoadingStata(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|