CarpenterIconButton class final
Icon-only semantic action that requires an explicit accessible name.
Use it when the icon is recognizable in context and text would be redundant. The caller owns execution state; callback aliases follow the same mutually exclusive contract as CarpenterButton.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- CarpenterIconButton
Constructors
- CarpenterIconButton({Key? key, required CarpenterIconSource icon, required String semanticLabel, VoidCallback? onPressed, VoidCallback? onInvoke, ActionColorRole colorRole = ActionColorRole.neutral, ActionProminence prominence = ActionProminence.normal, ControlSize size = ControlSize.medium, CarpenterShape shape = CarpenterShape.rounded, ActionExecutionPhase executionPhase = ActionExecutionPhase.idle, FocusNode? focusNode, bool autofocus = false, ShortcutActivator? shortcut, bool? toggled})
-
Creates an icon action with a required
semanticLabel. Null callbacks disable it; supplying bothonPressedandonInvokeis an assertion error.const - CarpenterIconButton.fromAction(CarpenterActionDescriptor action, {Key? key, ActionProminence prominence = ActionProminence.normal, ControlSize size = ControlSize.medium, CarpenterShape shape = CarpenterShape.rounded, ActionExecutionPhase executionPhase = ActionExecutionPhase.idle, FocusNode? focusNode, bool autofocus = false})
-
Projects an icon-bearing
action, preserving its visibility and disabled reason. Asserts that the descriptor supplies an icon.
Properties
- autofocus → bool
-
Whether the control requests focus when first attached. Defaults to
false.
final
- colorRole → ActionColorRole
-
Semantic action or selection color resolved from the current Carpenter
theme.
final
- executionPhase → ActionExecutionPhase
-
Caller-owned operation phase shown by the action renderer; no work is
started automatically.
final
- focusNode → FocusNode?
-
Optional caller-owned focus node. Dispose a supplied node in its owner,
not in the widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → CarpenterIconSource
-
Required Carpenter icon source; it is rendered at the themed action-icon
size.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onInvoke → VoidCallback?
-
Compatibility alias for older Carpenter call sites.
final
- onPressed → VoidCallback?
-
Callback invoked by an enabled activation. Null disables the action
unless the compatibility callback is supplied.
final
- prominence → ActionProminence
-
Visual emphasis independently of the action's semantic color role.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String
-
Required accessible action name. Describe the action rather than the
icon shape.
final
- shape → CarpenterShape
-
Leading and trailing corner roles. Logical start/end follow text
direction.
final
- shortcut → ShortcutActivator?
-
Shortcut metadata displayed on hover; binding remains with the caller.
final
- size → ControlSize
-
Semantic control size, resolving coordinated height, spacing, icon, and
typography metrics.
final
- toggled → bool?
-
Controlled switch state. Null keeps ordinary action semantics; false
renders neutral and true renders colorRole. The callback owns updates.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited