ButtonX.primary constructor

ButtonX.primary(
  1. String text, {
  2. Key? key,
  3. double? borderRadius,
  4. double? borderWidth,
  5. EdgeInsetsGeometry? innerPadding,
  6. Size? minSize,
  7. dynamic onPressed()?,
  8. dynamic onLongPress()?,
  9. dynamic onHover(
    1. bool
    )?,
  10. dynamic onFocusChange(
    1. bool
    )?,
  11. ButtonStyle? style,
  12. FocusNode? focusNode,
  13. bool autofocus = false,
  14. Clip clipBehavior = Clip.none,
  15. Widget? child,
  16. Color? textColor,
  17. double? textSize,
  18. FontWeight? textWeight,
  19. TextStyle? textStyle,
  20. IconData? icon,
  21. double? iconSize,
  22. bool? dot,
  23. String? badge,
})

Implementation

ButtonX.primary(
  this.text, {
  super.key,
  this.borderRadius,
  this.borderWidth,
  this.innerPadding, // 内边距
  this.minSize, // 最小尺寸限制
  this.onPressed,
  this.onLongPress,
  this.onHover,
  this.onFocusChange,
  this.style,
  this.focusNode,
  this.autofocus = false,
  this.clipBehavior = Clip.none,
  this.child,
  this.textColor,
  this.textSize,
  this.textWeight,
  this.textStyle,
  this.icon,
  this.iconSize,
  this.dot,
  this.badge,
})  : type = ButtonType.general,
      backgroundColor = ThemeColor.primary,
      foregroundColor = ThemeColor.onPrimary;