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>,
}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>Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
alignment: Option<MainAxisAlignment>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>Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
How much horizontal space is available.
Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
Overrides the surrounding ButtonBarThemeData::button_text_theme.
Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
Overrides the surrounding ButtonThemeDataโs minimum width.
Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
Overrides the surrounding ButtonThemeDataโs height.
Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
Overrides the surrounding ButtonThemeDataโs padding.
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>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>Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
Defines the vertical direction of the children if they overflow.
Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
The spacing between buttons when they overflow.
children: Vec<WidgetRef>Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.
The buttons to arrange horizontally.
Implementationsยง
Sourceยงimpl ButtonBar
impl ButtonBar
Sourcepub fn new() -> ButtonBar
pub fn new() -> ButtonBar
Creates a button bar; Dartโs optional named arguments are the setters.
Sourcepub fn alignment(self, alignment: MainAxisAlignment) -> ButtonBar
pub fn alignment(self, alignment: MainAxisAlignment) -> ButtonBar
Dart ButtonBar(alignment:).
Sourcepub fn main_axis_size(self, main_axis_size: MainAxisSize) -> ButtonBar
pub fn main_axis_size(self, main_axis_size: MainAxisSize) -> ButtonBar
Dart ButtonBar(mainAxisSize:).
Dart ButtonBar(buttonTextTheme:).
Dart ButtonBar(buttonMinWidth:).
Dart ButtonBar(buttonHeight:).
Dart ButtonBar(buttonPadding:).
Dart ButtonBar(buttonAlignedDropdown:).
Sourcepub fn layout_behavior(
self,
layout_behavior: ButtonBarLayoutBehavior,
) -> ButtonBar
pub fn layout_behavior( self, layout_behavior: ButtonBarLayoutBehavior, ) -> ButtonBar
Dart ButtonBar(layoutBehavior:).
Sourcepub fn overflow_direction(
self,
overflow_direction: VerticalDirection,
) -> ButtonBar
pub fn overflow_direction( self, overflow_direction: VerticalDirection, ) -> ButtonBar
Dart ButtonBar(overflowDirection:).
Dart ButtonBar(overflowButtonSpacing:).
Sourcepub fn children(
self,
children: impl IntoIterator<Item = WidgetRef>,
) -> ButtonBar
pub fn children( self, children: impl IntoIterator<Item = WidgetRef>, ) -> ButtonBar
Dart ButtonBar(children:).
Trait Implementationsยง
Sourceยงimpl StatelessWidget for ButtonBar
impl StatelessWidget for ButtonBar
Sourceยงfn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
Sourceยงfn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
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)
fn debug_check_constructor(&self)
Sourceยงfn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
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
impl Move for ButtonBar
impl Unpin for ButtonBar
impl UnsafeUnpin for ButtonBarwhere
*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> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Sourceยงimpl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Sourceยงfn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.