filledTonalButton method
FilledButton
filledTonalButton({
- required void onPressed()?,
- void onLongPress()?,
- void onHover()?,
- void onFocusChange()?,
- ButtonStyle? style,
- FocusNode? focusNode,
- bool autofocus = false,
- Clip? clipBehavior = Clip.none,
- WidgetStatesController? statesController,
Creates a FilledButton.tonal with this widget as its child.
Filled tonal buttons are medium-emphasis buttons that are an alternative middle ground between filled and outlined buttons. They can be used in contexts where a lower-priority button requires slightly more emphasis than an outline would give.
Parameters:
onPressed
- Called when the button is pressed. If null, button is disabled.onLongPress
- Called when the button is long-pressed.onHover
- Called when a pointer enters or exits the button area.onFocusChange
- Called when the focus state of the button changes.style
- Customizes the button's appearance and behavior.focusNode
- An optional focus node to use as the focus node for this widget.autofocus
- Whether this widget should focus itself if nothing else is focused.clipBehavior
- The content will be clipped (or not) according to this option.statesController
- Represents the interactive state of the button.
Returns a FilledButton configured as a tonal variant with this widget as its child.
Example:
Text('Add to Cart')
.filledTonalButton(
onPressed: () => addToCart(),
)
See also:
- FilledButton.tonal, the underlying Material Design filled tonal button.
- filledButton, for the standard filled button variant.
- filledTonalIconButton, for creating filled tonal buttons with icons.
Implementation
FilledButton filledTonalButton({
required void Function()? onPressed,
void Function()? onLongPress,
void Function(bool)? onHover,
void Function(bool)? onFocusChange,
ButtonStyle? style,
FocusNode? focusNode,
bool autofocus = false,
Clip? clipBehavior = Clip.none,
WidgetStatesController? statesController,
}) =>
FilledButton.tonal(
onPressed: onPressed,
onLongPress: onLongPress,
onHover: onHover,
onFocusChange: onFocusChange,
style: style,
focusNode: focusNode,
autofocus: autofocus,
clipBehavior: clipBehavior,
statesController: statesController,
child: this,
);