pub struct WidgetOrderTraversalPolicy { /* private fields */ }Expand description
A FocusTraversalPolicy that traverses the focus order in widget hierarchy order.
This policy is used when the order desired is the order in which widgets are created in the widget hierarchy.
See also:
FocusNode, for a description of the focus system.FocusTraversalGroup, a widget that groups together and imposes a traversal policy on theFocusnodes below it in the widget hierarchy.ReadingOrderTraversalPolicy, a policy that describes the order as the natural “reading order” for the currentDirectionality.DirectionalFocusTraversalPolicyMixin, a trait that implements focus traversal in a direction.OrderedTraversalPolicy, a policy that describes the order explicitly usingFocusTraversalOrderwidgets.
Implementations§
Source§impl WidgetOrderTraversalPolicy
impl WidgetOrderTraversalPolicy
Sourcepub fn new(app: &mut App) -> Ref<WidgetOrderTraversalPolicy>
pub fn new(app: &mut App) -> Ref<WidgetOrderTraversalPolicy>
Constructs a traversal policy that orders widgets for keyboard traversal based on the widget hierarchy order.
Dart’s optional requestFocusCallback argument is
FocusTraversalPolicy::set_request_focus_callback.
Trait Implementations§
Source§impl DirectionalFocusTraversalPolicyMixin for WidgetOrderTraversalPolicy
impl DirectionalFocusTraversalPolicyMixin for WidgetOrderTraversalPolicy
Source§fn directional_data(
self: Handle<Self>,
app: &App,
) -> &DirectionalFocusTraversalPolicyMixinData
fn directional_data( self: Handle<Self>, app: &App, ) -> &DirectionalFocusTraversalPolicyMixinData
Dart’s
DirectionalFocusTraversalPolicyMixin fields, held under the field directional.Source§fn directional_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut DirectionalFocusTraversalPolicyMixinData
fn directional_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut DirectionalFocusTraversalPolicyMixinData
See
directional_data.Source§fn invalidate_scope_data(
self: Handle<Self>,
app: &mut App,
node: Handle<FocusScopeNode>,
)
fn invalidate_scope_data( self: Handle<Self>, app: &mut App, node: Handle<FocusScopeNode>, )
Dart’s
DirectionalFocusTraversalPolicyMixin.invalidateScopeData.Source§fn changed_scope(
self: Handle<Self>,
app: &mut App,
node: Option<AnyFocusNode>,
old_scope: Option<Handle<FocusScopeNode>>,
)
fn changed_scope( self: Handle<Self>, app: &mut App, node: Option<AnyFocusNode>, old_scope: Option<Handle<FocusScopeNode>>, )
Dart’s
DirectionalFocusTraversalPolicyMixin.changedScope.Source§fn find_first_focus_in_direction(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
direction: TraversalDirection,
) -> Option<AnyFocusNode>
fn find_first_focus_in_direction( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, direction: TraversalDirection, ) -> Option<AnyFocusNode>
Dart’s
DirectionalFocusTraversalPolicyMixin.findFirstFocusInDirection.Source§fn find_next_focus_in_direction(
self: Handle<Self>,
app: &mut App,
focused_child: AnyFocusNode,
traversal_descendants: Vec<AnyFocusNode>,
direction: TraversalDirection,
forward: bool,
) -> Option<AnyFocusNode>
fn find_next_focus_in_direction( self: Handle<Self>, app: &mut App, focused_child: AnyFocusNode, traversal_descendants: Vec<AnyFocusNode>, direction: TraversalDirection, forward: bool, ) -> Option<AnyFocusNode>
Dart’s
DirectionalFocusTraversalPolicyMixin._findNextFocusInDirection.Source§fn pop_policy_data_if_needed(
self: Handle<Self>,
app: &mut App,
direction: TraversalDirection,
nearest_scope: Handle<FocusScopeNode>,
group_node: Option<Handle<FocusTraversalGroupNode>>,
) -> bool
fn pop_policy_data_if_needed( self: Handle<Self>, app: &mut App, direction: TraversalDirection, nearest_scope: Handle<FocusScopeNode>, group_node: Option<Handle<FocusTraversalGroupNode>>, ) -> bool
Updates the policy data to keep the previously visited node so that we can avoid
hysteresis when we change directions in navigation. Read more
Source§fn pop_or_invalidate(
self: Handle<Self>,
app: &mut App,
direction: TraversalDirection,
nearest_scope: Handle<FocusScopeNode>,
group_node: Option<Handle<FocusTraversalGroupNode>>,
) -> bool
fn pop_or_invalidate( self: Handle<Self>, app: &mut App, direction: TraversalDirection, nearest_scope: Handle<FocusScopeNode>, group_node: Option<Handle<FocusTraversalGroupNode>>, ) -> bool
Dart’s
popOrInvalidate closure inside _popPolicyDataIfNeeded. Returns true if it
successfully popped the history.Source§fn push_policy_data(
self: Handle<Self>,
app: &mut App,
direction: TraversalDirection,
nearest_scope: Handle<FocusScopeNode>,
focused_child: AnyFocusNode,
)
fn push_policy_data( self: Handle<Self>, app: &mut App, direction: TraversalDirection, nearest_scope: Handle<FocusScopeNode>, focused_child: AnyFocusNode, )
Dart’s
DirectionalFocusTraversalPolicyMixin._pushPolicyData.Source§fn request_traversal_focus_in_direction(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
node: AnyFocusNode,
nearest_scope: Handle<FocusScopeNode>,
direction: TraversalDirection,
group_node: Option<Handle<FocusTraversalGroupNode>>,
) -> bool
fn request_traversal_focus_in_direction( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, node: AnyFocusNode, nearest_scope: Handle<FocusScopeNode>, direction: TraversalDirection, group_node: Option<Handle<FocusTraversalGroupNode>>, ) -> bool
Dart’s
DirectionalFocusTraversalPolicyMixin._requestTraversalFocusInDirection.Source§fn request_focus(
self: Handle<Self>,
app: &mut App,
node: AnyFocusNode,
alignment_policy: Option<ScrollPositionAlignmentPolicy>,
group_node: Option<Handle<FocusTraversalGroupNode>>,
)
fn request_focus( self: Handle<Self>, app: &mut App, node: AnyFocusNode, alignment_policy: Option<ScrollPositionAlignmentPolicy>, group_node: Option<Handle<FocusTraversalGroupNode>>, )
Dart’s
DirectionalFocusTraversalPolicyMixin._requestFocus.Source§fn on_edge_for_direction(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
focused_child: AnyFocusNode,
group_node: Option<Handle<FocusTraversalGroupNode>>,
direction: TraversalDirection,
scope: Option<Handle<FocusScopeNode>>,
) -> bool
fn on_edge_for_direction( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, focused_child: AnyFocusNode, group_node: Option<Handle<FocusTraversalGroupNode>>, direction: TraversalDirection, scope: Option<Handle<FocusScopeNode>>, ) -> bool
Dart’s
DirectionalFocusTraversalPolicyMixin._onEdgeForDirection.Source§fn in_direction(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
direction: TraversalDirection,
) -> bool
fn in_direction( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, direction: TraversalDirection, ) -> bool
Focuses the next widget in the given
direction in the FocusScope that contains the
current_node. Read moreSource§impl FocusTraversalPolicy for WidgetOrderTraversalPolicy
impl FocusTraversalPolicy for WidgetOrderTraversalPolicy
Source§fn focus_traversal_policy_data(
self: Handle<Self>,
app: &App,
) -> &FocusTraversalPolicyData
fn focus_traversal_policy_data( self: Handle<Self>, app: &App, ) -> &FocusTraversalPolicyData
Dart’s
FocusTraversalPolicy fields, held under the field policy
(focus_traversal_policy_accessors!).Source§fn focus_traversal_policy_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut FocusTraversalPolicyData
fn focus_traversal_policy_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut FocusTraversalPolicyData
Source§fn invalidate_scope_data(
self: Handle<Self>,
app: &mut App,
node: Handle<FocusScopeNode>,
)
fn invalidate_scope_data( self: Handle<Self>, app: &mut App, node: Handle<FocusScopeNode>, )
Clears the data associated with the given
FocusScopeNode for this object. Read moreSource§fn changed_scope(
self: Handle<Self>,
app: &mut App,
node: Option<AnyFocusNode>,
old_scope: Option<Handle<FocusScopeNode>>,
)
fn changed_scope( self: Handle<Self>, app: &mut App, node: Option<AnyFocusNode>, old_scope: Option<Handle<FocusScopeNode>>, )
This is called whenever the given
node is re-parented into a new scope, so that the
policy has a chance to update or invalidate any cached data that it maintains per scope
about the node. Read moreSource§fn find_first_focus_in_direction(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
direction: TraversalDirection,
) -> Option<AnyFocusNode>
fn find_first_focus_in_direction( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, direction: TraversalDirection, ) -> Option<AnyFocusNode>
Returns the first node in the given
direction that should receive focus if there is no
current focus in the scope to which the current_node belongs. Read moreSource§fn in_direction(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
direction: TraversalDirection,
) -> bool
fn in_direction( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, direction: TraversalDirection, ) -> bool
Focuses the next widget in the given
direction in the focus scope that contains the
given current_node. Read moreSource§fn sort_descendants(
self: Handle<Self>,
_app: &mut App,
descendants: Vec<AnyFocusNode>,
_current_node: AnyFocusNode,
) -> Vec<AnyFocusNode>
fn sort_descendants( self: Handle<Self>, _app: &mut App, descendants: Vec<AnyFocusNode>, _current_node: AnyFocusNode, ) -> Vec<AnyFocusNode>
Sorts the given
descendants into focus order. Read moreSource§fn as_policy(self: Handle<Self>) -> AnyFocusTraversalPolicy
fn as_policy(self: Handle<Self>) -> AnyFocusTraversalPolicy
This policy as the erased
AnyFocusTraversalPolicy — what to pass where a Dart API
takes a FocusTraversalPolicy.Source§fn request_focus_callback(
self: Handle<Self>,
app: &App,
) -> TraversalRequestFocusCallback
fn request_focus_callback( self: Handle<Self>, app: &App, ) -> TraversalRequestFocusCallback
Source§fn set_request_focus_callback(
self: Handle<Self>,
app: &mut App,
value: TraversalRequestFocusCallback,
)
fn set_request_focus_callback( self: Handle<Self>, app: &mut App, value: TraversalRequestFocusCallback, )
Source§fn request_tab_traversal_focus(
self: Handle<Self>,
app: &mut App,
node: AnyFocusNode,
alignment_policy: Option<ScrollPositionAlignmentPolicy>,
alignment: Option<f64>,
duration: Option<Duration>,
curve: Option<Rc<dyn Curve>>,
forward: bool,
) -> bool
fn request_tab_traversal_focus( self: Handle<Self>, app: &mut App, node: AnyFocusNode, alignment_policy: Option<ScrollPositionAlignmentPolicy>, alignment: Option<f64>, duration: Option<Duration>, curve: Option<Rc<dyn Curve>>, forward: bool, ) -> bool
Request focus on a focus node as a result of a tab traversal. Read more
Source§fn find_first_focus(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
ignore_current_focus: bool,
) -> Option<AnyFocusNode>
fn find_first_focus( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, ignore_current_focus: bool, ) -> Option<AnyFocusNode>
Returns the node that should receive focus if focus is traversing forwards, and there is
no current focus. Read more
Source§fn find_last_focus(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
ignore_current_focus: bool,
) -> AnyFocusNode
fn find_last_focus( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, ignore_current_focus: bool, ) -> AnyFocusNode
Returns the node that should receive focus if focus is traversing backwards, and there
is no current focus.
Source§fn find_initial_focus(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
from_end: bool,
ignore_current_focus: bool,
) -> AnyFocusNode
fn find_initial_focus( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, from_end: bool, ignore_current_focus: bool, ) -> AnyFocusNode
Dart’s
FocusTraversalPolicy._findInitialFocus.Source§fn next(self: Handle<Self>, app: &mut App, current_node: AnyFocusNode) -> bool
fn next(self: Handle<Self>, app: &mut App, current_node: AnyFocusNode) -> bool
Focuses the next widget in the focus scope that contains the given
current_node. Read moreSource§fn previous(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
) -> bool
fn previous( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, ) -> bool
Focuses the previous widget in the focus scope that contains the given
current_node. Read moreSource§fn move_focus(
self: Handle<Self>,
app: &mut App,
current_node: AnyFocusNode,
forward: bool,
) -> bool
fn move_focus( self: Handle<Self>, app: &mut App, current_node: AnyFocusNode, forward: bool, ) -> bool
Moves the focus to the next node in the
FocusScopeNode nearest to the current_node
argument, either in a forward or reverse direction, depending on the value of the
forward argument. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WidgetOrderTraversalPolicy
impl !Send for WidgetOrderTraversalPolicy
impl !Sync for WidgetOrderTraversalPolicy
impl !UnwindSafe for WidgetOrderTraversalPolicy
impl Forget for WidgetOrderTraversalPolicy
impl Freeze for WidgetOrderTraversalPolicywhere
*const RcInner<dyn Fn(&mut App, AnyFocusNode, Option<ScrollPositionAlignmentPolicy>, Option<f64>, Option<Duration>, Option<Rc<dyn Curve>>)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyFocusNode, Option<ScrollPositionAlignmentPolicy>, Option<f64>, Option<Duration>, Option<Rc<dyn Curve>>)>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<(Retained<Handle<FocusScopeNode>>, DirectionalPolicyData)>: Freeze,
impl Move for WidgetOrderTraversalPolicy
impl Unpin for WidgetOrderTraversalPolicy
impl UnsafeUnpin for WidgetOrderTraversalPolicywhere
*const RcInner<dyn Fn(&mut App, AnyFocusNode, Option<ScrollPositionAlignmentPolicy>, Option<f64>, Option<Duration>, Option<Rc<dyn Curve>>)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyFocusNode, Option<ScrollPositionAlignmentPolicy>, Option<f64>, Option<Duration>, Option<Rc<dyn Curve>>)>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(Retained<Handle<FocusScopeNode>>, DirectionalPolicyData)>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more