TextStyle merge(TextStyle other)

Returns a new text style that matches this text style but with some values replaced by the non-null parameters of the given text style. If the given text style is null, simply returns this text style.

Source

TextStyle merge(TextStyle other) {
  if (other == null)
    return this;
  assert(other.inherit);
  return copyWith(
    color: other.color,
    fontFamily: other.fontFamily,
    fontSize: other.fontSize,
    fontWeight: other.fontWeight,
    fontStyle: other.fontStyle,
    letterSpacing: other.letterSpacing,
    wordSpacing: other.wordSpacing,
    textBaseline: other.textBaseline,
    height: other.height,
    decoration: other.decoration,
    decorationColor: other.decorationColor,
    decorationStyle: other.decorationStyle
  );
}