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,
|
key: _formKey,
|
||||||
child: DidvanTextField(
|
child: DidvanTextField(
|
||||||
onChanged: (value) => state.password = value,
|
onChanged: (value) => state.password = value,
|
||||||
|
onSubmitted: (value) => _onLogin(context),
|
||||||
autoFocus: true,
|
autoFocus: true,
|
||||||
title: 'کلمه عبور',
|
title: 'کلمه عبور',
|
||||||
hintText: 'کلمه عبور',
|
hintText: 'کلمه عبور',
|
||||||
|
|
@ -51,7 +52,7 @@ class _PasswordInputState extends State<PasswordInput> {
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
DidvanButton(
|
DidvanButton(
|
||||||
onPressed: () => _onPressed(context),
|
onPressed: () => _onLogin(context),
|
||||||
title: 'ورود',
|
title: 'ورود',
|
||||||
),
|
),
|
||||||
const SizedBox(
|
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()) {
|
if (!_formKey.currentState!.validate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ class _UsernameInputState extends State<UsernameInput> {
|
||||||
title: 'نام کاربری یا شماره موبایل',
|
title: 'نام کاربری یا شماره موبایل',
|
||||||
hintText: 'نام کاربری یا شماره موبایل',
|
hintText: 'نام کاربری یا شماره موبایل',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
onSubmitted: (value) => state.confirmUsername(),
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value.contains(' ')) {
|
if (value.contains(' ')) {
|
||||||
return 'نام کاربری باید بدون فاصله باشد';
|
return 'نام کاربری باید بدون فاصله باشد';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue