Skip to content

docs: clarify focus state requires Pressable wrapper#826

Open
tilucasoli wants to merge 2 commits intomainfrom
docs/widget-state-variants-focus-behavior
Open

docs: clarify focus state requires Pressable wrapper#826
tilucasoli wants to merge 2 commits intomainfrom
docs/widget-state-variants-focus-behavior

Conversation

@tilucasoli
Copy link
Collaborator

@tilucasoli tilucasoli commented Jan 9, 2026

Related issue

N/A

Description

This PR improves documentation around widget state variants, specifically clarifying that focus state tracking requires a Pressable wrapper or PressableBox, while hover and press states work automatically with any styled widget.

Changes

  • Updated controlling-widget-state.mdx tutorial to explain that hover/press states work automatically but focus requires wrapping with Pressable
  • Added docstrings to onFocused methods in both UtilityWidgetStateVariantMixin and WidgetStateVariantMixin explaining this requirement
  • Minor improvements to dynamic-styling.mdx and box.mdx
  • Updated simple_box.dart example

Review Checklist

  • Testing: Have you tested your changes, including unit tests and integration tests for affected code?
  • Breaking Changes: Does this change introduce breaking changes affecting existing code or users?
  • Documentation Updates: Are all relevant documentation files (e.g. README, API docs) updated to reflect the changes in this PR?
  • Website Updates: Is the website containing the updates you make on documentation?

Additional Information (optional)

Users may expect onFocused to work the same as onHovered and onPressed, but focus handling requires a Focus widget that Pressable provides. This clarification helps avoid confusion.

- Update controlling-widget-state.mdx tutorial to explain that hover/press work automatically but focus requires Pressable
- Add docstrings to onFocused methods explaining the Pressable requirement
- Update dynamic-styling.mdx and box.mdx with minor improvements
- Update simple_box example
@vercel
Copy link
Contributor

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mix-docs Ready Ready Preview, Comment Feb 11, 2026 2:46am

@docs-page
Copy link

docs-page bot commented Jan 9, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/mix~826

Documentation is deployed and generated using docs.page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation examples mix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant