Skip to main content

ButtonBar

Struct ButtonBar 

Source
pub struct ButtonBar {
    pub key: Option<KeyRef>,
    pub alignment: Option<MainAxisAlignment>,
    pub main_axis_size: Option<MainAxisSize>,
    pub button_text_theme: Option<ButtonTextTheme>,
    pub button_min_width: Option<f64>,
    pub button_height: Option<f64>,
    pub button_padding: Option<EdgeInsetsGeometry>,
    pub button_aligned_dropdown: Option<bool>,
    pub layout_behavior: Option<ButtonBarLayoutBehavior>,
    pub overflow_direction: Option<VerticalDirection>,
    pub overflow_button_spacing: Option<f64>,
    pub children: Vec<WidgetRef>,
}
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

Expand description

An end-aligned row of buttons, laying out into a column if there is not enough horizontal space.

ButtonBar has been replaced by a more efficient widget, OverflowBar.

Places the buttons horizontally according to button_padding. The children are laid out in a row with MainAxisAlignment::End. When the directionality is LTR, the button barโ€™s children are right justified and the last child becomes the rightmost child. When it is RTL the children are left justified and the last child becomes the leftmost child.

If the button barโ€™s width exceeds the maximum width constraint on the widget, it aligns its buttons in a column.

Fieldsยง

ยงkey: Option<KeyRef>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

ยงalignment: Option<MainAxisAlignment>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

How the children should be placed along the horizontal axis.

ยงmain_axis_size: Option<MainAxisSize>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

How much horizontal space is available.

ยงbutton_text_theme: Option<ButtonTextTheme>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

Overrides the surrounding ButtonBarThemeData::button_text_theme.

ยงbutton_min_width: Option<f64>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

Overrides the surrounding ButtonThemeDataโ€™s minimum width.

ยงbutton_height: Option<f64>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

Overrides the surrounding ButtonThemeDataโ€™s height.

ยงbutton_padding: Option<EdgeInsetsGeometry>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

Overrides the surrounding ButtonThemeDataโ€™s padding.

ยงbutton_aligned_dropdown: Option<bool>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

Overrides the surrounding ButtonThemeDataโ€™s aligned-dropdown setting.

ยงlayout_behavior: Option<ButtonBarLayoutBehavior>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

Defines whether the button bar sizes itself with a minimum size constraint or padding.

ยงoverflow_direction: Option<VerticalDirection>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

Defines the vertical direction of the children if they overflow.

ยงoverflow_button_spacing: Option<f64>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

The spacing between buttons when they overflow.

ยงchildren: Vec<WidgetRef>
๐Ÿ‘ŽDeprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

The buttons to arrange horizontally.

Implementationsยง

Sourceยง

impl ButtonBar

Source

pub fn new() -> ButtonBar

Creates a button bar; Dartโ€™s optional named arguments are the setters.

Source

pub fn key(self, key: KeyRef) -> ButtonBar

Dart ButtonBar(key:).

Source

pub fn alignment(self, alignment: MainAxisAlignment) -> ButtonBar

Dart ButtonBar(alignment:).

Source

pub fn main_axis_size(self, main_axis_size: MainAxisSize) -> ButtonBar

Dart ButtonBar(mainAxisSize:).

Source

pub fn button_text_theme(self, button_text_theme: ButtonTextTheme) -> ButtonBar

Dart ButtonBar(buttonTextTheme:).

Source

pub fn button_min_width(self, button_min_width: f64) -> ButtonBar

Dart ButtonBar(buttonMinWidth:).

Source

pub fn button_height(self, button_height: f64) -> ButtonBar

Dart ButtonBar(buttonHeight:).

Source

pub fn button_padding( self, button_padding: impl Into<EdgeInsetsGeometry>, ) -> ButtonBar

Dart ButtonBar(buttonPadding:).

Source

pub fn button_aligned_dropdown(self, button_aligned_dropdown: bool) -> ButtonBar

Dart ButtonBar(buttonAlignedDropdown:).

Source

pub fn layout_behavior( self, layout_behavior: ButtonBarLayoutBehavior, ) -> ButtonBar

Dart ButtonBar(layoutBehavior:).

Source

pub fn overflow_direction( self, overflow_direction: VerticalDirection, ) -> ButtonBar

Dart ButtonBar(overflowDirection:).

Source

pub fn overflow_button_spacing(self, overflow_button_spacing: f64) -> ButtonBar

Dart ButtonBar(overflowButtonSpacing:).

Source

pub fn children( self, children: impl IntoIterator<Item = WidgetRef>, ) -> ButtonBar

Dart ButtonBar(children:).

Trait Implementationsยง

Sourceยง

impl Debug for ButtonBar

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl Default for ButtonBar

Sourceยง

fn default() -> ButtonBar

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl StatelessWidget for ButtonBar

Sourceยง

fn key(&self) -> Option<&KeyRef>

Sourceยง

fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef

Describes the part of the user interface represented by this widget. Read more
Sourceยง

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dartโ€™s debugFillProperties: the properties a dump shows for this widget, in Dartโ€™s order. Dartโ€™s Widget base only sets the dense tree style, which the framework does.
Sourceยง

fn debug_check_constructor(&self)

Dartโ€™s constructor asserts that relate two or more arguments. Read more
Sourceยง

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Dartโ€™s this is PreferredSizeWidget: a widget that implements PreferredSizeWidget answers with itself, which is what a parent asking an erased child for its preferred size reads.

Auto Trait Implementationsยง

ยง

impl !RefUnwindSafe for ButtonBar

ยง

impl !Send for ButtonBar

ยง

impl !Sync for ButtonBar

ยง

impl !UnwindSafe for ButtonBar

ยง

impl Forget for ButtonBar

ยง

impl Freeze for ButtonBar
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const u8 is !null: Freeze, PhantomData<Rc<dyn Widget>>: Freeze,

ยง

impl Move for ButtonBar

ยง

impl Unpin for ButtonBar
where Rc<dyn Key>: Unpin, *const u8 is !null: Unpin, Rc<dyn Widget>: Unpin,

ยง

impl UnsafeUnpin for ButtonBar
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Rc<dyn Widget>>: UnsafeUnpin,

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ยง

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<W> IntoWidget<StatelessKind> for W
where W: StatelessWidget,

Sourceยง

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
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