diff --git a/lib/src/widgets/text_line.dart b/lib/src/widgets/text_line.dart index e45a45b4..65a661b5 100644 --- a/lib/src/widgets/text_line.dart +++ b/lib/src/widgets/text_line.dart @@ -37,6 +37,7 @@ class TextLine extends StatelessWidget { final DefaultStyles styles; final bool readOnly; final StyleBuilder? styleBuilder; + @override Widget build(BuildContext context) { assert(debugCheckHasMediaQuery(context)); @@ -157,15 +158,14 @@ class TextLine extends StatelessWidget { TextStyle _applyCustomAttributes( TextStyle textStyle, Map attributes) { - if (styleBuilder != null) { - attributes.keys - .where((key) => !attributes.containsKey(key)) - .forEach((key) { - /// Custom Attribute - final customAttr = styleBuilder!.call(key); - textStyle = textStyle.merge(customAttr); - }); + if (styleBuilder == null) { + return textStyle; } + attributes.keys.where((key) => !attributes.containsKey(key)).forEach((key) { + /// Custom Attribute + final customAttr = styleBuilder!.call(key); + textStyle = textStyle.merge(customAttr); + }); return textStyle; }