ShadButton constructor

const ShadButton({
  1. Key? key,
  2. Widget? child,
  3. Widget? leading,
  4. Widget? trailing,
  5. VoidCallback? onPressed,
  6. ShadButtonSize? size,
  7. MouseCursor? cursor,
  8. double? width,
  9. double? height,
  10. EdgeInsetsGeometry? padding,
  11. Color? backgroundColor,
  12. Color? hoverBackgroundColor,
  13. Color? foregroundColor,
  14. Color? hoverForegroundColor,
  15. bool autofocus = false,
  16. FocusNode? focusNode,
  17. Color? pressedBackgroundColor,
  18. Color? pressedForegroundColor,
  19. List<BoxShadow>? shadows,
  20. Gradient? gradient,
  21. TextDecoration? textDecoration,
  22. TextDecoration? hoverTextDecoration,
  23. ShadDecoration? decoration,
  24. bool enabled = true,
  25. VoidCallback? onLongPress,
  26. ShadStatesController? statesController,
  27. MainAxisAlignment? mainAxisAlignment,
  28. CrossAxisAlignment? crossAxisAlignment,
  29. ShadHoverStrategies? hoverStrategies,
  30. ValueChanged<bool>? onHoverChange,
  31. ValueChanged<TapDownDetails>? onTapDown,
  32. ValueChanged<TapUpDetails>? onTapUp,
  33. VoidCallback? onTapCancel,
  34. ValueChanged<TapDownDetails>? onSecondaryTapDown,
  35. ValueChanged<TapUpDetails>? onSecondaryTapUp,
  36. VoidCallback? onSecondaryTapCancel,
  37. ValueChanged<LongPressStartDetails>? onLongPressStart,
  38. VoidCallback? onLongPressCancel,
  39. VoidCallback? onLongPressUp,
  40. ValueChanged<LongPressDownDetails>? onLongPressDown,
  41. ValueChanged<LongPressEndDetails>? onLongPressEnd,
  42. VoidCallback? onDoubleTap,
  43. ValueChanged<TapDownDetails>? onDoubleTapDown,
  44. VoidCallback? onDoubleTapCancel,
  45. Duration? longPressDuration,
  46. TextDirection? textDirection,
  47. double? gap,
  48. ValueChanged<bool>? onFocusChange,
  49. bool? expands,
  50. TextStyle? textStyle,
  51. bool? canRequestFocus,
})

Creates a primary variant button widget.

Implementation

const ShadButton({
  super.key,
  this.child,
  this.leading,
  this.trailing,
  this.onPressed,
  this.size,
  this.cursor,
  this.width,
  this.height,
  this.padding,
  this.backgroundColor,
  this.hoverBackgroundColor,
  this.foregroundColor,
  this.hoverForegroundColor,
  this.autofocus = false,
  this.focusNode,
  this.pressedBackgroundColor,
  this.pressedForegroundColor,
  this.shadows,
  this.gradient,
  this.textDecoration,
  this.hoverTextDecoration,
  this.decoration,
  this.enabled = true,
  this.onLongPress,
  this.statesController,
  this.mainAxisAlignment,
  this.crossAxisAlignment,
  this.hoverStrategies,
  this.onHoverChange,
  this.onTapDown,
  this.onTapUp,
  this.onTapCancel,
  this.onSecondaryTapDown,
  this.onSecondaryTapUp,
  this.onSecondaryTapCancel,
  this.onLongPressStart,
  this.onLongPressCancel,
  this.onLongPressUp,
  this.onLongPressDown,
  this.onLongPressEnd,
  this.onDoubleTap,
  this.onDoubleTapDown,
  this.onDoubleTapCancel,
  this.longPressDuration,
  this.textDirection,
  this.gap,
  this.onFocusChange,
  this.expands,
  this.textStyle,
  this.canRequestFocus,
}) : variant = ShadButtonVariant.primary;