|
|
|
|
@ -97,8 +97,9 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
userInfo.UserID = value.trim();
|
|
|
|
|
},
|
|
|
|
|
onFieldSubmitted: (_) {
|
|
|
|
|
FocusScope.of(context).requestFocus(focusPass);
|
|
|
|
|
FocusScope.of(context).nextFocus();
|
|
|
|
|
},
|
|
|
|
|
autofocus: false,
|
|
|
|
|
),
|
|
|
|
|
buildSizedBox(),
|
|
|
|
|
TextFormField(
|
|
|
|
|
@ -117,7 +118,7 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
userInfo.Password = value;
|
|
|
|
|
},
|
|
|
|
|
onFieldSubmitted: (_) {
|
|
|
|
|
FocusScope.of(context).requestFocus(focusProject);
|
|
|
|
|
FocusScope.of(context).nextFocus();
|
|
|
|
|
helpers.showCupertinoPicker(
|
|
|
|
|
context, projectsList, 'Name', onSelectProject);
|
|
|
|
|
},
|
|
|
|
|
@ -188,17 +189,26 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
*/
|
|
|
|
|
InputDecoration buildInputDecoration(BuildContext context, hint, asset) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
prefixIcon: Image.asset(asset),
|
|
|
|
|
hintText: hint,
|
|
|
|
|
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide: BorderSide(color: Theme.of(context).primaryColor),
|
|
|
|
|
));
|
|
|
|
|
prefixIcon: Image.asset(asset),
|
|
|
|
|
hintText: hint,
|
|
|
|
|
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide: BorderSide(color: Theme.of(context).primaryColor),
|
|
|
|
|
),
|
|
|
|
|
errorBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide: BorderSide(color: Theme.of(context).errorColor),
|
|
|
|
|
),
|
|
|
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide: BorderSide(color: Theme.of(context).errorColor),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SizedBox buildSizedBox() {
|
|
|
|
|
@ -208,6 +218,11 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
login(context, AuthProvider authProv, Function changeLoadingStata) {
|
|
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
|
|
|
|
|
|
|
|
// if (!currentFocus.hasPrimaryFocus) {
|
|
|
|
|
// currentFocus.unfocus();
|
|
|
|
|
// }
|
|
|
|
|
changeLoadingStata(true);
|
|
|
|
|
if (loginFormKey.currentState.validate()) {
|
|
|
|
|
loginFormKey.currentState.save();
|
|
|
|
|
@ -221,7 +236,7 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
sharedPref.setString(TOKEN, res['LogInTokenID']);
|
|
|
|
|
print("token" + res['LogInTokenID']);
|
|
|
|
|
|
|
|
|
|
Navigator.of(context).pushNamed(VERIFICATION_METHODS);
|
|
|
|
|
Navigator.of(context).pushReplacementNamed(VERIFICATION_METHODS);
|
|
|
|
|
} else {
|
|
|
|
|
// handel error
|
|
|
|
|
// widget.showCenterShortLoadingToast("watting");
|
|
|
|
|
@ -231,7 +246,7 @@ class _LoginFormState extends State<LoginForm> {
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print('$err');
|
|
|
|
|
changeLoadingStata(false);
|
|
|
|
|
helpers.showErrorToast();
|
|
|
|
|
helpers.showErrorToast(err);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
changeLoadingStata(false);
|
|
|
|
|
|