PopupMenuItem<T> constructor Null safety

const PopupMenuItem<T>(
  1. {Key? key,
  2. T? value,
  3. VoidCallback? onTap,
  4. bool enabled = true,
  5. double height = kMinInteractiveDimension,
  6. EdgeInsets? padding,
  7. TextStyle? textStyle,
  8. MaterialStateProperty<TextStyle?>? labelTextStyle,
  9. MouseCursor? mouseCursor,
  10. required Widget? child}
)

Creates an item for a popup menu.

By default, the item is enabled.

The enabled and height arguments must not be null.

Implementation

const PopupMenuItem({
  super.key,
  this.value,
  this.onTap,
  this.enabled = true,
  this.height = kMinInteractiveDimension,
  this.padding,
  this.textStyle,
  this.labelTextStyle,
  this.mouseCursor,
  required this.child,
}) : assert(enabled != null),
     assert(height != null);