• Greg Spencer's avatar
    Add OrderedFocusTraversalPolicy and FocusTraversalGroup to all… (#49235) · 8ef5e2f0
    Greg Spencer authored
    This change adds a way to provide explicit focus order for a part of the widget tree.
    
    It adds FocusTraversalPolicyGroup, which in many ways is similar to DefaultFocusTraversal, except that it groups a widget subtree together so that those nodes are traversed as a group. DefaultFocusTraversal doesn't work as one would expect: If there is more than one DefaultFocusTraversal inside of a focus scope, the policy can change depending on which node was asked to move "next", which can cause unexpected behavior. The new grouping mechanism doesn't have that problem. I deprecate DefaultFocusTraversal in this PR.
    
    It also adds OrderedFocusTraversalPolicy, which is a policy that can be supplied to FocusTraversalPolicyGroup to set the policy for a sub-tree. It looks for FocusTraversalOrder inherited widgets, which use a FocusOrder to do the sorting. FocusOrder has two subclasses: NumericalFocusOrder (which sorts based on a double), and LexicalFocusOrder, which sorts based on a String.
    
    As part of doing this, I refactored the way FocusTraversalPolicy is implemented so that it has more default implementation methods, and exposes a new protected member: sortDescendants, which makes it easier for developers to make their own policy subclasses: they only need to implement sortDescendants to get a new ordering behavior, but can also still override any of the default implementation behaviors if they need different behavior.
    
    I was able to do this without breaking the API (AFAICT).
    8ef5e2f0
Name
Last commit
Last update
..
actions.dart Loading commit data...
animated_cross_fade.dart Loading commit data...
animated_list.dart Loading commit data...
animated_size.dart Loading commit data...
animated_switcher.dart Loading commit data...
annotated_region.dart Loading commit data...
app.dart Loading commit data...
async.dart Loading commit data...
automatic_keep_alive.dart Loading commit data...
banner.dart Loading commit data...
basic.dart Loading commit data...
binding.dart Loading commit data...
bottom_navigation_bar_item.dart Loading commit data...
color_filter.dart Loading commit data...
constants.dart Loading commit data...
container.dart Loading commit data...
debug.dart Loading commit data...
dismissible.dart Loading commit data...
disposable_build_context.dart Loading commit data...
drag_target.dart Loading commit data...
draggable_scrollable_sheet.dart Loading commit data...
editable_text.dart Loading commit data...
fade_in_image.dart Loading commit data...
focus_manager.dart Loading commit data...
focus_scope.dart Loading commit data...
focus_traversal.dart Loading commit data...
form.dart Loading commit data...
framework.dart Loading commit data...
gesture_detector.dart Loading commit data...
grid_paper.dart Loading commit data...
heroes.dart Loading commit data...
icon.dart Loading commit data...
icon_data.dart Loading commit data...
icon_theme.dart Loading commit data...
icon_theme_data.dart Loading commit data...
image.dart Loading commit data...
image_filter.dart Loading commit data...
image_icon.dart Loading commit data...
implicit_animations.dart Loading commit data...
inherited_model.dart Loading commit data...
inherited_notifier.dart Loading commit data...
inherited_theme.dart Loading commit data...
layout_builder.dart Loading commit data...
list_wheel_scroll_view.dart Loading commit data...
localizations.dart Loading commit data...
media_query.dart Loading commit data...
modal_barrier.dart Loading commit data...
navigation_toolbar.dart Loading commit data...
navigator.dart Loading commit data...
nested_scroll_view.dart Loading commit data...
notification_listener.dart Loading commit data...
orientation_builder.dart Loading commit data...
overlay.dart Loading commit data...
overscroll_indicator.dart Loading commit data...
page_storage.dart Loading commit data...
page_view.dart Loading commit data...
pages.dart Loading commit data...
performance_overlay.dart Loading commit data...
placeholder.dart Loading commit data...
platform_view.dart Loading commit data...
preferred_size.dart Loading commit data...
primary_scroll_controller.dart Loading commit data...
raw_keyboard_listener.dart Loading commit data...
route_notification_messages.dart Loading commit data...
routes.dart Loading commit data...
safe_area.dart Loading commit data...
scroll_activity.dart Loading commit data...
scroll_aware_image_provider.dart Loading commit data...
scroll_configuration.dart Loading commit data...
scroll_context.dart Loading commit data...
scroll_controller.dart Loading commit data...
scroll_metrics.dart Loading commit data...
scroll_notification.dart Loading commit data...
scroll_physics.dart Loading commit data...
scroll_position.dart Loading commit data...
scroll_position_with_single_context.dart Loading commit data...
scroll_simulation.dart Loading commit data...
scroll_view.dart Loading commit data...
scrollable.dart Loading commit data...
scrollbar.dart Loading commit data...
semantics_debugger.dart Loading commit data...
shortcuts.dart Loading commit data...
single_child_scroll_view.dart Loading commit data...
size_changed_layout_notifier.dart Loading commit data...
sliver.dart Loading commit data...
sliver_fill.dart Loading commit data...
sliver_layout_builder.dart Loading commit data...
sliver_persistent_header.dart Loading commit data...
sliver_prototype_extent_list.dart Loading commit data...
spacer.dart Loading commit data...
status_transitions.dart Loading commit data...
table.dart Loading commit data...
text.dart Loading commit data...
text_selection.dart Loading commit data...
texture.dart Loading commit data...
ticker_provider.dart Loading commit data...
title.dart Loading commit data...
transitions.dart Loading commit data...
tween_animation_builder.dart Loading commit data...
unique_widget.dart Loading commit data...
value_listenable_builder.dart Loading commit data...
viewport.dart Loading commit data...
visibility.dart Loading commit data...
widget_inspector.dart Loading commit data...
widget_span.dart Loading commit data...
will_pop_scope.dart Loading commit data...