PlatformMenuItem constructor Null safety

const PlatformMenuItem(
  1. {required String label,
  2. MenuSerializableShortcut? shortcut,
  3. VoidCallback? onSelected,
  4. Intent? onSelectedIntent}
)

Creates a const PlatformMenuItem.

The label attribute is required.

Implementation

const PlatformMenuItem({
  required this.label,
  this.shortcut,
  this.onSelected,
  this.onSelectedIntent,
}) : assert(onSelected == null || onSelectedIntent == null, 'Only one of onSelected or onSelectedIntent may be specified');