copyWith method Null safety

PopupMenuThemeData copyWith(
  1. {Color? color,
  2. ShapeBorder? shape,
  3. double? elevation,
  4. TextStyle? textStyle,
  5. bool? enableFeedback}
)

Creates a copy of this object with the given fields replaced with the new values.

Implementation

PopupMenuThemeData copyWith({
  Color? color,
  ShapeBorder? shape,
  double? elevation,
  TextStyle? textStyle,
  bool? enableFeedback,
}) {
  return PopupMenuThemeData(
    color: color ?? this.color,
    shape: shape ?? this.shape,
    elevation: elevation ?? this.elevation,
    textStyle: textStyle ?? this.textStyle,
    enableFeedback: enableFeedback ?? this.enableFeedback,
  );
}