getTextStyle method

TextStyle getTextStyle(
  1. TextStyle? textStyle,
  2. Color? color
)

Returns a TextStyle with the specified color if the textStyle is not null, otherwise returns a TextStyle with the specified color, or an empty TextStyle.

Implementation

TextStyle getTextStyle(TextStyle? textStyle, Color? color) {
  if (textStyle != null && textStyle.color != null) {
    return textStyle;
  }

  return (textStyle ?? const TextStyle()).copyWith(color: color);
}