mirror of
https://github.com/Iconica-Development/flutter_login_widget.git
synced 2025-05-19 13:43:44 +02:00
feat: add AutoFillGroup to support native password managers
This commit is contained in:
parent
fb80dbb196
commit
bb65426298
2 changed files with 120 additions and 107 deletions
|
@ -153,11 +153,16 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
|
||||||
),
|
),
|
||||||
child: Form(
|
child: Form(
|
||||||
key: _formKey,
|
key: _formKey,
|
||||||
|
child: AutofillGroup(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
options.emailInputContainerBuilder(
|
options.emailInputContainerBuilder(
|
||||||
TextFormField(
|
TextFormField(
|
||||||
|
autofillHints: const [
|
||||||
|
AutofillHints.email,
|
||||||
|
AutofillHints.username,
|
||||||
|
],
|
||||||
textAlign:
|
textAlign:
|
||||||
options.emailTextAlign ?? TextAlign.start,
|
options.emailTextAlign ?? TextAlign.start,
|
||||||
onChanged: _updateCurrentEmail,
|
onChanged: _updateCurrentEmail,
|
||||||
|
@ -172,8 +177,11 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
|
||||||
),
|
),
|
||||||
options.passwordInputContainerBuilder(
|
options.passwordInputContainerBuilder(
|
||||||
TextFormField(
|
TextFormField(
|
||||||
textAlign:
|
autofillHints: const [
|
||||||
options.passwordTextAlign ?? TextAlign.start,
|
AutofillHints.password,
|
||||||
|
],
|
||||||
|
textAlign: options.passwordTextAlign ??
|
||||||
|
TextAlign.start,
|
||||||
obscureText: _obscurePassword,
|
obscureText: _obscurePassword,
|
||||||
onChanged: _updateCurrentPassword,
|
onChanged: _updateCurrentPassword,
|
||||||
validator:
|
validator:
|
||||||
|
@ -226,7 +234,8 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
|
||||||
],
|
],
|
||||||
AnimatedBuilder(
|
AnimatedBuilder(
|
||||||
animation: _formValid,
|
animation: _formValid,
|
||||||
builder: (context, _) => options.loginButtonBuilder(
|
builder: (context, _) =>
|
||||||
|
options.loginButtonBuilder(
|
||||||
context,
|
context,
|
||||||
_handleLogin,
|
_handleLogin,
|
||||||
!_formValid.value,
|
!_formValid.value,
|
||||||
|
@ -259,6 +268,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -129,10 +129,12 @@ class _ForgotPasswordFormState extends State<ForgotPasswordForm> {
|
||||||
),
|
),
|
||||||
child: Form(
|
child: Form(
|
||||||
key: _formKey,
|
key: _formKey,
|
||||||
|
child: AutofillGroup(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: options.emailInputContainerBuilder(
|
child: options.emailInputContainerBuilder(
|
||||||
TextFormField(
|
TextFormField(
|
||||||
|
autofillHints: const [AutofillHints.email],
|
||||||
textAlign:
|
textAlign:
|
||||||
options.emailTextAlign ?? TextAlign.start,
|
options.emailTextAlign ?? TextAlign.start,
|
||||||
focusNode: _focusNode,
|
focusNode: _focusNode,
|
||||||
|
@ -150,6 +152,7 @@ class _ForgotPasswordFormState extends State<ForgotPasswordForm> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
if (options.forgotPasswordSpacerOptions.spacerBeforeButton !=
|
if (options.forgotPasswordSpacerOptions.spacerBeforeButton !=
|
||||||
null) ...[
|
null) ...[
|
||||||
Spacer(
|
Spacer(
|
||||||
|
|
Loading…
Reference in a new issue