MacosIconButton constructor
const
MacosIconButton({
- Key? key,
- required Widget icon,
- Color? backgroundColor,
- Color? disabledColor,
- Color? hoverColor,
- VoidCallback? onPressed,
- double? pressedOpacity = 0.4,
- BoxShape shape = BoxShape.rectangle,
- BorderRadius? borderRadius,
- AlignmentGeometry alignment = Alignment.center,
- String? semanticLabel,
- BoxConstraints boxConstraints = const BoxConstraints(minHeight: 20, minWidth: 20, maxWidth: 30, maxHeight: 30),
- EdgeInsetsGeometry? padding,
- MouseCursor? mouseCursor = SystemMouseCursors.basic,
Builds a macOS-style icon button
Implementation
const MacosIconButton({
super.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));