Implements FocusTraversalPolicy and DefaultFocusTraversal features.#30076
Implements FocusTraversalPolicy and DefaultFocusTraversal features.#30076gspencergoog merged 4 commits intoflutter:masterfrom
Conversation
87debcd to
6a387a9
Compare
e80a1a5 to
4a73033
Compare
9c971c6 to
47d56a5
Compare
fb8f86b to
d9d481f
Compare
1921c25 to
bedde69
Compare
HansMuller
left a comment
There was a problem hiding this comment.
Looks pretty good. The only real issue is what to do with the policyData object.
There was a problem hiding this comment.
descendants => children, since "[FocusScopeNode]s group together their children"
There was a problem hiding this comment.
Actually, it's the other way around: they group descendants.
71d7de8 to
ff42af2
Compare
HansMuller
left a comment
There was a problem hiding this comment.
LGTM
I wasn't able to study the changes since the last time I went over this PR, but it does look like the one issue that needed to be addressed, policy data's home, has been taken care of.
|
|
||
| /// Clears the data associated with the given [FocusScopeNode] for this object. | ||
| /// | ||
| /// This is used to indicate that the focus policy has changed mode, and so |
|
I write a demo use DefaultFocusTraversal with ReadingOrderTraversalPolicy But , I find when you press up or down , sometimes , the focus will lose . I record a video https://vimeo.com/338635739 for show this bug My code is there : https://github.com/eyun-tv/flutter-tv/blob/master/lib/main.dart https://github.com/eyun-tv/flutter-tv/blob/master/lib/ui/util/video.dart How to fix this problem ? My flutter version is master and my tv box is android 9 |
Description
This implements a
DefaultFocusTraversalwidget to describe the focus traversal policy for its children, defined by aFocusTraversalPolicyobject from which custom policies may be created. Pre-defined policies include widget-order traversal, "reading order" traversal and directional traversal.Issues
Addresses #11344, #1608, #13264, and #1678
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?