FormField and TextField

The FormField widget works as a base class to create our own form field, used to integrate Form widget. Its functions are as follows:

  • To help the process of setting and retrieving the current input value
  • To validate the current input value
  • To provide feedback from validations

FormField can live without Form widgets, but this isn't not typical – only when we have, let's say, a single FormField onscreen.

Many built-in input widgets from Flutter come with a corresponding FormField widget implementation. For example, TextField widget has the  TextFormField. The TextFormField widget helps with access to the TextField value and also adds Form related behaviors to it (such as, validation).

A TextField widget lets the user enter text with a keyboard. The TextField widget exposes the onChanged method, which can be used to listen for changes in its current value. Another way to listen for changes is by using a controller (see the Using a controller section).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.23.101.60