Converted GuessInput to a StatefulWidget in Stateful widgets tutorial - #13653
Draft
MuthuGCodes wants to merge 5 commits into
Draft
Converted GuessInput to a StatefulWidget in Stateful widgets tutorial#13653MuthuGCodes wants to merge 5 commits into
MuthuGCodes wants to merge 5 commits into
Conversation
Collaborator
|
Staged preview of the updated docs.flutter.dev site (updated for commit 9e52d59): https://flutter-docs-prod--docs-pr13653-mg-guessinput-issue-3th19sc7.web.app |
Collaborator
|
Staged preview of the updated flutter.dev site (updated for commit 9e52d59): https://flutter-dev-230821--www-pr13653-mg-guessinput-issue-hk3zmet1.web.app |
lamek
requested changes
Aug 3, 2026
| @@ -0,0 +1,8 @@ | |||
| { | |||
Contributor
There was a problem hiding this comment.
This file is local to your IDE. You can remove it.
lamek
reviewed
Aug 3, 2026
| 1. Implement `dispose()` to clean up `_textEditingController` and `_focusNode`. | ||
|
|
||
| Your modified `GuessInput` widget should look like this: | ||
|
|
Contributor
There was a problem hiding this comment.
For code excerpts in the tutorial we follow these steps:
- Write the updated code into the corresponding /examples/FWE/lib file.
- Add a tag like the following:
<?code-excerpt "fwe/birdle/lib/step5_main.dart (GuessInput)"?> - Run the following command: dart run dash_site --site=docs refresh-excerpts
Following this flow will ensure the code snippets in our .MD files are always up to date with what is in the /examples dir.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebuilding
GamePage(after converting it toStatefulWidget) recreatesGuessInput(which is currently aStatelessWidget), resetting its internalFocusNodeandTextEditingControllerand breaking focus behavior. The fix is to convertGuessInputto aStatefulWidgetin the "Stateful widgets" tutorial step and the example code.Fixes #13392