@@ -175,27 +175,30 @@ class _EmailPasswordLoginPageState extends State<EmailPasswordLoginPage> {
175
175
child: ConstrainedBox (
176
176
constraints: const BoxConstraints (maxWidth: 400 ),
177
177
child: Form (
178
- child: Column (mainAxisAlignment: MainAxisAlignment .center, children: [
179
- TextFormField (
180
- key: _emailKey,
181
- keyboardType: TextInputType .emailAddress,
182
- decoration: const InputDecoration (
183
- labelText: 'Email address' )),
184
- const SizedBox (height: 8 ),
185
- TextFormField (
186
- key: _passwordKey,
187
- obscureText: _obscurePassword,
188
- keyboardType: TextInputType .visiblePassword,
189
- decoration: InputDecoration (
190
- labelText: 'Password' ,
191
- suffixIcon: Semantics (label: 'Hide password' , toggled: _obscurePassword,
192
- child: IconButton (
193
- onPressed: _handlePasswordVisibilityPress,
194
- icon: _obscurePassword ? const Icon (Icons .visibility_off) : const Icon (Icons .visibility))))),
195
- const SizedBox (height: 8 ),
196
- ElevatedButton (
197
- onPressed: _submit,
198
- child: const Text ('Log in' )),
199
- ]))))));
178
+ child: AutofillGroup (
179
+ child: Column (mainAxisAlignment: MainAxisAlignment .center, children: [
180
+ TextFormField (
181
+ key: _emailKey,
182
+ autofillHints: const [AutofillHints .email],
183
+ keyboardType: TextInputType .emailAddress,
184
+ decoration: const InputDecoration (
185
+ labelText: 'Email address' )),
186
+ const SizedBox (height: 8 ),
187
+ TextFormField (
188
+ key: _passwordKey,
189
+ autofillHints: const [AutofillHints .password],
190
+ obscureText: _obscurePassword,
191
+ keyboardType: TextInputType .visiblePassword,
192
+ decoration: InputDecoration (
193
+ labelText: 'Password' ,
194
+ suffixIcon: Semantics (label: 'Hide password' , toggled: _obscurePassword,
195
+ child: IconButton (
196
+ onPressed: _handlePasswordVisibilityPress,
197
+ icon: _obscurePassword ? const Icon (Icons .visibility_off) : const Icon (Icons .visibility))))),
198
+ const SizedBox (height: 8 ),
199
+ ElevatedButton (
200
+ onPressed: _submit,
201
+ child: const Text ('Log in' )),
202
+ ])))))));
200
203
}
201
204
}
0 commit comments