CustomPopupMenuButton<T> constructor

const CustomPopupMenuButton<T>({
  1. Key? key,
  2. required PopupMenuItemBuilder<T> itemBuilder,
  3. T? initialValue,
  4. PopupMenuItemSelected<T>? onSelected,
  5. PopupMenuCanceled? onCanceled,
  6. String? tooltip,
  7. double? elevation,
  8. EdgeInsetsGeometry padding = const EdgeInsets.all(8.0),
  9. Widget? child,
  10. double? splashRadius,
  11. Widget? icon,
  12. double? iconSize,
  13. Offset offset = Offset.zero,
  14. bool enabled = true,
  15. ShapeBorder? shape,
  16. Color? color,
  17. Color? hoverColor,
  18. bool? enableFeedback,
  19. BoxConstraints? constraints,
  20. PopupMenuPosition position = PopupMenuPosition.over,
  21. Color? backgroundIconColor,
  22. EdgeInsets? iconPadding,
})

Creates a button that shows a popup menu.

The itemBuilder argument must not be null.

Implementation

const CustomPopupMenuButton({
  super.key,
  required this.itemBuilder,
  this.initialValue,
  this.onSelected,
  this.onCanceled,
  this.tooltip,
  this.elevation,
  this.padding = const EdgeInsets.all(8.0),
  this.child,
  this.splashRadius,
  this.icon,
  this.iconSize,
  this.offset = Offset.zero,
  this.enabled = true,
  this.shape,
  this.color,
  this.hoverColor,
  this.enableFeedback,
  this.constraints,
  this.position = PopupMenuPosition.over,
  this.backgroundIconColor,
  this.iconPadding,
}) : assert(
        !(child != null && icon != null),
        'You can only pass [child] or [icon], not both.',
      );