StacIconButton class

A Stac model representing Flutter's IconButton widget.

Represents a Material Design icon button that responds to touches by filling with color.

StacIconButton(
  onPressed: {'action': 'navigate', 'route': '/next'},
  icon: StacIcon(icon: 'add'),
  color: '#FF5722',
)
{
  "type": "iconButton",
  "icon": {"type": "icon", "icon": "add"},
  "onPressed": {"action": "navigate", "route": "/next"},
  "color": "#FF5722"
}
Inheritance
Annotations
  • @JsonSerializable.new()

Constructors

StacIconButton({double? iconSize, StacVisualDensity? visualDensity, StacEdgeInsets? padding, StacAlignment? alignment, double? splashRadius, String? color, String? focusColor, String? hoverColor, String? highlightColor, String? splashColor, String? disabledColor, StacAction? onPressed, StacAction? onHover, StacAction? onLongPress, StacMouseCursor? mouseCursor, bool? autofocus, String? tooltip, bool? enableFeedback, StacBoxConstraints? constraints, StacButtonStyle? style, bool? isSelected, StacWidget? selectedIcon, StacWidget? icon})
Creates a StacIconButton with the given properties.
const
StacIconButton.fromJson(Map<String, dynamic> json)
Creates a StacIconButton from JSON.
factory

Properties

alignment → StacAlignment?
The alignment of the icon within the button.
final
autofocus → bool?
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
color → String?
The color of the icon.
final
constraints → StacBoxConstraints?
The constraints for the button.
final
disabledColor → String?
The color when the button is disabled.
final
enableFeedback → bool?
Whether to enable haptic feedback.
final
focusColor → String?
The color when the button is focused.
final
hashCode → int
The hash code for this object.
no setterinherited
highlightColor → String?
The color when the button is highlighted.
final
hoverColor → String?
The color when the button is hovered.
final
icon → StacWidget?
The icon to display in the button.
final
iconSize → double?
The size of the icon inside the button.
final
isSelected → bool?
Whether the button is selected.
final
jsonData → Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
mouseCursor → StacMouseCursor?
The mouse cursor for the button.
final
onHover → StacAction?
Called when the button is hovered.
final
onLongPress → StacAction?
Called when the button is long pressed.
final
onPressed → StacAction?
Called when the button is tapped or otherwise activated. If null, the button will be disabled.
final
padding → StacEdgeInsets?
The padding around the button.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedIcon → StacWidget?
The icon to display when the button is selected.
final
splashColor → String?
The color of the splash effect.
final
splashRadius → double?
The radius of the splash effect.
final
style → StacButtonStyle?
Customizes this button's appearance.
final
tooltip → String?
The tooltip text for the button.
final
type → String
Widget type identifier.
no setteroverride
visualDensity → StacVisualDensity?
The visual density of the button.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this button to JSON.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited