Retrieve the value of a text field

Add Material touch ripples

Focus and text fields

Cookbook

Forms

Focus and text fields

Focus a text field as soon as it’s visible

Focus a text field when a button is tapped

1. Create a FocusNode
2. Pass the FocusNode to a TextField
3. Give focus to the TextField when a button is tapped

Interactive example

When a text field is selected and accepting input,
it is said to have “focus.”
Generally, users shift focus to a text field by tapping,
and developers shift focus to a text field programmatically by
using the tools described in this recipe.