@@ -184,6 +184,24 @@ class _EmailPasswordLoginPageState extends State<EmailPasswordLoginPage> {
184
184
@override
185
185
Widget build (BuildContext context) {
186
186
assert (! PerAccountStoreWidget .debugExistsOf (context));
187
+
188
+ final emailField = TextFormField (
189
+ key: _emailKey,
190
+ autofillHints: const [AutofillHints .email],
191
+ keyboardType: TextInputType .emailAddress,
192
+ // TODO(upstream?): Apparently pressing "next" doesn't count
193
+ // as user interaction, and validation isn't done.
194
+ autovalidateMode: AutovalidateMode .onUserInteraction,
195
+ validator: (value) {
196
+ if (value == null || value.trim ().isEmpty) {
197
+ return 'Please enter your email.' ;
198
+ }
199
+ // TODO(#35): validate is in the shape of an email
200
+ return null ;
201
+ },
202
+ textInputAction: TextInputAction .next,
203
+ decoration: const InputDecoration (labelText: 'Email address' ));
204
+
187
205
return Scaffold (
188
206
appBar: AppBar (title: const Text ('Log in' ),
189
207
bottom: _inProgress
@@ -198,23 +216,7 @@ class _EmailPasswordLoginPageState extends State<EmailPasswordLoginPage> {
198
216
child: Form (
199
217
child: AutofillGroup (
200
218
child: Column (mainAxisAlignment: MainAxisAlignment .center, children: [
201
- TextFormField (
202
- key: _emailKey,
203
- autofillHints: const [AutofillHints .email],
204
- keyboardType: TextInputType .emailAddress,
205
- // TODO(upstream?): Apparently pressing "next" doesn't count
206
- // as user interaction, and validation isn't done.
207
- autovalidateMode: AutovalidateMode .onUserInteraction,
208
- validator: (value) {
209
- if (value == null || value.trim ().isEmpty) {
210
- return 'Please enter your email.' ;
211
- }
212
- // TODO(#35): validate is in the shape of an email
213
- return null ;
214
- },
215
- textInputAction: TextInputAction .next,
216
- decoration: const InputDecoration (
217
- labelText: 'Email address' )),
219
+ emailField,
218
220
const SizedBox (height: 8 ),
219
221
TextFormField (
220
222
key: _passwordKey,
0 commit comments