Login form made easier to use - instead of hiding the keyboard and then pressing the 'LOGIN' button a user can click 'done' on their keyboard in the password field and the login API function is called.

This commit is contained in:
Felix 2019-07-03 11:21:53 +01:00
parent eaa254e0e0
commit debf66ed17
10 changed files with 230 additions and 6 deletions

View file

@ -157,6 +157,11 @@ class LoginPageState extends State<LoginPage> {
color: Colors.grey[800],
fontWeight: FontWeight.bold,
),
onSubmitted: (_) {
SystemChannels.textInput.invokeMethod('TextInput.hide');
requestLoginAPI(context, _emailController.text,
_passwordController.text);
},
),
),
Padding(
@ -168,6 +173,10 @@ class LoginPageState extends State<LoginPage> {
SystemChannels.textInput.invokeMethod('TextInput.hide');
requestLoginAPI(context, _emailController.text,
_passwordController.text);
// showDialog(
// barrierDismissible: false,
// );
// print("pressed");
},
child: Text("LOGIN",
style: