I\'d like to supply an initial value to a text field and redraw it with an empty value to clear the text. What\'s the best approach to do that with Flutter\'s APIs?
You don't have to define a separate variable in the widget scope, just do it inline:
TextField( controller: TextEditingController()..text = 'Your initial value', onChanged: (text) => {}, )