CupertinoContextMenu constructor Null safety

CupertinoContextMenu(
  1. {Key? key,
  2. required List<Widget> actions,
  3. required Widget child,
  4. ContextMenuPreviewBuilder? previewBuilder}
)

Create a context menu.

actions is required and cannot be null or empty.

child is required and cannot be null.

Implementation

CupertinoContextMenu({
  super.key,
  required this.actions,
  required this.child,
  this.previewBuilder,
}) : assert(actions != null && actions.isNotEmpty),
     assert(child != null);