PopupMenuButton<T> constructor

const PopupMenuButton<T>({Key key, @required PopupMenuItemBuilder<T> itemBuilder, T initialValue, PopupMenuItemSelected<T> onSelected, PopupMenuCanceled onCanceled, String tooltip, double elevation, EdgeInsetsGeometry padding: const EdgeInsets.all(8.0), Widget child, Icon icon, Offset offset: Offset.zero, bool enabled: true, ShapeBorder shape, Color color })

Creates a button that shows a popup menu.

The itemBuilder argument must not be null.

Implementation

const PopupMenuButton({
  Key key,
  @required this.itemBuilder,
  this.initialValue,
  this.onSelected,
  this.onCanceled,
  this.tooltip,
  this.elevation,
  this.padding = const EdgeInsets.all(8.0),
  this.child,
  this.icon,
  this.offset = Offset.zero,
  this.enabled = true,
  this.shape,
  this.color,
}) : assert(itemBuilder != null),
     assert(offset != null),
     assert(enabled != null),
     assert(!(child != null && icon != null)), // fails if passed both parameters
     super(key: key);