ButtonX.icon constructor

const ButtonX.icon(
  1. IconData? icon, {
  2. Key? key,
  3. double? borderRadius,
  4. double? borderWidth,
  5. Color? backgroundColor,
  6. Color? foregroundColor,
  7. EdgeInsetsGeometry? innerPadding,
  8. Size? minSize,
  9. dynamic onPressed()?,
  10. ButtonStyle? style,
  11. FocusNode? focusNode,
  12. bool autofocus = false,
  13. Widget? child,
  14. double? iconSize,
  15. bool? dot,
  16. String? badge,
})

Implementation

const ButtonX.icon(
  this.icon, {
  super.key,
  this.borderRadius,
  this.borderWidth,
  this.backgroundColor, // 按钮背景颜色
  this.foregroundColor, // 文本及图标颜色
  this.innerPadding, // 内边距
  this.minSize, // 最小尺寸限制
  this.onPressed,
  this.style,
  this.focusNode,
  this.autofocus = false,
  this.child,
  this.iconSize,
  this.dot,
  this.badge,
})  : type = ButtonType.icon,
      text = '',
      textColor = null,
      textSize = null,
      textWeight = null,
      textStyle = null,
      onLongPress = null,
      onHover = null,
      onFocusChange = null,
      clipBehavior = Clip.none;