pub struct SplitButtonTrailingButton {
pub key: Option<KeyRef>,
pub on_pressed: Option<Listener>,
pub checked: Option<bool>,
pub variant: SplitButtonVariant,
pub shapes: SplitButtonShapes,
pub content_padding: EdgeInsetsGeometry,
pub child: WidgetRef,
}Expand description
The trailing part of a split button: Compose’s SplitButtonDefaults.TrailingButton and its
tonal, outlined and elevated companions, both as a plain button and as a toggle.
Fields§
§key: Option<KeyRef>§on_pressed: Option<Listener>The action the part performs; None disables it.
checked: Option<bool>Whether the toggle is checked; None for the plain button.
variant: SplitButtonVariantThe part’s variant.
shapes: SplitButtonShapesThe shapes the part morphs between.
content_padding: EdgeInsetsGeometryThe padding between the part’s edge and its content.
child: WidgetRefThe part’s content.
Implementations§
Source§impl SplitButtonTrailingButton
impl SplitButtonTrailingButton
Sourcepub fn new<K>(
on_pressed: Option<Listener>,
child: impl IntoWidget<K>,
) -> SplitButtonTrailingButton
pub fn new<K>( on_pressed: Option<Listener>, child: impl IntoWidget<K>, ) -> SplitButtonTrailingButton
Creates a filled trailing part that acts as a button; Compose’s
TrailingButton(onClick, content).
Sourcepub fn toggle<K>(
checked: bool,
on_checked_change: Option<ValueChanged<bool>>,
child: impl IntoWidget<K>,
) -> SplitButtonTrailingButton
pub fn toggle<K>( checked: bool, on_checked_change: Option<ValueChanged<bool>>, child: impl IntoWidget<K>, ) -> SplitButtonTrailingButton
Creates a filled trailing part that acts as a toggle; Compose’s
TrailingButton(checked, onCheckedChange, content). A press calls on_checked_change with
!checked; None disables the part.
Sourcepub fn key(self, key: KeyRef) -> SplitButtonTrailingButton
pub fn key(self, key: KeyRef) -> SplitButtonTrailingButton
Dart key:.
Sourcepub fn variant(self, variant: SplitButtonVariant) -> SplitButtonTrailingButton
pub fn variant(self, variant: SplitButtonVariant) -> SplitButtonTrailingButton
Compose’s TonalTrailingButton, OutlinedTrailingButton and ElevatedTrailingButton.
Sourcepub fn shapes(self, shapes: SplitButtonShapes) -> SplitButtonTrailingButton
pub fn shapes(self, shapes: SplitButtonShapes) -> SplitButtonTrailingButton
Compose’s shapes: argument.
Sourcepub fn content_padding(
self,
content_padding: impl Into<EdgeInsetsGeometry>,
) -> SplitButtonTrailingButton
pub fn content_padding( self, content_padding: impl Into<EdgeInsetsGeometry>, ) -> SplitButtonTrailingButton
Compose’s contentPadding: argument.
Trait Implementations§
Source§impl Debug for SplitButtonTrailingButton
impl Debug for SplitButtonTrailingButton
Source§impl StatelessWidget for SplitButtonTrailingButton
impl StatelessWidget for SplitButtonTrailingButton
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 SplitButtonTrailingButton
impl !Send for SplitButtonTrailingButton
impl !Sync for SplitButtonTrailingButton
impl !UnwindSafe for SplitButtonTrailingButton
impl Forget for SplitButtonTrailingButton
impl Freeze for SplitButtonTrailingButtonwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
NonZero<u32>: Freeze,
*const (): Freeze,
*const RcInner<dyn OutlinedBorder> is !null: Freeze,
PhantomData<RcInner<dyn OutlinedBorder>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for SplitButtonTrailingButton
impl Unpin for SplitButtonTrailingButton
impl UnsafeUnpin for SplitButtonTrailingButtonwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const (): UnsafeUnpin,
*const RcInner<dyn OutlinedBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn OutlinedBorder>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<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.