docs: clarify focus state requires Pressable wrapper#826
Open
tilucasoli wants to merge 2 commits intomainfrom
Open
docs: clarify focus state requires Pressable wrapper#826tilucasoli wants to merge 2 commits intomainfrom
tilucasoli wants to merge 2 commits intomainfrom
Conversation
- 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
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
4 tasks
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.
Related issue
N/A
Description
This PR improves documentation around widget state variants, specifically clarifying that focus state tracking requires a
Pressablewrapper orPressableBox, while hover and press states work automatically with any styled widget.Changes
controlling-widget-state.mdxtutorial to explain that hover/press states work automatically but focus requires wrapping withPressableonFocusedmethods in bothUtilityWidgetStateVariantMixinandWidgetStateVariantMixinexplaining this requirementdynamic-styling.mdxandbox.mdxsimple_box.dartexampleReview Checklist
Additional Information (optional)
Users may expect
onFocusedto work the same asonHoveredandonPressed, but focus handling requires aFocuswidget thatPressableprovides. This clarification helps avoid confusion.