Skip to content

GuessInput class should be a StatelfulWidget #13392

@Tyi77

Description

@Tyi77

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.

  • I will try and fix this problem on docs.flutter.dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    from.page-issueReported in a reader-filed concernp2-mediumNecessary but not urgent concern. Resolve when possible.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions