Skip to main content

SkipUnselectedRadioPolicy

Struct SkipUnselectedRadioPolicy 

Source
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>

Source§

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

Source§

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>>, )

Dart’s DirectionalFocusTraversalPolicyMixin.changedScope.
Source§

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>

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

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

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, )

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

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>>, )

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

Dart’s DirectionalFocusTraversalPolicyMixin._onEdgeForDirection.
Source§

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 more
Source§

impl<T: Clone + PartialEq + 'static> FocusTraversalPolicy for SkipUnselectedRadioPolicy<T>

Source§

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

Source§

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 more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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

Source§

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

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>

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

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

Dart’s FocusTraversalPolicy._findInitialFocus.
Source§

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 more
Source§

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 more
Source§

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 more

Auto 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>

§

impl<T> Move for SkipUnselectedRadioPolicy<T>

§

impl<T> Unpin for SkipUnselectedRadioPolicy<T>
where T: Unpin, Rc<dyn Fn(&mut App, AnyFocusNode, Option<ScrollPositionAlignmentPolicy>, Option<f64>, Option<Duration>, Option<Rc<dyn Curve>>)>: Unpin, *const u8 is !null: Unpin, NonZero<u32>: Unpin, Rc<Keep>: Unpin, &'static FocusNodeVTable: Unpin,

§

impl<T> UnsafeUnpin for SkipUnselectedRadioPolicy<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>