BaseButton constructor
const
BaseButton({
- Key? key,
- Color? color,
- VoidCallback? onPressed,
- Color? disabledColor,
- EdgeInsetsGeometry? padding,
- Widget? child,
- double? minSize = 44.0,
- double? pressedOpacity = 0.4,
- BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(8.0)),
- AlignmentGeometry alignment = Alignment.center,
- bool filledButton = false,
- VoidCallback? onLongPress,
- ButtonStyle? style,
- ValueChanged<
bool> ? onHighlightChanged, - ButtonTextTheme? textTheme,
- Color? textColor,
- Color? disabledTextColor,
- Color? focusColor,
- Color? hoverColor,
- Color? highlightColor,
- Color? splashColor,
- Brightness? colorBrightness,
- double? elevation,
- double? focusElevation,
- double? highlightElevation,
- double? disabledElevation,
- VisualDensity? visualDensity,
- ShapeBorder? shape,
- Clip clipBehavior = Clip.none,
- FocusNode? focusNode,
- bool autofocus = false,
- MaterialTapTargetSize? materialTapTargetSize,
- Duration? animationDuration,
- double? minWidth,
- MouseCursor? mouseCursor,
- double? hoverElevation,
- bool enableFeedback = true,
- double? height = 48.0,
- bool textButton = false,
- bool outlinedButton = false,
- bool elevatedButton = false,
- bool filledTonalButton = false,
- bool adaptiveHaptics = true,
- bool useCNButton = false,
- CNButtonStyle? cnButtonStyle,
- bool shrinkWrap = false,
- 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);