BaseButton constructor

const BaseButton({
  1. Key? key,
  2. Color? color,
  3. VoidCallback? onPressed,
  4. Color? disabledColor,
  5. EdgeInsetsGeometry? padding,
  6. Widget? child,
  7. double? minSize = 44.0,
  8. double? pressedOpacity = 0.4,
  9. BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(8.0)),
  10. AlignmentGeometry alignment = Alignment.center,
  11. bool filledButton = false,
  12. VoidCallback? onLongPress,
  13. ButtonStyle? style,
  14. ValueChanged<bool>? onHighlightChanged,
  15. ButtonTextTheme? textTheme,
  16. Color? textColor,
  17. Color? disabledTextColor,
  18. Color? focusColor,
  19. Color? hoverColor,
  20. Color? highlightColor,
  21. Color? splashColor,
  22. Brightness? colorBrightness,
  23. double? elevation,
  24. double? focusElevation,
  25. double? highlightElevation,
  26. double? disabledElevation,
  27. VisualDensity? visualDensity,
  28. ShapeBorder? shape,
  29. Clip clipBehavior = Clip.none,
  30. FocusNode? focusNode,
  31. bool autofocus = false,
  32. MaterialTapTargetSize? materialTapTargetSize,
  33. Duration? animationDuration,
  34. double? minWidth,
  35. MouseCursor? mouseCursor,
  36. double? hoverElevation,
  37. bool enableFeedback = true,
  38. double? height = 48.0,
  39. bool textButton = false,
  40. bool outlinedButton = false,
  41. bool elevatedButton = false,
  42. bool filledTonalButton = false,
  43. bool adaptiveHaptics = true,
  44. bool useCNButton = false,
  45. CNButtonStyle? cnButtonStyle,
  46. bool shrinkWrap = false,
  47. BaseParam? baseParam,
})

Implementation

const BaseButton({
  Key? key,
  this.color,
  this.onPressed,
  this.disabledColor,
  this.padding,
  this.child,
  this.minSize = 44.0,
  this.pressedOpacity = 0.4,
  this.borderRadius = const BorderRadius.all(Radius.circular(8.0)),
  this.alignment = Alignment.center,
  this.filledButton = false,
  this.onLongPress,
  this.style,
  this.onHighlightChanged,
  this.textTheme,
  this.textColor,
  this.disabledTextColor,
  this.focusColor,
  this.hoverColor,
  this.highlightColor,
  this.splashColor,
  this.colorBrightness,
  this.elevation,
  this.focusElevation,
  this.highlightElevation,
  this.disabledElevation,
  this.visualDensity,
  this.shape,
  this.clipBehavior = Clip.none,
  this.focusNode,
  this.autofocus = false,
  this.materialTapTargetSize,
  this.animationDuration,
  this.minWidth,
  this.mouseCursor,
  this.hoverElevation,
  this.enableFeedback = true,

  /// Make button same height as CupertinoButton, only effective for MaterialButton
  /// Others need to modify Theme.of(context).buttonTheme.height to take effect
  this.height = 48.0,
  this.textButton = false,
  this.outlinedButton = false,
  this.elevatedButton = false,
  this.filledTonalButton = false,

  /// Enhanced haptic feedback for iOS interactions
  /// CNButton components automatically include liquid glass effects
  this.adaptiveHaptics = true,

  /// CNButton (cupertino_native) properties
  /// Use CNButton for native iOS buttons with built-in liquid glass effects
  this.useCNButton = false,
  this.cnButtonStyle,
  this.shrinkWrap = false,
  BaseParam? baseParam,
}) : super(key: key, baseParam: baseParam);