merge method

MenuStyle merge(
  1. MenuStyle? style

Returns a copy of this MenuStyle where the non-null fields in style have replaced the corresponding null fields in this MenuStyle.

In other words, style is used to fill in unspecified (null) fields this MenuStyle.


MenuStyle merge(MenuStyle? style) {
  if (style == null) {
    return this;
  return copyWith(
    backgroundColor: backgroundColor ?? style.backgroundColor,
    shadowColor: shadowColor ?? style.shadowColor,
    surfaceTintColor: surfaceTintColor ?? style.surfaceTintColor,
    elevation: elevation ?? style.elevation,
    padding: padding ?? style.padding,
    minimumSize: minimumSize ?? style.minimumSize,
    fixedSize: fixedSize ?? style.fixedSize,
    maximumSize: maximumSize ?? style.maximumSize,
    side: side ?? style.side,
    shape: shape ?? style.shape,
    mouseCursor: mouseCursor ?? style.mouseCursor,
    visualDensity: visualDensity ?? style.visualDensity,
    alignment: alignment ?? style.alignment,