add Custom Styling attribute

pull/350/head
ritheshSalyan 4 years ago
parent 7374eee0a2
commit bbc901427b
  1. 12
      lib/src/widgets/text_line.dart

@ -237,7 +237,17 @@ class TextLine extends StatelessWidget {
final backgroundColor = stringToColor(background.value);
res = res.merge(TextStyle(backgroundColor: backgroundColor));
}
if (styleBuilder != null) {
textNode.style.attributes.keys.forEach((key) {
final attribute =
Attribute.fromKeyValue(key, textNode.style.attributes[key]);
if (attribute == null) {
///Unkown Attribute
final customStyle = styleBuilder?.call(attribute!);
if (customStyle != null) res = res.merge(customStyle);
}
});
}
return TextSpan(text: textNode.value, style: res);
}

Loading…
Cancel
Save