Skip to main content

NavigationRailDestination

Struct NavigationRailDestination 

Source
pub struct NavigationRailDestination {
    pub icon: WidgetRef,
    pub selected_icon: WidgetRef,
    pub indicator_color: Option<Color>,
    pub indicator_shape: Option<ShapeBorderRef>,
    pub label: WidgetRef,
    pub padding: Option<EdgeInsetsGeometry>,
    pub disabled: bool,
}
Expand description

Defines a NavigationRail button that represents one “destination” view.

See also:

Fields§

§icon: WidgetRef

The icon of the destination.

Typically the icon is an Icon or an ImageIcon widget. If another type of widget is provided then it should configure itself to match the current IconTheme size and color.

If selected_icon is provided, this will only be displayed when the destination is not selected.

To make the NavigationRail more accessible, consider choosing an icon with a stroked and filled version, such as Icons::cloud and Icons::cloud_queue. The icon should be set to the stroked version and selected_icon to the filled version.

§selected_icon: WidgetRef

An alternative icon displayed when this destination is selected.

If this icon is not provided, the NavigationRail will display icon in either state. The size, color, and opacity of the NavigationRail::selected_icon_theme will still apply.

See also:

§indicator_color: Option<Color>

The color of the indicator_shape when this destination is selected.

§indicator_shape: Option<ShapeBorderRef>

The shape of the selection indicator.

§label: WidgetRef

The label for the destination.

The label must be provided when used with the NavigationRail. When the NavigationRail::label_type is NavigationRailLabelType::None, the label is still used for semantics, and may still be used if NavigationRail::extended is true.

§padding: Option<EdgeInsetsGeometry>

The amount of space to inset the destination item.

§disabled: bool

Indicates that this destination is inaccessible.

Implementations§

Source§

impl NavigationRailDestination

Source

pub fn new<I, L>( icon: impl IntoWidget<I>, label: impl IntoWidget<L>, ) -> NavigationRailDestination

Creates a destination that is used with NavigationRail::destinations.

When the NavigationRail::label_type is NavigationRailLabelType::None, the label is still used for semantics, and may still be used if NavigationRail::extended is true.

Source

pub fn selected_icon<K>( self, selected_icon: impl IntoWidget<K>, ) -> NavigationRailDestination

Dart NavigationRailDestination(selectedIcon:).

Source

pub fn indicator_color( self, indicator_color: Color, ) -> NavigationRailDestination

Dart NavigationRailDestination(indicatorColor:).

Source

pub fn indicator_shape( self, indicator_shape: impl Into<ShapeBorderRef>, ) -> NavigationRailDestination

Dart NavigationRailDestination(indicatorShape:).

Source

pub fn padding( self, padding: impl Into<EdgeInsetsGeometry>, ) -> NavigationRailDestination

Dart NavigationRailDestination(padding:).

Source

pub fn disabled(self, disabled: bool) -> NavigationRailDestination

Dart NavigationRailDestination(disabled:).

Trait Implementations§

Source§

impl Clone for NavigationRailDestination

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NavigationRailDestination

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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>