CarpenterIconButton constructor
const
CarpenterIconButton({
- Key? key,
- required CarpenterIconSource icon,
- required String semanticLabel,
- VoidCallback? onPressed,
- VoidCallback? onInvoke,
- VoidCallback? onLongPress,
- VoidCallback? onSecondaryTap,
- 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 both onPressed and onInvoke is an assertion
error.
Implementation
const CarpenterIconButton({
super.key,
required this.icon,
required this.semanticLabel,
this.onPressed,
this.onInvoke,
this.onLongPress,
this.onSecondaryTap,
this.colorRole = ActionColorRole.neutral,
this.prominence = ActionProminence.normal,
this.size = ControlSize.medium,
this.shape = CarpenterShape.rounded,
this.executionPhase = ActionExecutionPhase.idle,
this.focusNode,
this.autofocus = false,
this.shortcut,
this.toggled,
}) : _visible = true,
_semanticHint = null,
assert(
onPressed == null || onInvoke == null,
'Use either onPressed or the compatibility onInvoke callback, not both.',
);