apply method
Apply existing NikuText's property to current style
Example usage:
final style = NikuText(null)
.color(Colors.blue)
.fontSize(21)
final bold = NikuText(null)
.bold()
build(context) {
return (
NikuText("Applied Style")
.apply(style) // Will have blue color and font size of 21
.apply(bold) // Will have bold style
.build() // Will combine all style
)
}
Implementation
NikuText apply(NikuText instance) => this.set(
color: instance._color ?? this._color,
backgroundColor: instance._backgroundColor ?? this._backgroundColor,
fontSize: instance._fontSize ?? this._fontSize,
fontWeight: instance._fontWeight ?? this._fontWeight,
letterSpacing: instance._letterSpacing ?? this._letterSpacing,
wordSpacing: instance._wordSpacing ?? this._wordSpacing,
height: instance._height ?? this._height,
foreground: instance._foreground ?? this._foreground,
background: instance._background ?? this._background,
shadows: instance._shadows ?? this._shadows,
fontFeatures: instance._fontFeatures ?? this._fontFeatures,
textDecoration: instance._textDecoration ?? this._textDecoration,
textDecorationColor:
instance._textDecorationColor ?? this._textDecorationColor,
textDecorationThickness:
instance._textDecorationThickness ?? this._textDecorationThickness,
fontFamily: instance._fontFamily ?? this._fontFamily,
fontFamilyFallback:
instance._fontFamilyFallback ?? this._fontFamilyFallback,
textBaseline: instance._textBaseline ?? this._textBaseline,
textDirection: instance._textDirection ?? this._textDirection,
textAlign: instance._textAlign ?? this._textAlign,
locale: instance._locale ?? this._locale,
softWrap: instance._softWrap ?? this._softWrap,
overflow: instance._overflow ?? this._overflow,
textScaleFactor: instance._textScaleFactor ?? this._textScaleFactor,
maxLines: instance._maxLines ?? this._maxLines,
semanticsLabel: instance._semanticsLabel ?? this._semanticsLabel,
textWidthBasis: instance._textWidthBasis ?? this._textWidthBasis,
textHeightBehavior:
instance._textHeightBehavior ?? this._textHeightBehavior,
);