merge method

StrutStyle merge(
  1. StrutStyle? other
)

Returns a new strut style that is a combination of this style and the given other style.

All null values of the given style will be replaced with members from this style.

If the given strut style is null, returns this strut style.

Implementation

StrutStyle merge(StrutStyle? other) {
  if (other == null) {
    return this;
  }
  return StrutStyle(
    fontFamily: other.fontFamily ?? fontFamily,
    fontFamilyFallback: other.fontFamilyFallback ?? fontFamilyFallback,
    fontSize: other.fontSize ?? fontSize,
    height: other.height ?? height,
    leadingDistribution: other.leadingDistribution ?? leadingDistribution,
    leading: other.leading ?? leading,
    fontWeight: other.fontWeight ?? fontWeight,
    fontStyle: other.fontStyle ?? fontStyle,
    forceStrutHeight: other.forceStrutHeight ?? forceStrutHeight,
    debugLabel: other.debugLabel ?? debugLabel,
    package: other._package ?? _package,
  );
}