copyWith method Null safety

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

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,
  MaterialStateProperty<MouseCursor?>? mouseCursor,
}) {
  return PopupMenuThemeData(
    color: color ?? this.color,
    shape: shape ?? this.shape,
    elevation: elevation ?? this.elevation,
    textStyle: textStyle ?? this.textStyle,
    enableFeedback: enableFeedback ?? this.enableFeedback,
    mouseCursor: mouseCursor ?? this.mouseCursor,
  );
}