merge-requests/104/head
Mohammad ALjammal 6 years ago
commit 3495e6bc9b

@ -23,6 +23,7 @@ Helpers helpers = Helpers();
class LoginForm extends StatefulWidget with DrAppToastMsg { class LoginForm extends StatefulWidget with DrAppToastMsg {
LoginForm({this.changeLoadingStata}); LoginForm({this.changeLoadingStata});
final Function changeLoadingStata; final Function changeLoadingStata;
@override @override
@ -85,7 +86,7 @@ class _LoginFormState extends State<LoginForm> {
return null; return null;
}, },
onSaved: (value) { onSaved: (value) {
userInfo.UserID = value; userInfo.UserID = value.trim();
}, },
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(focusPass); FocusScope.of(context).requestFocus(focusPass);
@ -337,6 +338,7 @@ class _LoginFormState extends State<LoginForm> {
userInfo.ProjectID = projectsList[index]["ID"]; userInfo.ProjectID = projectsList[index]["ID"];
projectIdController.text = projectsList[index]['Name']; projectIdController.text = projectsList[index]['Name'];
}); });
FocusScope.of(context).requestFocus(focusProject);
primaryFocus.unfocus();
} }
} }

@ -21,7 +21,9 @@ Helpers helpers = Helpers();
class VerifyAccount extends StatefulWidget { class VerifyAccount extends StatefulWidget {
VerifyAccount({this.changeLoadingStata}); VerifyAccount({this.changeLoadingStata});
final Function changeLoadingStata; final Function changeLoadingStata;
@override @override
_VerifyAccountState createState() => _VerifyAccountState(); _VerifyAccountState createState() => _VerifyAccountState();
} }
@ -37,8 +39,9 @@ class _VerifyAccountState extends State<VerifyAccount> {
Future _loggedUserFuture; Future _loggedUserFuture;
var _loggedUser; var _loggedUser;
AuthProvider authProv; AuthProvider authProv;
bool _isInit =true; bool _isInit = true;
var model; var model;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -93,25 +96,30 @@ class _VerifyAccountState extends State<VerifyAccount> {
MainAxisAlignment.spaceAround, MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth * 0.20, width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField( child: TextFormField(
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
style: buildTextStyle(), style: buildTextStyle(),
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: decoration: buildInputDecoration(context),
buildInputDecoration(context), onSaved: (val) {
onSaved: (val) { verifyAccountFormValue['digit1'] = val;
verifyAccountFormValue['digit1'] = },
val; validator: validateCodeDigit,
}, onFieldSubmitted: (_) {
validator: validateCodeDigit, FocusScope.of(context)
onFieldSubmitted: (_) { .requestFocus(focusD2);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context) FocusScope.of(context)
.requestFocus(focusD2); .requestFocus(focusD2);
}, }
)), },
),
),
Container( Container(
width: SizeConfig.realScreenWidth * 0.20, width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField( child: TextFormField(
@ -131,6 +139,12 @@ class _VerifyAccountState extends State<VerifyAccount> {
FocusScope.of(context) FocusScope.of(context)
.requestFocus(focusD3); .requestFocus(focusD3);
}, },
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD3);
}
},
validator: validateCodeDigit), validator: validateCodeDigit),
), ),
Container( Container(
@ -152,6 +166,12 @@ class _VerifyAccountState extends State<VerifyAccount> {
FocusScope.of(context) FocusScope.of(context)
.requestFocus(focusD4); .requestFocus(focusD4);
}, },
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD4);
}
},
validator: validateCodeDigit)), validator: validateCodeDigit)),
Container( Container(
width: SizeConfig.realScreenWidth * 0.20, width: SizeConfig.realScreenWidth * 0.20,

Loading…
Cancel
Save