Skip to main content

ButtonStyle

Struct ButtonStyle 

Source
pub struct ButtonStyle {
Show 28 fields pub text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>, pub background_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub foreground_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub shadow_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub surface_tint_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub elevation: Option<WidgetStatePropertyRef<Option<f64>>>, pub padding: Option<WidgetStatePropertyRef<Option<EdgeInsetsGeometry>>>, pub minimum_size: Option<WidgetStatePropertyRef<Option<Size>>>, pub fixed_size: Option<WidgetStatePropertyRef<Option<Size>>>, pub maximum_size: Option<WidgetStatePropertyRef<Option<Size>>>, pub icon_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub icon_size: Option<WidgetStatePropertyRef<Option<f64>>>, pub icon_alignment: Option<IconAlignment>, pub side: Option<WidgetStatePropertyRef<Option<BorderSide>>>, pub shape: Option<WidgetStatePropertyRef<Option<OutlinedBorderRef>>>, pub mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>, pub visual_density: Option<VisualDensity>, pub tap_target_size: Option<MaterialTapTargetSize>, pub animation_duration: Option<Duration>, pub enable_feedback: Option<bool>, pub alignment: Option<AlignmentGeometry>, pub splash_factory: Option<InteractiveInkFeatureFactoryRef>, pub background_builder: Option<ButtonLayerBuilder>, pub foreground_builder: Option<ButtonLayerBuilder>, pub size_variant: Option<ButtonSizeVariant>, pub icon_button_width: Option<IconButtonWidthVariant>, pub shape_variant: Option<ButtonShapeVariant>,
}
Expand description

The visual properties that most buttons have in common.

Buttons and their themes have a ButtonStyle property which defines the visual properties whose default values are to be overridden. The default values are defined by the individual button widgets and are typically based on overall theme’s ThemeData::color_scheme and ThemeData::text_theme.

All of the ButtonStyle properties are null by default.

Many of the ButtonStyle properties are WidgetStateProperty objects which resolve to different values depending on the button’s state. For example the Color properties are defined with WidgetStateProperty<Option<Color>> and can resolve to different colors depending on if the button is pressed, hovered, focused, disabled, etc.

These properties can override the default value for just one state or all of them. For example to create an ElevatedButton whose background color is the color scheme’s primary color with 50% opacity, but only when the button is pressed, one could write:

ElevatedButton::new(on_pressed, Text::new("Fly me to the moon"))
    .style(ButtonStyle::new().background_color(
        <dyn WidgetStateProperty<Option<Color>>>::resolve_with(move |states| {
            if states.contains(&WidgetState::Pressed) {
                return Some(primary.with_opacity(0.5));
            }
            None // Use the component's default.
        }),
    ))

In this case the background color for all other button states would fallback to the ElevatedButton’s default values. To unconditionally set the button’s background_color for all states one could write:

ElevatedButton::new(on_pressed, Text::new("Let me play among the stars"))
    .style(ButtonStyle::new().background_color(Rc::new(WidgetStatePropertyAll::new(
        Some(Colors::GREEN.primary()),
    ))))

Configuring a ButtonStyle directly makes it possible to very precisely control the button’s visual attributes for all states. This level of control is typically required when a custom “branded” look and feel is desirable. However, in many cases it’s useful to make relatively sweeping changes based on a few initial parameters with simple values. The button style_from() methods enable such sweeping changes. See for example: ElevatedButton::style_from, FilledButton::style_from, OutlinedButton::style_from, TextButton::style_from.

For example, to override the default text and icon colors for a TextButton, as well as its overlay color, with all of the standard opacity adjustments for the pressed, focused, and hovered states, one could write:

TextButton::new(on_pressed, Text::new("Let me see what spring is like"))
    .style(TextButton::style_from().foreground_color(Colors::GREEN.primary()))

To configure all of the application’s text buttons in the same way, specify the overall theme’s text_button_theme.

§Material 3 button types

Material Design 3 specifies five types of common buttons. Flutter provides support for these using the following button classes:

TypeFlutter implementation
ElevatedElevatedButton
FilledFilledButton
Filled TonalFilledButton::tonal
OutlinedOutlinedButton
TextTextButton

See also:

  • ElevatedButtonTheme, the theme for ElevatedButtons.
  • FilledButtonTheme, the theme for FilledButtons.
  • OutlinedButtonTheme, the theme for OutlinedButtons.
  • TextButtonTheme, the theme for TextButtons.

Fields§

§text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>

The style for a button’s Text widget descendants.

The color of the text_style is typically not used directly, the foreground_color is used instead.

§background_color: Option<WidgetStatePropertyRef<Option<Color>>>

The button’s background fill color.

§foreground_color: Option<WidgetStatePropertyRef<Option<Color>>>

The color for the button’s Text widget descendants.

This color is typically used instead of the color of the text_style. All of the components that compute defaults from ButtonStyle values compute a default foreground_color and use that instead of the text_style’s color.

§overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>

The highlight color that’s typically used to indicate that the button is focused, hovered, or pressed.

§shadow_color: Option<WidgetStatePropertyRef<Option<Color>>>

The shadow color of the button’s Material.

The material’s elevation shadow can be difficult to see for dark themes, so by default the button classes add a semi-transparent overlay to indicate elevation. See ThemeData::apply_elevation_overlay_color.

§surface_tint_color: Option<WidgetStatePropertyRef<Option<Color>>>

The surface tint color of the button’s Material.

See Material::surface_tint_color for more details.

§elevation: Option<WidgetStatePropertyRef<Option<f64>>>

The elevation of the button’s Material.

§padding: Option<WidgetStatePropertyRef<Option<EdgeInsetsGeometry>>>

The padding between the button’s boundary and its child.

The vertical aspect of the default or user-specified padding is adjusted automatically based on visual_density.

When the visual density is VisualDensity::COMPACT, the top and bottom insets are reduced by 8 pixels or set to 0 pixels if the result of the reduced padding is negative. For example: the visual density defaults to VisualDensity::COMPACT on desktop and web, so if the provided padding is 16 pixels on the top and bottom, it will be reduced to 8 pixels on the top and bottom. If the provided padding is 4 pixels, the result will be no padding on the top and bottom.

When the visual density is VisualDensity::COMFORTABLE, the top and bottom insets are reduced by 4 pixels or set to 0 pixels if the result of the reduced padding is negative.

When the visual density is VisualDensity::STANDARD the top and bottom insets are not changed. The visual density defaults to VisualDensity::STANDARD on mobile.

See ThemeData::visual_density for more details.

§minimum_size: Option<WidgetStatePropertyRef<Option<Size>>>

The minimum size of the button itself before applying visual_density.

The size of the rectangle the button lies within may be larger per tap_target_size.

This value must be less than or equal to maximum_size.

The minimum size is adjusted automatically based on visual_density.

When visual density is VisualDensity::COMPACT, the minimum size is reduced by 8 pixels on both dimensions.

When visual density is VisualDensity::COMFORTABLE, the minimum size is minimum_size reduced by 4 pixels on both dimensions.

When visual density is VisualDensity::STANDARD, the minimum size is minimum_size.

§fixed_size: Option<WidgetStatePropertyRef<Option<Size>>>

The button’s size.

This size is still constrained by the style’s minimum_size and maximum_size. Fixed size dimensions whose value is f64::INFINITY are ignored.

The size of the rectangle the button lies within may be larger per tap_target_size.

To specify buttons with a fixed width and the default height use Size::from_width(320.0). Similarly, to specify a fixed height and the default width use Size::from_height(100.0).

§maximum_size: Option<WidgetStatePropertyRef<Option<Size>>>

The maximum size of the button itself.

A Size::INFINITE or null value for this property means that the button’s maximum size is not constrained.

This value must be greater than or equal to minimum_size.

§icon_color: Option<WidgetStatePropertyRef<Option<Color>>>

The icon’s color inside of the button.

§icon_size: Option<WidgetStatePropertyRef<Option<f64>>>

The icon’s size inside of the button.

§icon_alignment: Option<IconAlignment>

The alignment of the button’s icon.

This property is supported for the following button types:

  • ElevatedButton::icon.
  • FilledButton::icon.
  • FilledButton::tonal_icon.
  • OutlinedButton::icon.
  • TextButton::icon.

See also:

  • IconAlignment, for more information about the different icon alignments.
§side: Option<WidgetStatePropertyRef<Option<BorderSide>>>

The color and weight of the button’s outline.

This value is combined with shape to create a shape decorated with an outline.

§shape: Option<WidgetStatePropertyRef<Option<OutlinedBorderRef>>>

The shape of the button’s underlying Material.

This shape is combined with side to create a shape decorated with an outline.

§mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>

The cursor for a mouse pointer when it enters or is hovering over this button’s InkWell.

§visual_density: Option<VisualDensity>

Defines how compact the button’s layout will be.

See also:

  • ThemeData::visual_density, which specifies the visual_density for all widgets within a Theme.
§tap_target_size: Option<MaterialTapTargetSize>

Configures the minimum size of the area within which the button may be pressed.

If the tap_target_size is larger than minimum_size, the button will include a transparent margin that responds to taps.

Always defaults to ThemeData::material_tap_target_size.

§animation_duration: Option<Duration>

Defines the duration of animated changes for shape and elevation.

Typically the component default value is K_THEME_CHANGE_DURATION.

§enable_feedback: Option<bool>

Whether detected gestures should provide acoustic and/or haptic feedback.

For example, on Android a tap will produce a clicking sound and a long-press will produce a short vibration, when feedback is enabled.

Typically the component default value is true.

See also:

  • Feedback for providing platform-specific feedback to certain actions.
§alignment: Option<AlignmentGeometry>

The alignment of the button’s child.

Typically buttons are sized to be just big enough to contain the child and its padding. If the button’s size is constrained to a fixed size, for example by enclosing it with a SizedBox, this property defines how the child is aligned within the available space.

Always defaults to Alignment::CENTER.

§splash_factory: Option<InteractiveInkFeatureFactoryRef>

Creates the InkWell splash factory, which defines the appearance of “ink” splashes that occur in response to taps.

Use NoSplash::splash_factory() to defeat ink splash rendering.

§background_builder: Option<ButtonLayerBuilder>

Creates a widget that becomes the child of the button’s Material and whose child is the rest of the button, including the button’s child parameter.

The widget created by background_builder is constrained to be the same size as the overall button and will appear behind the button’s child. The widget created by foreground_builder is constrained to be the same size as the button’s child, i.e. it’s inset by ButtonStyle::padding and aligned by the button’s ButtonStyle::alignment.

By default the returned widget is clipped to the Material’s ButtonStyle::shape.

See also:

  • foreground_builder, to create a widget that’s as big as the button’s child and is layered behind the child.
  • ButtonStyleButtonData::clip_behavior, for more information about configuring clipping.
§foreground_builder: Option<ButtonLayerBuilder>

Creates a Widget that contains the button’s child parameter which is used instead of the button’s child.

The returned widget is clipped by the button’s ButtonStyle::shape, inset by the button’s ButtonStyle::padding and aligned by the button’s ButtonStyle::alignment.

See also:

  • background_builder, to create a widget that’s as big as the button and is layered behind the button’s child.
  • ButtonStyleButtonData::clip_behavior, for more information about configuring clipping.
§size_variant: Option<ButtonSizeVariant>

The Material 3 Expressive size variant for this button.

A size variant selects a component-defined token set rather than a single dimension. For example, an IconButton uses this value to choose its default container size, padding, and icon size when it is using StyleVariant::Material3Expressive.

Use minimum_size, fixed_size, maximum_size, padding, or icon_size to directly override those individual style properties.

§icon_button_width: Option<IconButtonWidthVariant>

The Material 3 Expressive width variant for an IconButton.

A width variant selects the leading and trailing space tokens used to compute an icon button’s default horizontal padding and minimum width when it is using StyleVariant::Material3Expressive. It does not change the button’s height or icon size.

This property is only used by icon buttons. Use padding, minimum_size, fixed_size, or maximum_size to directly override the resulting layout.

§shape_variant: Option<ButtonShapeVariant>

The Material 3 Expressive shape variant for this button.

A shape variant selects between component-defined token families, such as round and square shapes. For IconButton, this affects the default container and selected-state shapes when it is using StyleVariant::Material3Expressive; state-specific tokens, such as the pressed shape, are still resolved by the component defaults.

Use shape to provide a specific [OutlinedBorder] or stateful shape override instead of selecting one of the Material 3 Expressive shape variants.

Implementations§

Source§

impl ButtonStyle

Source

pub fn new() -> ButtonStyle

Create a ButtonStyle.

Source

pub fn text_style( self, text_style: WidgetStatePropertyRef<Option<TextStyle>>, ) -> ButtonStyle

Dart ButtonStyle(textStyle:).

Source

pub fn background_color( self, background_color: WidgetStatePropertyRef<Option<Color>>, ) -> ButtonStyle

Dart ButtonStyle(backgroundColor:).

Source

pub fn foreground_color( self, foreground_color: WidgetStatePropertyRef<Option<Color>>, ) -> ButtonStyle

Dart ButtonStyle(foregroundColor:).

Source

pub fn overlay_color( self, overlay_color: WidgetStatePropertyRef<Option<Color>>, ) -> ButtonStyle

Dart ButtonStyle(overlayColor:).

Source

pub fn shadow_color( self, shadow_color: WidgetStatePropertyRef<Option<Color>>, ) -> ButtonStyle

Dart ButtonStyle(shadowColor:).

Source

pub fn surface_tint_color( self, surface_tint_color: WidgetStatePropertyRef<Option<Color>>, ) -> ButtonStyle

Dart ButtonStyle(surfaceTintColor:).

Source

pub fn elevation( self, elevation: WidgetStatePropertyRef<Option<f64>>, ) -> ButtonStyle

Dart ButtonStyle(elevation:).

Source

pub fn padding( self, padding: WidgetStatePropertyRef<Option<EdgeInsetsGeometry>>, ) -> ButtonStyle

Dart ButtonStyle(padding:).

Source

pub fn minimum_size( self, minimum_size: WidgetStatePropertyRef<Option<Size>>, ) -> ButtonStyle

Dart ButtonStyle(minimumSize:).

Source

pub fn fixed_size( self, fixed_size: WidgetStatePropertyRef<Option<Size>>, ) -> ButtonStyle

Dart ButtonStyle(fixedSize:).

Source

pub fn maximum_size( self, maximum_size: WidgetStatePropertyRef<Option<Size>>, ) -> ButtonStyle

Dart ButtonStyle(maximumSize:).

Source

pub fn icon_color( self, icon_color: WidgetStatePropertyRef<Option<Color>>, ) -> ButtonStyle

Dart ButtonStyle(iconColor:).

Source

pub fn icon_size( self, icon_size: WidgetStatePropertyRef<Option<f64>>, ) -> ButtonStyle

Dart ButtonStyle(iconSize:).

Source

pub fn icon_alignment(self, icon_alignment: IconAlignment) -> ButtonStyle

Dart ButtonStyle(iconAlignment:).

Source

pub fn side( self, side: WidgetStatePropertyRef<Option<BorderSide>>, ) -> ButtonStyle

Dart ButtonStyle(side:).

Source

pub fn shape( self, shape: WidgetStatePropertyRef<Option<OutlinedBorderRef>>, ) -> ButtonStyle

Dart ButtonStyle(shape:).

Source

pub fn mouse_cursor( self, mouse_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>, ) -> ButtonStyle

Dart ButtonStyle(mouseCursor:).

Source

pub fn visual_density(self, visual_density: VisualDensity) -> ButtonStyle

Dart ButtonStyle(visualDensity:).

Source

pub fn tap_target_size( self, tap_target_size: MaterialTapTargetSize, ) -> ButtonStyle

Dart ButtonStyle(tapTargetSize:).

Source

pub fn animation_duration(self, animation_duration: Duration) -> ButtonStyle

Dart ButtonStyle(animationDuration:).

Source

pub fn enable_feedback(self, enable_feedback: bool) -> ButtonStyle

Dart ButtonStyle(enableFeedback:).

Source

pub fn alignment(self, alignment: AlignmentGeometry) -> ButtonStyle

Dart ButtonStyle(alignment:).

Source

pub fn splash_factory( self, splash_factory: InteractiveInkFeatureFactoryRef, ) -> ButtonStyle

Dart ButtonStyle(splashFactory:).

Source

pub fn background_builder( self, background_builder: ButtonLayerBuilder, ) -> ButtonStyle

Dart ButtonStyle(backgroundBuilder:).

Source

pub fn foreground_builder( self, foreground_builder: ButtonLayerBuilder, ) -> ButtonStyle

Dart ButtonStyle(foregroundBuilder:).

Source

pub fn size_variant(self, size_variant: ButtonSizeVariant) -> ButtonStyle

Dart ButtonStyle(sizeVariant:).

Source

pub fn icon_button_width( self, icon_button_width: IconButtonWidthVariant, ) -> ButtonStyle

Dart ButtonStyle(iconButtonWidth:).

Source

pub fn shape_variant(self, shape_variant: ButtonShapeVariant) -> ButtonStyle

Dart ButtonStyle(shapeVariant:).

Source

pub fn copy_with(&self) -> ButtonStyle

Returns a copy of this ButtonStyle with the given fields replaced with the new values.

Chain setters: style.copy_with().elevation(e).

Source

pub fn merge(&self, style: Option<&ButtonStyle>) -> ButtonStyle

Returns a copy of this ButtonStyle where the non-null fields in style have replaced the corresponding null fields in this ButtonStyle.

In other words, style is used to fill in unspecified (null) fields this ButtonStyle.

Source

pub fn lerp( a: Option<&ButtonStyle>, b: Option<&ButtonStyle>, t: f64, ) -> Option<ButtonStyle>

Linearly interpolate between two ButtonStyles.

Trait Implementations§

Source§

impl ButtonStyleGetters for ButtonStyle

Source§

fn button_style(&self) -> &ButtonStyle

The fields Dart’s constructor sets: the struct itself, or the super(...) arguments a defaults struct keeps.
Source§

fn text_style( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<TextStyle>>>

Dart’s text_style getter.
Source§

fn background_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>

Dart’s background_color getter.
Source§

fn foreground_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>

Dart’s foreground_color getter.
Source§

fn overlay_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>

Dart’s overlay_color getter.
Source§

fn shadow_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>

Dart’s shadow_color getter.
Source§

fn surface_tint_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>

Dart’s surface_tint_color getter.
Source§

fn elevation( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<f64>>>

Dart’s elevation getter.
Source§

fn padding( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<EdgeInsetsGeometry>>>

Dart’s padding getter.
Source§

fn minimum_size( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Size>>>

Dart’s minimum_size getter.
Source§

fn fixed_size( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Size>>>

Dart’s fixed_size getter.
Source§

fn maximum_size( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Size>>>

Dart’s maximum_size getter.
Source§

fn icon_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>

Dart’s icon_color getter.
Source§

fn icon_size( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<f64>>>

Dart’s icon_size getter.
Source§

fn icon_alignment(&self, app: &mut App) -> Option<IconAlignment>

Dart’s icon_alignment getter.
Source§

fn side( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<BorderSide>>>

Dart’s side getter.
Source§

fn shape( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<OutlinedBorderRef>>>

Dart’s shape getter.
Source§

fn mouse_cursor( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>

Dart’s mouse_cursor getter.
Source§

fn visual_density(&self, app: &mut App) -> Option<VisualDensity>

Dart’s visual_density getter.
Source§

fn tap_target_size(&self, app: &mut App) -> Option<MaterialTapTargetSize>

Dart’s tap_target_size getter.
Source§

fn animation_duration(&self, app: &mut App) -> Option<Duration>

Dart’s animation_duration getter.
Source§

fn enable_feedback(&self, app: &mut App) -> Option<bool>

Dart’s enable_feedback getter.
Source§

fn alignment(&self, app: &mut App) -> Option<AlignmentGeometry>

Dart’s alignment getter.
Source§

fn splash_factory( &self, app: &mut App, ) -> Option<InteractiveInkFeatureFactoryRef>

Dart’s splash_factory getter.
Source§

fn background_builder(&self, app: &mut App) -> Option<ButtonLayerBuilder>

Dart’s background_builder getter.
Source§

fn foreground_builder(&self, app: &mut App) -> Option<ButtonLayerBuilder>

Dart’s foreground_builder getter.
Source§

fn size_variant(&self, app: &mut App) -> Option<ButtonSizeVariant>

Dart’s size_variant getter.
Source§

fn icon_button_width(&self, app: &mut App) -> Option<IconButtonWidthVariant>

Dart’s icon_button_width getter.
Source§

fn shape_variant(&self, app: &mut App) -> Option<ButtonShapeVariant>

Dart’s shape_variant getter.
Source§

fn copy_with(&self, app: &mut App) -> ButtonStyle

Dart’s copyWith() with no arguments: a plain value holding what every getter answers, for the caller’s setters to change.
Source§

impl Clone for ButtonStyle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ButtonStyle

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ButtonStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Diagnosticable for ButtonStyle

Source§

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

Add additional properties associated with the node.
Source§

fn type_name(&self) -> &'static str

Dart’s Object.runtimeType as diagnostics print it: the last segment of the Rust type path, without generic arguments.
Source§

fn identity_hash(&self) -> u64

Dart’s Object.hashCode as diagnostics print it: the object’s address.
Source§

fn to_string_short(&self) -> String

A brief description of this object, usually just the type and the hash.
Source§

fn to_diagnostics_node(&self) -> DiagnosticableNode

Returns a debug representation of the object used by debugging tools and by DiagnosticsNode::to_string_deep.
Source§

fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode

Dart toDiagnosticsNode(name:, style:).
Source§

fn to_string(&self) -> String

Dart’s toString: a single-line description with properties and no children. Read more
Source§

fn to_string_at(&self, min_level: DiagnosticLevel) -> String

Dart’s toString(minLevel:).
Source§

impl Display for ButtonStyle

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ButtonStyle

Source§

fn eq(&self, other: &ButtonStyle) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for ButtonStyle

§

impl !Send for ButtonStyle

§

impl !Sync for ButtonStyle

§

impl !UnwindSafe for ButtonStyle

§

impl Forget for ButtonStyle

§

impl Freeze for ButtonStyle
where *const RcInner<dyn WidgetStateProperty<Option<TextStyle>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<TextStyle>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<f64>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<f64>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Size>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Size>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<BorderSide>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<BorderSide>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: Freeze, *const RcInner<dyn InteractiveInkFeatureFactory> is !null: Freeze, PhantomData<RcInner<dyn InteractiveInkFeatureFactory>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>>>: Freeze, *const (): Freeze,

§

impl Move for ButtonStyle

§

impl Unpin for ButtonStyle

§

impl UnsafeUnpin for ButtonStyle
where *const RcInner<dyn WidgetStateProperty<Option<TextStyle>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<TextStyle>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<f64>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<f64>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<Size>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<Size>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<BorderSide>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<BorderSide>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: UnsafeUnpin, *const RcInner<dyn InteractiveInkFeatureFactory> is !null: UnsafeUnpin, PhantomData<RcInner<dyn InteractiveInkFeatureFactory>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>>>: UnsafeUnpin, *const (): 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &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<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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

Source§

fn upcast(&self) -> Option<&T>