Forms with Flutter - Roberta Goodhead | Flutter Europe

Flutter Europe · 7K views · 2020 · 33:43

Open on YouTube

Software (other)UX & UI designtalk

Why Stack Overflow recommends it

Stack Overflow users link it in answers about TextField versus TextFormField and custom FormField widgets, as a fuller explanation of how Flutter's Form system works.

Recommended by 1 people across 1 different months, 2020 to 2021.

What it is

A conference talk from Flutter Europe in which Roberta Goodhead walks through building forms in Flutter. It starts with validation, focus behaviour and styling, then moves to wrapping any widget in Flutter's Form system via FormField.

What people said

Recommends Shubham Gupta · 2020-05 · Stack Overflow · on “Custom Error Message Widget in TextFields - Flutter”

I would suggest you use FormField for this design FormField<String>( builder: (FormFieldState<String> state) { return Column( children: <Widget>[ //Your custom text field Offstage( offstage:!state.hasError, child: //your custom error widget ), ], ), ), You can check this medium story [LINK] for more details. Here [this video] is another great video on the same topic from Flutter Europe Hope this helps!

Cites Suragch · 2020-03 · Stack Overflow · on “What is the difference between TextFormField and TextField?”

Short answer If you don't know what you need, then use a TextField . This is the most basic Flutter widget for getting text input from a user. It's the one you should master first. TextField Using a TextField is an easy way to allow user input. TextField( decoration: InputDecoration( hintText: 'Name' ), ); [LINK] To get the text that the user entered, you can either get notified every time there is a change like this: TextField( decoration: InputDecoration( hintText: 'Name' ), onChanged: (text) { // do something with text }, ), Or you can use a TextEditingController , as described here [LINK] . This will give you access to the text state. TextFormField If you find yourself needing to validat

Cites Son Nguyen · 2021-05 · Stack Overflow · on “What is the difference between TextFormField and TextField?”

I think this might be the most concise and simple explanation about the differences between the two. From the material library [LINK] : TextField : A material design text field. TextFormField : A FormField that contains a TextField . Similarly, you can wrap FormField around any cupertino input component such as CupertinoTextField Below is an example about a custom CheckboxFormField , which is a FormField that wraps around the material design component Checkbox : // A custom CheckboxFormField, which is similar to the built-in TextFormField bool agreedToTerms = false; FormField( initialValue: false, validator: (value) { if (value == false) { return 'You must agree to the terms of service.'; }