PushButton constructor

const PushButton({
  1. Key? key,
  2. required Widget child,
  3. required ControlSize controlSize,
  4. EdgeInsetsGeometry? padding,
  5. Color? color,
  6. Color? disabledColor,
  7. VoidCallback? onPressed,
  8. double? pressedOpacity = 0.4,
  9. BorderRadiusGeometry? borderRadius = const BorderRadius.all(Radius.circular(4.0)),
  10. AlignmentGeometry alignment = Alignment.center,
  11. String? semanticLabel,
  12. MouseCursor? mouseCursor = SystemMouseCursors.basic,
  13. bool? secondary,
})

A control that initiates an action.

Push Buttons are the standard button type in macOS.

Reference:

Implementation

const PushButton({
  super.key,
  required this.child,
  required this.controlSize,
  this.padding,
  this.color,
  this.disabledColor,
  this.onPressed,
  this.pressedOpacity = 0.4,
  this.borderRadius = const BorderRadius.all(Radius.circular(4.0)),
  this.alignment = Alignment.center,
  this.semanticLabel,
  this.mouseCursor = SystemMouseCursors.basic,
  this.secondary,
}) : assert(pressedOpacity == null ||
          (pressedOpacity >= 0.0 && pressedOpacity <= 1.0));