Create an expandable FAB

Focus and text fields

Retrieve the value of a text field

Cookbook

Forms

Retrieve the value of a text field

1. Create a TextEditingController

2. Supply the TextEditingController to a TextField

3. Display the current value of the text field

Interactive example

In this recipe,
learn how to retrieve the text a user has entered into a text field
using the following steps:

Create a TextEditingController.

Supply the TextEditingController to a TextField.

Display the current value of the text field.

1. Create a TextEditingController

To retrieve the text a user has entered into a text field,
create a TextEditingController
and supply it to a TextField or TextFormField.