From bbc901427bec8f1878fb2ce566af145ddb7570d7 Mon Sep 17 00:00:00 2001 From: ritheshSalyan Date: Wed, 18 Aug 2021 17:03:29 +0530 Subject: [PATCH] add Custom Styling attribute --- lib/src/widgets/text_line.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/text_line.dart b/lib/src/widgets/text_line.dart index c557ee2c..4093409a 100644 --- a/lib/src/widgets/text_line.dart +++ b/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); }