FilledButton.tonalIcon constructor
- Key? key,
- required VoidCallback? onPressed,
- VoidCallback? onLongPress,
- ValueChanged<
bool> ? onHover, - ValueChanged<
bool> ? onFocusChange, - ButtonStyle? style,
- FocusNode? focusNode,
- bool autofocus = false,
- Clip? clipBehavior = Clip.none,
- MaterialStatesController? statesController,
- Widget? icon,
- required Widget label,
- IconAlignment? iconAlignment,
Create a filled tonal button from icon and label.
The icon and label are arranged in a row with padding at the start and
end and a gap between them.
If icon is null, this constructor will create a FilledButton
that doesn't display an icon.
Implementation
FilledButton.tonalIcon({
super.key,
required super.onPressed,
super.onLongPress,
super.onHover,
super.onFocusChange,
super.style,
super.focusNode,
super.autofocus = false,
super.clipBehavior = Clip.none,
super.statesController,
Widget? icon,
required Widget label,
IconAlignment? iconAlignment,
}) : _variant = _FilledButtonVariant.tonal,
_addPadding = icon != null,
super(
child: icon != null
? _FilledButtonWithIconChild(
label: label,
icon: icon,
buttonStyle: style,
iconAlignment: iconAlignment,
)
: label,
);