MacosIconButton constructor

const MacosIconButton({
  1. Key? key,
  2. required Widget icon,
  3. Color? backgroundColor,
  4. Color? disabledColor,
  5. Color? hoverColor,
  6. VoidCallback? onPressed,
  7. double? pressedOpacity = 0.4,
  8. BoxShape shape = BoxShape.rectangle,
  9. BorderRadius? borderRadius,
  10. AlignmentGeometry alignment = Alignment.center,
  11. String? semanticLabel,
  12. BoxConstraints boxConstraints = const BoxConstraints(minHeight: 20, minWidth: 20, maxWidth: 30, maxHeight: 30),
  13. EdgeInsetsGeometry? padding,
  14. MouseCursor? mouseCursor = SystemMouseCursors.basic,
})

Builds a macOS-style icon button

Implementation

const MacosIconButton({
  Key? key,
  required this.icon,
  this.backgroundColor,
  this.disabledColor,
  this.hoverColor,
  this.onPressed,
  this.pressedOpacity = 0.4,
  this.shape = BoxShape.rectangle,
  this.borderRadius,
  this.alignment = Alignment.center,
  this.semanticLabel,
  this.boxConstraints = const BoxConstraints(
    minHeight: 20,
    minWidth: 20,
    maxWidth: 30,
    maxHeight: 30,
  ),
  this.padding,
  this.mouseCursor = SystemMouseCursors.basic,
})  : assert(pressedOpacity == null ||
          (pressedOpacity >= 0.0 && pressedOpacity <= 1.0)),
      super(key: key);