Button.icon constructor

Button.icon({
  1. Key? key,
  2. required Widget icon,
  3. ButtonThemeData? style,
  4. IconThemeButtonStateBuilder? iconTheme,
  5. VoidCallback? onPressed,
  6. VoidCallback? onLongPress,
  7. String? semanticLabel,
  8. FocusNode? focusNode,
  9. bool autofocus = false,
})

Creates a button with an icon. Uses IconButton under the hood

Implementation

Button.icon({
  Key? key,
  required Widget icon,
  ButtonThemeData? style,
  IconThemeButtonStateBuilder? iconTheme,
  this.onPressed,
  this.onLongPress,
  this.semanticLabel,
  this.focusNode,
  this.autofocus = false,
})  : child = IconButton(
        icon: icon,
        onPressed: onPressed,
        onLongPress: onLongPress,
        semanticLabel: semanticLabel,
        style: style,
        iconTheme: iconTheme,
        focusNode: focusNode,
      ),
      style = null,
      type = _ButtonType.icon,
      builder = null,
      super(key: key);