Skip to content

Commit 13556ce

Browse files
docs: Update code format and style
1 parent d11ea07 commit 13556ce

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,29 +172,30 @@ FormBuilder(
172172
child: Column(
173173
children: [
174174
FormBuilderTextField(
175-
key: _emailFieldKey
175+
key: _emailFieldKey,
176176
name: 'email',
177-
decoration: InputDecoration(labelText: 'Email'),
177+
decoration: const InputDecoration(labelText: 'Email'),
178178
validator: FormBuilderValidators.compose([
179179
FormBuilderValidators.required(),
180180
FormBuilderValidators.email(),
181181
]),
182182
),
183-
RaisedButton(
184-
child: Text('Submit'),
183+
ElevatedButton(
184+
child: const Text('Submit'),
185185
onPressed: () async {
186186
if(await checkIfEmailExists()){
187187
// Either invalidate using Form Key
188-
_formKey.currentState?.invalidateField(name: 'email', errorText: 'Email already taken.');
188+
_formKey.currentState?.invalidateField(
189+
name: 'email', errorText: 'Email already taken.');
189190
// OR invalidate using Field Key
190-
_emailFieldKey.currentState?.invalidate('Email already taken');
191+
_emailFieldKey.currentState
192+
?.invalidate('Email already taken');
191193
}
192194
},
193195
),
194196
],
195197
),
196198
),
197-
198199
```
199200

200201
##### Option 2 - Using InputDecoration.errorText

0 commit comments

Comments
 (0)