D1APP-43 submit action added
This commit is contained in:
parent
09eb21841a
commit
f692eb77fb
|
|
@ -29,6 +29,7 @@ class _PasswordInputState extends State<PasswordInput> {
|
|||
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<PasswordInput> {
|
|||
),
|
||||
const Spacer(),
|
||||
DidvanButton(
|
||||
onPressed: () => _onPressed(context),
|
||||
onPressed: () => _onLogin(context),
|
||||
title: 'ورود',
|
||||
),
|
||||
const SizedBox(
|
||||
|
|
@ -61,7 +62,7 @@ class _PasswordInputState extends State<PasswordInput> {
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> _onPressed(BuildContext context) async {
|
||||
Future<void> _onLogin(BuildContext context) async {
|
||||
if (!_formKey.currentState!.validate()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class _UsernameInputState extends State<UsernameInput> {
|
|||
title: 'نام کاربری یا شماره موبایل',
|
||||
hintText: 'نام کاربری یا شماره موبایل',
|
||||
textAlign: TextAlign.center,
|
||||
onSubmitted: (value) => state.confirmUsername(),
|
||||
validator: (value) {
|
||||
if (value.contains(' ')) {
|
||||
return 'نام کاربری باید بدون فاصله باشد';
|
||||
|
|
|
|||
Loading…
Reference in New Issue