merge method
Merges this object with other, returning a new object of type T.
Implementation
@override
TextStyleData merge(TextStyleData? other) {
if (other == null) return this;
assert(
ref == null && other.ref == null,
'Cannot merge token refs',
);
return TextStyleData(
background: other.background ?? background,
backgroundColor: other.backgroundColor ?? backgroundColor,
color: other.color ?? color,
debugLabel: other.debugLabel ?? debugLabel,
decoration: other.decoration ?? decoration,
decorationColor: other.decorationColor ?? decorationColor,
decorationStyle: other.decorationStyle ?? decorationStyle,
decorationThickness: other.decorationThickness ?? decorationThickness,
fontFamily: other.fontFamily ?? fontFamily,
fontFamilyFallback: [
...?fontFamilyFallback,
...?other.fontFamilyFallback,
],
fontFeatures: other.fontFeatures ?? fontFeatures,
fontSize: other.fontSize ?? fontSize,
fontStyle: other.fontStyle ?? fontStyle,
fontWeight: other.fontWeight ?? fontWeight,
foreground: other.foreground ?? foreground,
height: other.height ?? height,
letterSpacing: other.letterSpacing ?? letterSpacing,
locale: other.locale ?? locale,
shadows: shadows?.merge(other.shadows) ?? other.shadows,
textBaseline: other.textBaseline ?? textBaseline,
wordSpacing: other.wordSpacing ?? wordSpacing,
);
}