parseInlineStyle static method

TextStyle? parseInlineStyle(
  1. String cssString, {
  2. TextStyle? baseStyle,
})

Parse inline CSS style string to TextStyle

Implementation

static TextStyle? parseInlineStyle(String cssString, {TextStyle? baseStyle}) {
  if (cssString.isEmpty) return baseStyle;

  try {
    final properties = _parseProperties(cssString);
    return _buildTextStyle(properties, baseStyle);
  } catch (e) {
    return baseStyle;
  }
}