style method

NikuSelectableText style(
  1. TextStyle? theme
)

Apply text theme to Text

Example Usage: NikuSelectableText("Theme") ..style(Theme.of(context).textTheme.headline1)

Equivalent:

Text(style: input)

Implementation

NikuSelectableText style(TextStyle? theme) {
  if (theme == null) return this;

  return set(
    color: theme.color ?? _color,
    backgroundColor: theme.backgroundColor ?? _backgroundColor,
    fontSize: theme.fontSize ?? _fontSize,
    fontWeight: theme.fontWeight ?? _fontWeight,
    letterSpacing: theme.letterSpacing ?? _letterSpacing,
    wordSpacing: theme.wordSpacing ?? _wordSpacing,
    height: theme.height ?? _height,
    foreground: theme.foreground ?? _foreground,
    background: theme.background ?? _background,
    shadows: theme.shadows ?? _shadows,
    fontFeatures: theme.fontFeatures ?? _fontFeatures,
    fontFamily: theme.fontFamily ?? _fontFamily,
    fontFamilyFallback: theme.fontFamilyFallback ?? _fontFamilyFallback,
    textBaseline: theme.textBaseline ?? _textBaseline,
  );
}