MacosPulldownButton constructor
const
MacosPulldownButton({
- Key? key,
- required List<
MacosPulldownMenuEntry> ? items, - String? title,
- String? disabledTitle,
- IconData? icon,
- VoidCallback? onTap,
- TextStyle? style,
- double? itemHeight = _kMenuItemHeight,
- FocusNode? focusNode,
- bool autofocus = false,
- AlignmentGeometry alignment = AlignmentDirectional.centerStart,
Creates a macOS-style pull-down button.
If items is null, the button will be disabled, the down caret icon will be greyed out.
A title or an icon must be provided, to be displayed as the pull-down button's title, but not both at the same time.
If the button is disabled and icon is null, disabledTitle will be displayed if it is non-null. If disabledTitle is null, then title will be displayed if it is non-null.
The autofocus argument must not be null.
Implementation
const MacosPulldownButton({
super.key,
required this.items,
this.title,
this.disabledTitle,
this.icon,
this.onTap,
this.style,
this.itemHeight = _kMenuItemHeight,
this.focusNode,
this.autofocus = false,
this.alignment = AlignmentDirectional.centerStart,
this.menuAlignment = PulldownMenuAlignment.left,
}) : assert(itemHeight == null || itemHeight >= _kMenuItemHeight),
assert(
(title != null || icon != null) && !(title != null && icon != null),
"There should be either a title or an icon argument provided, and not both at at the same time.");