Page URL
https://docs.flutter.dev/learn/pathway/tutorial/stateful-widget
Page source
https://github.com/flutter/website/blob/main/sites/docs/src/content/learn/pathway/tutorial/stateful-widget.md
Describe the problem
Currently, GuessInput is implemented as a StatelessWidget. Consequently, every state change triggers a rebuild that creates an entirely new text input instance. This prevents _focusNode.requestFocus() from taking effect, which is not the intended behavior for this tutorial.
This can be resolved when converting this into a StatefulWidget.
Expected fix
Convert the GuessInput class into a StatefulWidget.
Additional context
No response
I would like to fix this problem.
Page URL
https://docs.flutter.dev/learn/pathway/tutorial/stateful-widget
Page source
https://github.com/flutter/website/blob/main/sites/docs/src/content/learn/pathway/tutorial/stateful-widget.md
Describe the problem
Currently,
GuessInputis implemented as aStatelessWidget. Consequently, every state change triggers a rebuild that creates an entirely new text input instance. This prevents_focusNode.requestFocus()from taking effect, which is not the intended behavior for this tutorial.This can be resolved when converting this into a
StatefulWidget.Expected fix
Convert the
GuessInputclass into aStatefulWidget.Additional context
No response
I would like to fix this problem.