Skip to content

Commit 1522e9f

Browse files
chrisbobbegnprice
authored andcommitted
profile [nfc]: Wrap Paragraph widget in DefaultTextStyle
This is NFC because baseContentTextStyle just sets the color attribute, and this particular Paragraph only renders a link, which will clobber the default color with the link color. But we're about to move some other text style attributes (size and line height) from Paragraph to baseContentTextStyle, and we don't want the link to lose those style attributes when we make that change.
1 parent c0521f7 commit 1522e9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/widgets/profile.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ class _LinkWidget extends StatelessWidget {
217217
@override
218218
Widget build(BuildContext context) {
219219
final linkNode = LinkNode(url: url, nodes: [TextNode(text)]);
220-
final paragraph = Paragraph(node: ParagraphNode(nodes: [linkNode], links: [linkNode]));
220+
final paragraph = DefaultTextStyle.merge(
221+
style: baseContentTextStyle,
222+
child: Paragraph(node: ParagraphNode(nodes: [linkNode], links: [linkNode])));
221223
return Padding(
222224
padding: const EdgeInsets.symmetric(horizontal: 8),
223225
child: MouseRegion(

0 commit comments

Comments
 (0)