@@ -722,7 +722,15 @@ class InlineContent extends StatelessWidget {
722
722
required this .style,
723
723
required this .nodes,
724
724
}) {
725
- assert (style.fontSize != null );
725
+ assert (
726
+ style.fontSize != null
727
+ && (
728
+ style.debugLabel! .contains ('weightVariableTextStyle' )
729
+ // ([ContentTheme.textStylePlainParagraph] applies [weightVariableTextStyle])
730
+ || style.debugLabel! .contains ('ContentTheme.textStylePlainParagraph' )
731
+ || style.debugLabel! .contains ('bolderWghtTextStyle' )
732
+ )
733
+ );
726
734
_builder = _InlineContentBuilder (this );
727
735
}
728
736
@@ -733,6 +741,7 @@ class InlineContent extends StatelessWidget {
733
741
///
734
742
/// Must set [TextStyle.fontSize] . Some descendant spans will consume it,
735
743
/// e.g., to make their content slightly smaller than surrounding text.
744
+ /// Similarly with a font weight produced by [weightVariableTextStyle] .
736
745
final TextStyle style;
737
746
738
747
final List <InlineContentNode > nodes;
@@ -797,7 +806,7 @@ class _InlineContentBuilder {
797
806
// and our parser doesn't. So don't do anything here.
798
807
return const TextSpan (text: "" );
799
808
} else if (node is StrongNode ) {
800
- return _buildStrong (node);
809
+ return _buildStrong (ambientTextStyle : widget.style, node);
801
810
} else if (node is DeletedNode ) {
802
811
return _buildDeleted (node);
803
812
} else if (node is EmphasisNode ) {
@@ -831,8 +840,9 @@ class _InlineContentBuilder {
831
840
}
832
841
}
833
842
834
- InlineSpan _buildStrong (StrongNode node) => _buildNodes (node.nodes,
835
- style: weightVariableTextStyle (_context! , wght: 600 ));
843
+ InlineSpan _buildStrong (StrongNode node, {required TextStyle ambientTextStyle}) =>
844
+ _buildNodes (style: bolderWghtTextStyle (ambientTextStyle, by: 200 ),
845
+ node.nodes);
836
846
837
847
InlineSpan _buildDeleted (DeletedNode node) => _buildNodes (node.nodes,
838
848
style: const TextStyle (decoration: TextDecoration .lineThrough));
0 commit comments