Skip to content

Commit

Permalink
content [nfc]: Make paragraph text style const
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Feb 2, 2024
1 parent 6784ef9 commit 97afdcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/widgets/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Paragraph extends StatelessWidget {

final ParagraphNode node;

static TextStyle getTextStyle(BuildContext context) => const TextStyle(
static const textStyle = TextStyle(
fontSize: kBaseFontSize,
height: (17 / kBaseFontSize),
);
Expand All @@ -113,7 +113,7 @@ class Paragraph extends StatelessWidget {

final text = _buildBlockInlineContainer(
node: node,
style: getTextStyle(context),
style: textStyle,
);

// If the paragraph didn't actually have a `p` element in the HTML,
Expand Down Expand Up @@ -646,7 +646,7 @@ class UserMention extends StatelessWidget {
// One hopes an @-mention can't contain an embedded link.
// (The parser on creating a UserMentionNode has a TODO to check that.)
linkRecognizers: null,
style: Paragraph.getTextStyle(context),
style: Paragraph.textStyle,
nodes: node.nodes));
}

Expand Down

0 comments on commit 97afdcd

Please sign in to comment.