Skip to main content

IconButton

Struct IconButton 

Source
pub struct IconButton {
Show 26 fields pub key: Option<KeyRef>, pub icon_size: Option<f64>, pub visual_density: Option<VisualDensity>, pub padding: Option<EdgeInsetsGeometry>, pub alignment: Option<AlignmentGeometry>, pub splash_radius: Option<f64>, pub icon: WidgetRef, pub focus_color: Option<Color>, pub hover_color: Option<Color>, pub color: Option<Color>, pub splash_color: Option<Color>, pub highlight_color: Option<Color>, pub disabled_color: Option<Color>, pub on_pressed: Option<Listener>, pub on_hover: Option<ValueChanged<bool>>, pub on_long_press: Option<Listener>, pub mouse_cursor: Option<MouseCursorRef>, pub focus_node: Option<FocusNodeRef>, pub autofocus: bool, pub tooltip: Option<String>, pub enable_feedback: Option<bool>, pub constraints: Option<BoxConstraints>, pub style: Option<ButtonStyle>, pub is_selected: Option<bool>, pub selected_icon: Option<WidgetRef>, pub states_controller: Option<Ref<MaterialStatesController>>, /* private fields */
}
Expand description

A Material Design icon button.

An icon button is a picture printed on a Material widget that reacts to touches by filling with color (ink).

Icon buttons are commonly used in the AppBar.actions field, but they can be used in many other places as well.

If the on_pressed callback is null, then the button will be disabled and will not react to touch.

Requires one of its ancestors to be a Material widget. In Material Design 3, this requirement no longer exists because this widget builds a subclass of ButtonStyleButton.

The hit region of an icon button will, if possible, be at least kMinInteractiveDimension pixels in size, regardless of the actual icon_size, to satisfy the touch target size requirements in the Material Design specification. The alignment controls how the icon itself is positioned within the hit region.

§Icon sizes

When creating an icon button with an Icon, do not override the icon’s size with its Icon::size parameter, use the icon button’s icon_size parameter instead. For example do this:

IconButton::new(Some(on_pressed), Icon::new(Some(Icons::favorite()))).icon_size(72.0)

Avoid doing this:

IconButton::new(Some(on_pressed), Icon::new(Some(Icons::favorite())).size(72.0))

If you do, the button’s size will be based on the default icon size, not 72, which may produce unexpected layouts and clipping issues.

§Adding a filled background

Icon buttons don’t support specifying a background color or other background decoration because typically the icon is just displayed on top of the parent widget’s background. Icon buttons that appear in AppBar.actions are an example of this.

It’s easy enough to create an icon button with a filled background using the Ink widget. The Ink widget renders a decoration on the underlying Material along with the splash and highlight InkResponse contributed by descendant widgets.

Material Design 3 introduced new types (standard and contained) of IconButtons. The default IconButton is the standard type. To create a filled icon button, use IconButton::filled; to create a filled tonal icon button, use IconButton::filled_tonal; to create a outlined icon button, use IconButton::outlined.

Material Design 3 also treats IconButtons as toggle buttons. In order to not break existing apps, the toggle feature can be optionally controlled by the is_selected property.

If is_selected is null it will behave as a normal button. If is_selected is not null then it will behave as a toggle button. If is_selected is true then it will show selected_icon, if it false it will show the normal icon.

In Material Design 3, both IconTheme and IconButtonTheme are used to override the default style of IconButton. If both themes exist, the IconButtonTheme will override IconTheme no matter which is closer to the IconButton. Each IconButton’s property is resolved by the order of precedence: widget property, IconButtonTheme property, IconTheme property and internal default property value.

In Material Design 3, the IconButton::visual_density defaults to VisualDensity::STANDARD for all platforms; otherwise the button will have a rounded rectangle shape if the IconButton::visual_density is set to VisualDensity::COMPACT. Users can customize it by using IconButtonTheme, IconButton::style or IconButton::visual_density.

To use the Material 3 Expressive style, set IconButtonThemeData::variant to StyleVariant::Material3Expressive. The Expressive size, width, and shape variants can then be selected with ButtonStyle::size_variant, ButtonStyle::icon_button_width, and ButtonStyle::shape_variant.

See also:

  • Icons, the library of Material Icons.
  • BackButton, an icon button for a “back” affordance which adapts to the current platform’s conventions.
  • CloseButton, an icon button for closing pages.
  • AppBar, to show a toolbar at the top of an application.
  • TextButton, ElevatedButton, OutlinedButton, for buttons with text labels and an optional icon.
  • InkResponse and InkWell, for the ink splash effect itself.

Fields§

§key: Option<KeyRef>§icon_size: Option<f64>

The size of the icon inside the button.

If null, uses IconThemeData::size. If it is also null, the default size is 24.0.

The size given here is passed down to the widget in the icon property via an IconTheme. Setting the size here instead of in, for example, the Icon::size property allows the IconButton to size the splash area to fit the Icon. If you were to set the size of the Icon using Icon::size instead, then the IconButton would default to 24.0 and then the Icon itself would likely get clipped.

This property is only used when icon is or contains an Icon widget. It will be ignored if other widgets are used, such as an Image.

If ThemeData::use_material3 is set to true and this is null, the size of the IconButton would default to 24.0. The size given here is passed down to the ButtonStyle::icon_size property.

§visual_density: Option<VisualDensity>

Defines how compact the icon button’s layout will be.

This property can be null. If null, it defaults to VisualDensity::STANDARD in Material Design 3 to make sure the button will be circular on all platforms.

See also:

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

The padding around the button’s icon. The entire padded icon will react to input gestures.

If ThemeData::use_material3 is set to false, apply padding in the square proportion to the button’s splash/highlight shape. For example, if the button is a circle, use padding on all sides to center the icon inside the splash/highlight circle. Otherwise, wrap the IconButton with a Padding widget to apply padding in the desired direction.

This property can be null. If null, it defaults to 8.0 padding on all sides.

§alignment: Option<AlignmentGeometry>

Defines how the icon is positioned within the IconButton.

This property can be null. If null, it defaults to Alignment::CENTER.

See also:

  • Alignment, a class with convenient constants typically used to specify an AlignmentGeometry.
  • AlignmentDirectional, like Alignment for specifying alignments relative to text direction.
§splash_radius: Option<f64>

The splash radius.

If ThemeData::use_material3 is set to true, this will not be used.

If null, default splash radius of Material::DEFAULT_SPLASH_RADIUS is used.

§icon: WidgetRef

The icon to display inside the button.

The Icon::size and Icon::color of the icon is configured automatically based on the icon_size and color properties of this widget using an IconTheme and therefore should not be explicitly given in the icon widget.

See Icon, ImageIcon.

§focus_color: Option<Color>

The color for the button when it has the input focus.

If ThemeData::use_material3 is set to true, this focus_color will be mapped to be the ButtonStyle::overlay_color in focused state, which paints on top of the button, as an overlay. Therefore, using a color with some transparency is recommended. For example, one could customize the focus_color below:

IconButton::new(Some(on_pressed), Icon::new(Some(Icons::sunny())))
    .focus_color(Colors::ORANGE.primary().with_values(Some(0.3), None, None, None, None))

Defaults to ThemeData::focus_color of the ambient theme.

§hover_color: Option<Color>

The color for the button when a pointer is hovering over it.

If ThemeData::use_material3 is set to true, this hover_color will be mapped to be the ButtonStyle::overlay_color in hovered state, which paints on top of the button, as an overlay. Therefore, using a color with some transparency is recommended. For example, one could customize the hover_color below:

IconButton::new(Some(on_pressed), Icon::new(Some(Icons::ac_unit())))
    .hover_color(Colors::ORANGE.primary().with_values(Some(0.3), None, None, None, None))

Defaults to ThemeData::hover_color of the ambient theme.

§color: Option<Color>

The color to use for the icon inside the button, if the icon is enabled. Defaults to leaving this up to the icon widget.

The icon is enabled if on_pressed is not null.

IconButton::new(Some(on_pressed), Icon::new(Some(Icons::sunny_snowing())))
    .color(Colors::BLUE.primary())
§splash_color: Option<Color>

The primary color of the button when the button is in the down (pressed) state. The splash is represented as a circular overlay that appears above the highlight_color overlay. The splash overlay has a center point that matches the hit point of the user touch event. The splash overlay will expand to fill the button area if the touch is held for long enough time. If the splash color has transparency then the highlight and button color will show through.

If ThemeData::use_material3 is set to true, this will not be used. Use highlight_color instead to show the overlay color of the button when the button is in the pressed state.

Defaults to the Theme’s splash color, ThemeData::splash_color.

§highlight_color: Option<Color>

The secondary color of the button when the button is in the down (pressed) state. The highlight color is represented as a solid color that is overlaid over the button color (if any). If the highlight color has transparency, the button color will show through. The highlight fades in quickly as the button is held down.

If ThemeData::use_material3 is set to true, this highlight_color will be mapped to be the ButtonStyle::overlay_color in pressed state, which paints on top of the button, as an overlay. Therefore, using a color with some transparency is recommended. For example, one could customize the highlight_color below:

IconButton::new(Some(on_pressed), Icon::new(Some(Icons::question_mark())))
    .highlight_color(Colors::ORANGE.primary().with_values(Some(0.3), None, None, None, None))

Defaults to the Theme’s highlight color, ThemeData::highlight_color.

§disabled_color: Option<Color>

The color to use for the icon inside the button, if the icon is disabled. Defaults to the ThemeData::disabled_color of the current Theme.

The icon is disabled if on_pressed is null.

§on_pressed: Option<Listener>

The callback that is called when the button is tapped or otherwise activated.

If this is set to null, the button will be disabled.

§on_hover: Option<ValueChanged<bool>>

The callback that is called when the button is hovered.

§on_long_press: Option<Listener>

The callback that is called when the button is long-pressed.

If on_pressed is set to null, the on_long_press callback is not called.

§mouse_cursor: Option<MouseCursorRef>

The cursor for a mouse pointer when it enters or is hovering over the button.

If set to null, will default to SystemMouseCursors::BASIC if on_pressed is null, otherwise WidgetStateMouseCursor::adaptive_clickable.

§focus_node: Option<FocusNodeRef>

An optional focus node to use as the focus node for this widget.

§autofocus: bool

True if this widget will be selected as the initial focus when no other node in its scope is currently focused.

§tooltip: Option<String>

Text that describes the action that will occur when the button is pressed.

This text is displayed when the user long-presses on the button and is used for accessibility.

§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.

See also:

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

Optional size constraints for the button.

When unspecified, defaults to:

BoxConstraints::new()
    .min_width(K_MIN_INTERACTIVE_DIMENSION)
    .min_height(K_MIN_INTERACTIVE_DIMENSION)

where K_MIN_INTERACTIVE_DIMENSION is 48.0, and then with visual density applied.

The default constraints ensure that the button is accessible. Specifying this parameter enables creation of buttons smaller than the minimum size, but it is not recommended.

The visual density uses the visual_density parameter if specified, and Theme::of(context).visual_density otherwise.

§style: Option<ButtonStyle>

Customizes this button’s appearance.

Non-null properties of this style override the corresponding properties in IconButtonM3’s theme_style_of and default_style_of. WidgetStatePropertys that resolve to non-null values will similarly override the corresponding WidgetStatePropertys in IconButtonM3’s theme_style_of and default_style_of.

The style is only used for Material 3 IconButton. If ThemeData::use_material3 is set to true, style is preferred for icon button customization, and any parameters defined in style will override the same parameters in IconButton.

For example, if IconButton’s visual_density is set to VisualDensity::STANDARD and style’s visual_density is set to VisualDensity::COMPACT, the icon button will have VisualDensity::COMPACT to define the button’s layout.

Null by default.

§is_selected: Option<bool>

The optional selection state of the icon button.

If this property is null, the button will behave as a normal push button, otherwise, the button will toggle between showing icon and selected_icon based on the value of is_selected. If true, it will show selected_icon, if false it will show icon.

This property is only used if ThemeData::use_material3 is true.

§selected_icon: Option<WidgetRef>

The icon to display inside the button when is_selected is true. This property can be null. The original icon will be used for both selected and unselected status if it is null.

The Icon::size and Icon::color of the icon is configured automatically based on the icon_size and color properties using an IconTheme and therefore should not be explicitly configured in the icon widget.

This property is only used if ThemeData::use_material3 is true.

See also:

  • Icon, for icons based on glyphs from fonts instead of images.
  • ImageIcon, for showing icons from AssetImages or other ImageProviders.
§states_controller: Option<Ref<MaterialStatesController>>

Represents the interactive “state” of this widget in terms of a set of WidgetStates, including WidgetState::Pressed, WidgetState::Hovered and WidgetState::Focused.

Implementations§

Source§

impl IconButton

Source

pub fn new<K>( on_pressed: Option<Listener>, icon: impl IntoWidget<K>, ) -> IconButton

Creates an icon button.

Icon buttons are commonly used in the AppBar.actions field, but they can be used in many other places as well.

Requires one of its ancestors to be a Material widget. This requirement no longer exists if ThemeData::use_material3 is set to true.

The icon argument must be specified, and is typically either an Icon or an ImageIcon.

Source

pub fn filled<K>( on_pressed: Option<Listener>, icon: impl IntoWidget<K>, ) -> IconButton

Create a filled variant of IconButton.

Filled icon buttons have higher visual impact and should be used for high emphasis actions, such as turning off a microphone or camera.

Source

pub fn filled_tonal<K>( on_pressed: Option<Listener>, icon: impl IntoWidget<K>, ) -> IconButton

Create a filled tonal variant of IconButton.

Filled tonal icon buttons are a middle ground between filled and outlined icon buttons. They’re useful in contexts where the button requires slightly more emphasis than an outline would give, such as a secondary action paired with a high emphasis action.

Source

pub fn outlined<K>( on_pressed: Option<Listener>, icon: impl IntoWidget<K>, ) -> IconButton

Create an outlined variant of IconButton.

Outlined icon buttons are medium-emphasis buttons. They’re useful when an icon button needs more emphasis than a standard icon button but less than a filled or filled tonal icon button.

Source

pub fn key(self, key: KeyRef) -> IconButton

Dart IconButton(key:).

Source

pub fn icon_size(self, icon_size: f64) -> IconButton

Dart IconButton(iconSize:).

Source

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

Dart IconButton(visualDensity:).

Source

pub fn padding(self, padding: EdgeInsetsGeometry) -> IconButton

Dart IconButton(padding:).

Source

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

Dart IconButton(alignment:).

Source

pub fn color(self, color: Color) -> IconButton

Dart IconButton(color:).

Source

pub fn focus_color(self, focus_color: Color) -> IconButton

Dart IconButton(focusColor:).

Source

pub fn hover_color(self, hover_color: Color) -> IconButton

Dart IconButton(hoverColor:).

Source

pub fn highlight_color(self, highlight_color: Color) -> IconButton

Dart IconButton(highlightColor:).

Source

pub fn splash_color(self, splash_color: Color) -> IconButton

Dart IconButton(splashColor:).

Source

pub fn disabled_color(self, disabled_color: Color) -> IconButton

Dart IconButton(disabledColor:).

Source

pub fn on_hover(self, on_hover: ValueChanged<bool>) -> IconButton

Dart IconButton(onHover:).

Source

pub fn on_long_press(self, on_long_press: Listener) -> IconButton

Dart IconButton(onLongPress:).

Source

pub fn mouse_cursor(self, mouse_cursor: MouseCursorRef) -> IconButton

Dart IconButton(mouseCursor:).

Source

pub fn focus_node(self, focus_node: FocusNodeRef) -> IconButton

Dart IconButton(focusNode:).

Source

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

Dart IconButton(enableFeedback:).

Source

pub fn constraints(self, constraints: BoxConstraints) -> IconButton

Dart IconButton(constraints:).

Source

pub fn style(self, style: ButtonStyle) -> IconButton

Dart IconButton(style:).

Source

pub fn states_controller( self, states_controller: Ref<MaterialStatesController>, ) -> IconButton

Dart IconButton(statesController:).

Source

pub fn splash_radius(self, splash_radius: f64) -> IconButton

Dart IconButton(splashRadius:).

Source

pub fn autofocus(self, autofocus: bool) -> IconButton

Dart IconButton(autofocus:).

Source

pub fn tooltip(self, tooltip: impl Into<String>) -> IconButton

Dart IconButton(tooltip:).

Source

pub fn is_selected(self, is_selected: bool) -> IconButton

Dart IconButton(isSelected:).

Source

pub fn selected_icon<K>(self, selected_icon: impl IntoWidget<K>) -> IconButton

Dart IconButton(selectedIcon:).

Source

pub fn style_from() -> IconButtonStyleFromBuilder

A static convenience method that constructs an icon button ButtonStyle given simple values. This method is only used for Material 3.

The foreground_color color is used to create a WidgetStateProperty ButtonStyle::foreground_color value. Specify a value for foreground_color to specify the color of the button’s icons. The hover_color, focus_color and highlight_color colors are used to indicate the hover, focus, and pressed states if overlay_color isn’t specified.

If overlay_color is specified and its value is Colors::TRANSPARENT then the pressed/focused/hovered highlights are effectively defeated. Otherwise a WidgetStateProperty with the same opacities as the default is created.

Use background_color for the button’s background fill color. Use disabled_foreground_color and disabled_background_color to specify the button’s disabled icon and fill color.

Similarly, the enabled_mouse_cursor and disabled_mouse_cursor parameters are used to construct ButtonStyle::mouse_cursor.

All of the other parameters are either used directly or used to create a WidgetStateProperty with a single value for all states.

The size_variant, icon_button_width, and shape_variant parameters are Material 3 Expressive options. They provide extra-small through extra-large sizes, narrow through wide widths, and round or square shapes through ButtonStyle::size_variant, ButtonStyle::icon_button_width, and ButtonStyle::shape_variant.

When IconButtonThemeData::variant is StyleVariant::Material3Expressive, and these properties are null, Material 3 Expressive IconButton defaults use ButtonSizeVariant::Small, IconButtonWidthVariant::Standard, and ButtonShapeVariant::Round.

All parameters default to null, by default this method returns a ButtonStyle that doesn’t override anything.

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

IconButton::new(Some(on_pressed), Icon::new(Some(Icons::pets())))
    .style(IconButton::style_from().foreground_color(Colors::GREEN.primary()).build())

Trait Implementations§

Source§

impl Debug for IconButton

Source§

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

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

impl StatelessWidget for IconButton

Source§

fn key(&self) -> Option<&KeyRef>

Source§

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

Dart’s 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 build(&self, app: &mut App, context: BuildContext) -> WidgetRef

Describes the part of the user interface represented by this widget. Read more
Source§

fn debug_check_constructor(&self)

Dart’s constructor asserts that relate two or more arguments. Read more
Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Dart’s 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 IconButton

§

impl !Send for IconButton

§

impl !Sync for IconButton

§

impl !UnwindSafe for IconButton

§

impl Forget for IconButton

§

impl Freeze for IconButton
where *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, *const RcInner<dyn Fn(&mut App, bool)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, bool)>>: Freeze, *const RcInner<dyn MouseCursor> is !null: Freeze, PhantomData<RcInner<dyn MouseCursor>>: Freeze, &'static FocusNodeVTable: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *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, PhantomData<fn() -> WidgetStatesController>: Freeze,

§

impl Move for IconButton

§

impl Unpin for IconButton

§

impl UnsafeUnpin for IconButton
where *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, *const RcInner<dyn Fn(&mut App, bool)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, bool)>>: UnsafeUnpin, *const RcInner<dyn MouseCursor> is !null: UnsafeUnpin, PhantomData<RcInner<dyn MouseCursor>>: UnsafeUnpin, &'static FocusNodeVTable: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *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, PhantomData<fn() -> WidgetStatesController>: 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> 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<W> IntoWidget<StatelessKind> for W
where W: StatelessWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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>