@@ -595,15 +595,19 @@ void main() {
595595 final content = ContentExample .mathBlockKatexSizing;
596596 await prepareContent (tester, plainContent (content.html));
597597
598+ final context = tester.element (find.byType (MathBlock ));
599+ final baseTextStyle =
600+ mkBaseKatexTextStyle (ContentTheme .of (context).textStylePlainParagraph);
601+
598602 final mathBlockNode = content.expectedNodes.single as MathBlockNode ;
599603 final baseNode = mathBlockNode.nodes! .single;
600604 final nodes = baseNode.nodes! .skip (1 ); // Skip .strut node.
601605 for (final katexNode in nodes) {
602- final fontSize = katexNode.styles.fontSizeEm! * kBaseKatexTextStyle .fontSize! ;
606+ final fontSize = katexNode.styles.fontSizeEm! * baseTextStyle .fontSize! ;
603607 checkKatexText (tester, katexNode.text! ,
604608 fontFamily: 'KaTeX_Main' ,
605609 fontSize: fontSize,
606- fontHeight: kBaseKatexTextStyle .height! );
610+ fontHeight: baseTextStyle .height! );
607611 }
608612 });
609613
@@ -616,17 +620,21 @@ void main() {
616620 final content = ContentExample .mathBlockKatexNestedSizing;
617621 await prepareContent (tester, plainContent (content.html));
618622
619- var fontSize = 0.5 * kBaseKatexTextStyle.fontSize! ;
623+ final context = tester.element (find.byType (MathBlock ));
624+ final baseTextStyle =
625+ mkBaseKatexTextStyle (ContentTheme .of (context).textStylePlainParagraph);
626+
627+ var fontSize = 0.5 * baseTextStyle.fontSize! ;
620628 checkKatexText (tester, '1' ,
621629 fontFamily: 'KaTeX_Main' ,
622630 fontSize: fontSize,
623- fontHeight: kBaseKatexTextStyle .height! );
631+ fontHeight: baseTextStyle .height! );
624632
625633 fontSize = 4.976 * fontSize;
626634 checkKatexText (tester, '2' ,
627635 fontFamily: 'KaTeX_Main' ,
628636 fontSize: fontSize,
629- fontHeight: kBaseKatexTextStyle .height! );
637+ fontHeight: baseTextStyle .height! );
630638 });
631639
632640 testWidgets ('displays KaTeX content with different delimiter sizing' , (tester) async {
@@ -642,22 +650,24 @@ void main() {
642650 final baseNode = mathBlockNode.nodes! .single;
643651 var nodes = baseNode.nodes! .skip (1 ); // Skip .strut node.
644652
645- final fontSize = kBaseKatexTextStyle.fontSize! ;
653+ final context = tester.element (find.byType (MathBlock ));
654+ final baseTextStyle =
655+ mkBaseKatexTextStyle (ContentTheme .of (context).textStylePlainParagraph);
646656
647657 final firstNode = nodes.first;
648658 checkKatexText (tester, firstNode.text! ,
649659 fontFamily: 'KaTeX_Main' ,
650- fontSize: fontSize,
651- fontHeight: kBaseKatexTextStyle .height! );
660+ fontSize: baseTextStyle. fontSize! ,
661+ fontHeight: baseTextStyle .height! );
652662 nodes = nodes.skip (1 );
653663
654664 for (var katexNode in nodes) {
655665 katexNode = katexNode.nodes! .single; // Skip empty .mord parent.
656666 final fontFamily = katexNode.styles.fontFamily! ;
657667 checkKatexText (tester, katexNode.text! ,
658668 fontFamily: fontFamily,
659- fontSize: fontSize,
660- fontHeight: kBaseKatexTextStyle .height! );
669+ fontSize: baseTextStyle. fontSize! ,
670+ fontHeight: baseTextStyle .height! );
661671 }
662672 });
663673 });
0 commit comments