inlineCssToStyle function
Implementation
Style? inlineCssToStyle(String? inlineStyle, OnCssParseError? errorHandler) {
var errors = <cssparser.Message>[];
final sheet = cssparser.parse("*{$inlineStyle}", errors: errors);
if (errors.isEmpty) {
final declarations = DeclarationVisitor().getDeclarations(sheet);
return declarationsToStyle(declarations["*"]!);
} else if (errorHandler != null) {
String? newCss = errorHandler.call(inlineStyle ?? "", errors);
if (newCss != null) {
return inlineCssToStyle(newCss, errorHandler);
}
}
return null;
}