diff --git a/lib/pages/authentication/screens/password.dart b/lib/pages/authentication/screens/password.dart index ca8b5c0..daada7e 100644 --- a/lib/pages/authentication/screens/password.dart +++ b/lib/pages/authentication/screens/password.dart @@ -29,6 +29,7 @@ class _PasswordInputState extends State { key: _formKey, child: DidvanTextField( onChanged: (value) => state.password = value, + onSubmitted: (value) => _onLogin(context), autoFocus: true, title: 'کلمه عبور', hintText: 'کلمه عبور', @@ -51,7 +52,7 @@ class _PasswordInputState extends State { ), const Spacer(), DidvanButton( - onPressed: () => _onPressed(context), + onPressed: () => _onLogin(context), title: 'ورود', ), const SizedBox( @@ -61,7 +62,7 @@ class _PasswordInputState extends State { ); } - Future _onPressed(BuildContext context) async { + Future _onLogin(BuildContext context) async { if (!_formKey.currentState!.validate()) { return; } diff --git a/lib/pages/authentication/screens/username.dart b/lib/pages/authentication/screens/username.dart index 0e7b1f6..fb0bf7d 100644 --- a/lib/pages/authentication/screens/username.dart +++ b/lib/pages/authentication/screens/username.dart @@ -29,6 +29,7 @@ class _UsernameInputState extends State { title: 'نام کاربری یا شماره موبایل', hintText: 'نام کاربری یا شماره موبایل', textAlign: TextAlign.center, + onSubmitted: (value) => state.confirmUsername(), validator: (value) { if (value.contains(' ')) { return 'نام کاربری باید بدون فاصله باشد';