pub struct ButtonGroup {
pub key: Option<KeyRef>,
pub children: Vec<WidgetRef>,
pub spacing: f64,
pub horizontal_alignment: MainAxisAlignment,
pub vertical_alignment: CrossAxisAlignment,
}Expand description
A row of related buttons.
Compose’s ButtonGroup, without its press expansion or its overflow menu (PORTING.md).
Fields§
§key: Option<KeyRef>§children: Vec<WidgetRef>The group’s buttons, which the app builds and styles.
spacing: f64The space between neighbouring buttons.
horizontal_alignment: MainAxisAlignmentHow the buttons are placed along the row.
vertical_alignment: CrossAxisAlignmentHow a button shorter than the group is aligned vertically; Compose’s default is the top.
Implementations§
Source§impl ButtonGroup
impl ButtonGroup
Sourcepub fn new(children: impl IntoIterator<Item = WidgetRef>) -> ButtonGroup
pub fn new(children: impl IntoIterator<Item = WidgetRef>) -> ButtonGroup
Creates a standard button group; Compose’s ButtonGroup(overflowIndicator, content) with
its default arrangement, and no overflow indicator.
Sourcepub fn connected(children: impl IntoIterator<Item = WidgetRef>) -> ButtonGroup
pub fn connected(children: impl IntoIterator<Item = WidgetRef>) -> ButtonGroup
Creates a connected button group, whose buttons sit 2 apart and are styled with
ButtonGroupDefaults’s connected shapes.
Sourcepub fn key(self, key: KeyRef) -> ButtonGroup
pub fn key(self, key: KeyRef) -> ButtonGroup
Dart key:.
Sourcepub fn spacing(self, spacing: f64) -> ButtonGroup
pub fn spacing(self, spacing: f64) -> ButtonGroup
Compose’s horizontalArrangement: argument, as the space between buttons and the row’s
alignment.
Sourcepub fn horizontal_alignment(
self,
horizontal_alignment: MainAxisAlignment,
) -> ButtonGroup
pub fn horizontal_alignment( self, horizontal_alignment: MainAxisAlignment, ) -> ButtonGroup
Compose’s horizontalArrangement: Arrangement.Start/Center/End.
Sourcepub fn vertical_alignment(
self,
vertical_alignment: CrossAxisAlignment,
) -> ButtonGroup
pub fn vertical_alignment( self, vertical_alignment: CrossAxisAlignment, ) -> ButtonGroup
Compose’s verticalAlignment: argument.
Trait Implementations§
Source§impl Debug for ButtonGroup
impl Debug for ButtonGroup
Source§impl StatelessWidget for ButtonGroup
impl StatelessWidget for ButtonGroup
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 ButtonGroup
impl !Send for ButtonGroup
impl !Sync for ButtonGroup
impl !UnwindSafe for ButtonGroup
impl Forget for ButtonGroup
impl Freeze for ButtonGroup
impl Move for ButtonGroup
impl Unpin for ButtonGroup
impl UnsafeUnpin for ButtonGroupwhere
*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.