copyWith method

ContextMenuButtonItem copyWith({
  1. VoidCallback? onPressed,
  2. ContextMenuButtonType? type,
  3. String? label,
})

Creates a new ContextMenuButtonItem with the provided parameters overridden.

Implementation

ContextMenuButtonItem copyWith({
  VoidCallback? onPressed,
  ContextMenuButtonType? type,
  String? label,
}) {
  return ContextMenuButtonItem(
    onPressed: onPressed ?? this.onPressed,
    type: type ?? this.type,
    label: label ?? this.label,
  );
}