|
|
|
@ -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<String, Attribute> 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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|