pub struct SkipUnselectedRadioPolicy<T: Clone + PartialEq + 'static> { /* private fields */ }Expand description
A traversal policy that is the same as ReadingOrderTraversalPolicy except that it skips
the nodes of unselected radio buttons if there is a selected radio button.
If none of the radios is selected, this defaults to ReadingOrderTraversalPolicy for all
nodes.
This policy ensures that tabbing into a radio group only focuses the currently selected radio button and prevents focus from reaching unselected ones.
Trait Implementations§
Source§impl<T: Clone + PartialEq + 'static> DirectionalFocusTraversalPolicyMixin for SkipUnselectedRadioPolicy<T>
impl<T: Clone + PartialEq + 'static> DirectionalFocusTraversalPolicyMixin for SkipUnselectedRadioPolicy<T>
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<T: Clone + PartialEq + 'static> FocusTraversalPolicy for SkipUnselectedRadioPolicy<T>
impl<T: Clone + PartialEq + 'static> FocusTraversalPolicy for SkipUnselectedRadioPolicy<T>
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<T> !RefUnwindSafe for SkipUnselectedRadioPolicy<T>
impl<T> !Send for SkipUnselectedRadioPolicy<T>
impl<T> !Sync for SkipUnselectedRadioPolicy<T>
impl<T> !UnwindSafe for SkipUnselectedRadioPolicy<T>
impl<T> Forget for SkipUnselectedRadioPolicy<T>
impl<T> Freeze for SkipUnselectedRadioPolicy<T>where
*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,
NonZero<u32>: Freeze,
PhantomData<fn() -> RadioGroupState<T>>: Freeze,
T: Freeze,
impl<T> Move for SkipUnselectedRadioPolicy<T>
impl<T> Unpin for SkipUnselectedRadioPolicy<T>
impl<T> UnsafeUnpin for SkipUnselectedRadioPolicy<T>where
*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,
NonZeroU32Inner: UnsafeUnpin,
PhantomData<fn() -> RadioGroupState<T>>: UnsafeUnpin,
T: 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