pub struct ExpandIcon {
pub key: Option<KeyRef>,
pub is_expanded: bool,
pub size: f64,
pub on_pressed: Option<ValueChanged<bool>>,
pub padding: EdgeInsetsGeometry,
pub color: Option<Color>,
pub disabled_color: Option<Color>,
pub expanded_color: Option<Color>,
pub splash_color: Option<Color>,
pub highlight_color: Option<Color>,
}Expand description
A widget representing a rotating expand/collapse button. The icon rotates
180 degrees when pressed, then reverts the animation on a second press.
The underlying icon is Icons::expand_more.
The expand icon does not include a semantic label for accessibility. In
order to be accessible it should be combined with a label using
MergeSemantics. This is done automatically by the ExpansionPanel widget.
See IconButton for a more general implementation of a pressable button
with an icon.
See also:
Fields§
§key: Option<KeyRef>§is_expanded: boolWhether the icon is in an expanded state.
Rebuilding the widget with a different is_expanded value will
trigger the animation, but will not trigger the on_pressed
callback.
size: f64The size of the icon.
Defaults to 24.
on_pressed: Option<ValueChanged<bool>>The callback triggered when the icon is pressed and the state changes between expanded and collapsed. The value passed to the current state.
If this is set to None, the button will be disabled.
padding: EdgeInsetsGeometryThe padding around the icon. The entire padded icon will react to input gestures.
Defaults to a padding of 8 on all sides.
color: Option<Color>The color of the icon.
Defaults to Colors::BLACK54 when the theme’s
ThemeData::brightness is Brightness::Light and to
Colors::WHITE60 when it is Brightness::Dark. This adheres to the
Material Design specifications for icons
and for dark theme
disabled_color: Option<Color>The color of the icon when it is disabled,
i.e. if on_pressed is None.
Defaults to Colors::BLACK38 when the theme’s
ThemeData::brightness is Brightness::Light and to
Colors::WHITE38 when it is Brightness::Dark. This adheres to the
Material Design specifications for icons
and for dark theme
expanded_color: Option<Color>The color of the icon when the icon is expanded.
Defaults to Colors::BLACK54 when the theme’s
ThemeData::brightness is Brightness::Light and to
Colors::WHITE when it is Brightness::Dark. This adheres to the
Material Design specifications for icons
and for dark theme
splash_color: Option<Color>Defines the splash color of the IconButton.
If ThemeData::use_material3 is true, this field will be ignored,
as IconButton::splash_color will be ignored, and you should use
highlight_color instead.
Defaults to ThemeData::splash_color.
highlight_color: Option<Color>Defines the highlight color of the IconButton.
Defaults to ThemeData::highlight_color.
Implementations§
Source§impl ExpandIcon
impl ExpandIcon
Sourcepub fn new(on_pressed: Option<ValueChanged<bool>>) -> ExpandIcon
pub fn new(on_pressed: Option<ValueChanged<bool>>) -> ExpandIcon
Creates an ExpandIcon with the given padding, and a callback that is
triggered when the icon is pressed; Dart’s optional named arguments are the setters.
Sourcepub fn key(self, key: KeyRef) -> ExpandIcon
pub fn key(self, key: KeyRef) -> ExpandIcon
Dart ExpandIcon(key:).
Sourcepub fn is_expanded(self, is_expanded: bool) -> ExpandIcon
pub fn is_expanded(self, is_expanded: bool) -> ExpandIcon
Dart ExpandIcon(isExpanded:).
Sourcepub fn size(self, size: f64) -> ExpandIcon
pub fn size(self, size: f64) -> ExpandIcon
Dart ExpandIcon(size:).
Sourcepub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> ExpandIcon
pub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> ExpandIcon
Dart ExpandIcon(padding:).
Sourcepub fn color(self, color: Color) -> ExpandIcon
pub fn color(self, color: Color) -> ExpandIcon
Dart ExpandIcon(color:).
Sourcepub fn disabled_color(self, disabled_color: Color) -> ExpandIcon
pub fn disabled_color(self, disabled_color: Color) -> ExpandIcon
Dart ExpandIcon(disabledColor:).
Sourcepub fn expanded_color(self, expanded_color: Color) -> ExpandIcon
pub fn expanded_color(self, expanded_color: Color) -> ExpandIcon
Dart ExpandIcon(expandedColor:).
Sourcepub fn splash_color(self, splash_color: Color) -> ExpandIcon
pub fn splash_color(self, splash_color: Color) -> ExpandIcon
Dart ExpandIcon(splashColor:).
Sourcepub fn highlight_color(self, highlight_color: Color) -> ExpandIcon
pub fn highlight_color(self, highlight_color: Color) -> ExpandIcon
Dart ExpandIcon(highlightColor:).
Trait Implementations§
Source§impl Debug for ExpandIcon
impl Debug for ExpandIcon
Source§impl StatefulWidget for ExpandIcon
impl StatefulWidget for ExpandIcon
Source§type State = ExpandIconState
type State = ExpandIconState
Source§fn create_state(&self) -> ExpandIconState
fn create_state(&self) -> ExpandIconState
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 as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for ExpandIcon
impl !Send for ExpandIcon
impl !Sync for ExpandIcon
impl !UnwindSafe for ExpandIcon
impl Forget for ExpandIcon
impl Freeze for ExpandIcon
impl Move for ExpandIcon
impl Unpin for ExpandIcon
impl UnsafeUnpin for ExpandIconwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, bool)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, bool)>>: 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<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.