merge method
Returns a new text style that is a combination of this style and the given
other
style.
Implementation
TextStyle merge(TextStyle? other) {
if (other == null) {
return this;
}
if (!other.inherit) {
return other;
}
return copyWith(
color: other.color,
font: other.font,
fontNormal: other.fontNormal,
fontBold: other.fontBold,
fontItalic: other.fontItalic,
fontBoldItalic: other.fontBoldItalic,
fontFallback: [...other.fontFallback, ...fontFallback],
fontSize: other.fontSize,
fontWeight: other.fontWeight,
fontStyle: other.fontStyle,
letterSpacing: other.letterSpacing,
wordSpacing: other.wordSpacing,
lineSpacing: other.lineSpacing,
height: other.height,
background: other.background,
decoration: decoration?.merge(other.decoration),
decorationColor: other.decorationColor,
decorationStyle: other.decorationStyle,
decorationThickness: other.decorationThickness,
renderingMode: other.renderingMode,
);
}