pub struct TextSelectionToolbarTextButton {
pub key: Option<KeyRef>,
pub child: WidgetRef,
pub on_pressed: Option<Listener>,
pub padding: EdgeInsetsGeometry,
pub alignment: Option<AlignmentGeometry>,
}Expand description
A button styled like a Material native Android text selection menu button.
Fields§
§key: Option<KeyRef>§child: WidgetRefThe child of this button.
Usually a Text.
on_pressed: Option<Listener>Called when this button is pressed.
padding: EdgeInsetsGeometryThe padding between the button’s edge and its child.
In a standard Material TextSelectionToolbar, the padding depends on the
button’s position within the toolbar.
See also:
get_padding, which calculates the standard padding based on the button’s position.ButtonStyle::padding, which is where this padding is applied.
alignment: Option<AlignmentGeometry>The alignment of the button’s child.
By default, this will be Alignment::CENTER.
See also:
ButtonStyle::alignment, which is where this alignment is applied.
Implementations§
Source§impl TextSelectionToolbarTextButton
impl TextSelectionToolbarTextButton
Sourcepub fn new<K>(
child: impl IntoWidget<K>,
padding: impl Into<EdgeInsetsGeometry>,
) -> TextSelectionToolbarTextButton
pub fn new<K>( child: impl IntoWidget<K>, padding: impl Into<EdgeInsetsGeometry>, ) -> TextSelectionToolbarTextButton
Creates an instance of TextSelectionToolbarTextButton.
Sourcepub fn key(self, key: KeyRef) -> TextSelectionToolbarTextButton
pub fn key(self, key: KeyRef) -> TextSelectionToolbarTextButton
Dart TextSelectionToolbarTextButton(key:).
Sourcepub fn child<K>(
self,
child: impl IntoWidget<K>,
) -> TextSelectionToolbarTextButton
pub fn child<K>( self, child: impl IntoWidget<K>, ) -> TextSelectionToolbarTextButton
Dart TextSelectionToolbarTextButton.copyWith(child:).
Sourcepub fn on_pressed(self, on_pressed: Listener) -> TextSelectionToolbarTextButton
pub fn on_pressed(self, on_pressed: Listener) -> TextSelectionToolbarTextButton
Dart TextSelectionToolbarTextButton(onPressed:).
Sourcepub fn padding(
self,
padding: impl Into<EdgeInsetsGeometry>,
) -> TextSelectionToolbarTextButton
pub fn padding( self, padding: impl Into<EdgeInsetsGeometry>, ) -> TextSelectionToolbarTextButton
Dart TextSelectionToolbarTextButton.copyWith(padding:).
Sourcepub fn alignment(
self,
alignment: impl Into<AlignmentGeometry>,
) -> TextSelectionToolbarTextButton
pub fn alignment( self, alignment: impl Into<AlignmentGeometry>, ) -> TextSelectionToolbarTextButton
Dart TextSelectionToolbarTextButton(alignment:).
Sourcepub fn get_padding(index: usize, total: usize) -> EdgeInsetsGeometry
pub fn get_padding(index: usize, total: usize) -> EdgeInsetsGeometry
Returns the standard padding for a button at index out of a total number of buttons.
Standard Material TextSelectionToolbars have buttons with different
padding depending on their position in the toolbar.
Sourcepub fn copy_with(&self) -> TextSelectionToolbarTextButton
pub fn copy_with(&self) -> TextSelectionToolbarTextButton
Returns a copy of the current TextSelectionToolbarTextButton instance
with specific overrides.
Like Dart’s, the copy has no key.
Trait Implementations§
Source§impl StatelessWidget for TextSelectionToolbarTextButton
impl StatelessWidget for TextSelectionToolbarTextButton
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 TextSelectionToolbarTextButton
impl !Send for TextSelectionToolbarTextButton
impl !Sync for TextSelectionToolbarTextButton
impl !UnwindSafe for TextSelectionToolbarTextButton
impl Forget for TextSelectionToolbarTextButton
impl Freeze for TextSelectionToolbarTextButtonwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
NonZero<u32>: Freeze,
*const (): Freeze,
impl Move for TextSelectionToolbarTextButton
impl Unpin for TextSelectionToolbarTextButton
impl UnsafeUnpin for TextSelectionToolbarTextButtonwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const (): 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.