From 0258bd4788f68263d1b508bd29c9eebc6423f872 Mon Sep 17 00:00:00 2001 From: ritheshSalyan Date: Thu, 19 Aug 2021 10:48:34 +0530 Subject: [PATCH] Correct null issue --- lib/src/widgets/text_line.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/src/widgets/text_line.dart b/lib/src/widgets/text_line.dart index 4093409a..d58c4029 100644 --- a/lib/src/widgets/text_line.dart +++ b/lib/src/widgets/text_line.dart @@ -155,11 +155,11 @@ class TextLine extends StatelessWidget { line.style.attributes.keys.forEach((key) { final attribute = Attribute.fromKeyValue(key, line.style.attributes[key]); - if (attribute != null) { + if (attribute == null && line.style.attributes[key]!=null) { /// ///Unkown Attribute /// - final call = styleBuilder?.call(attribute); + final call = styleBuilder?.call(line.style.attributes[key]!); textStyle = textStyle.merge(call); } }); @@ -241,9 +241,12 @@ class TextLine extends StatelessWidget { textNode.style.attributes.keys.forEach((key) { final attribute = Attribute.fromKeyValue(key, textNode.style.attributes[key]); - if (attribute == null) { + if (attribute == null && textNode.style.attributes[key]!=null) { + /// ///Unkown Attribute - final customStyle = styleBuilder?.call(attribute!); + /// + // ignore: lines_longer_than_80_chars + final customStyle = styleBuilder?.call(textNode.style.attributes[key]!); if (customStyle != null) res = res.merge(customStyle); } });