copyWith method

MenuStyle copyWith({
  1. MaterialStateProperty<Color?>? backgroundColor,
  2. MaterialStateProperty<Color?>? shadowColor,
  3. MaterialStateProperty<Color?>? surfaceTintColor,
  4. MaterialStateProperty<double?>? elevation,
  5. MaterialStateProperty<EdgeInsetsGeometry?>? padding,
  6. MaterialStateProperty<Size?>? minimumSize,
  7. MaterialStateProperty<Size?>? fixedSize,
  8. MaterialStateProperty<Size?>? maximumSize,
  9. MaterialStateProperty<BorderSide?>? side,
  10. MaterialStateProperty<OutlinedBorder?>? shape,
  11. MaterialStateProperty<MouseCursor?>? mouseCursor,
  12. VisualDensity? visualDensity,
  13. AlignmentGeometry? alignment,
})

Returns a copy of this MenuStyle with the given fields replaced with the new values.

Implementation

MenuStyle copyWith({
  MaterialStateProperty<Color?>? backgroundColor,
  MaterialStateProperty<Color?>? shadowColor,
  MaterialStateProperty<Color?>? surfaceTintColor,
  MaterialStateProperty<double?>? elevation,
  MaterialStateProperty<EdgeInsetsGeometry?>? padding,
  MaterialStateProperty<Size?>? minimumSize,
  MaterialStateProperty<Size?>? fixedSize,
  MaterialStateProperty<Size?>? maximumSize,
  MaterialStateProperty<BorderSide?>? side,
  MaterialStateProperty<OutlinedBorder?>? shape,
  MaterialStateProperty<MouseCursor?>? mouseCursor,
  VisualDensity? visualDensity,
  AlignmentGeometry? alignment,
}) {
  return MenuStyle(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    shadowColor: shadowColor ?? this.shadowColor,
    surfaceTintColor: surfaceTintColor ?? this.surfaceTintColor,
    elevation: elevation ?? this.elevation,
    padding: padding ?? this.padding,
    minimumSize: minimumSize ?? this.minimumSize,
    fixedSize: fixedSize ?? this.fixedSize,
    maximumSize: maximumSize ?? this.maximumSize,
    side: side ?? this.side,
    shape: shape ?? this.shape,
    mouseCursor: mouseCursor ?? this.mouseCursor,
    visualDensity: visualDensity ?? this.visualDensity,
    alignment: alignment ?? this.alignment,
  );
}