FilledButton.tonalIcon constructor

FilledButton.tonalIcon({
  1. Key? key,
  2. required VoidCallback? onPressed,
  3. VoidCallback? onLongPress,
  4. ValueChanged<bool>? onHover,
  5. ValueChanged<bool>? onFocusChange,
  6. ButtonStyle? style,
  7. FocusNode? focusNode,
  8. bool autofocus = false,
  9. Clip? clipBehavior = Clip.none,
  10. MaterialStatesController? statesController,
  11. Widget? icon,
  12. required Widget label,
  13. 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,
     );