@@ -12,6 +12,7 @@ class CssBoxWidget extends StatelessWidget {
1212 this .textDirection,
1313 this .childIsReplaced = false ,
1414 this .shrinkWrap = false ,
15+ this .top = false ,
1516 });
1617
1718 /// Generates a CSSBoxWidget that contains a list of InlineSpan children.
@@ -22,6 +23,7 @@ class CssBoxWidget extends StatelessWidget {
2223 this .textDirection,
2324 this .childIsReplaced = false ,
2425 this .shrinkWrap = false ,
26+ this .top = false ,
2527 }) : child = _generateWidgetChild (children, style);
2628
2729 /// The child to be rendered within the CSS Box.
@@ -45,6 +47,9 @@ class CssBoxWidget extends StatelessWidget {
4547 /// necessarily take up the full available width unless necessary
4648 final bool shrinkWrap;
4749
50+ /// For the root widget, so textScaleFactor, etc are only applied once
51+ final bool top;
52+
4853 @override
4954 Widget build (BuildContext context) {
5055 final markerBox = style.listStylePosition == ListStylePosition .outside
@@ -70,7 +75,12 @@ class CssBoxWidget extends StatelessWidget {
7075 ),
7176 width: _shouldExpandToFillBlock () ? double .infinity : null ,
7277 padding: style.padding ?? EdgeInsets .zero,
73- child: child,
78+ child: top
79+ ? child
80+ : MediaQuery (
81+ data: MediaQuery .of (context).copyWith (textScaleFactor: 1.0 ),
82+ child: child,
83+ ),
7484 ),
7585 if (markerBox != null ) Text .rich (markerBox),
7686 ],
@@ -93,8 +103,8 @@ class CssBoxWidget extends StatelessWidget {
93103 }
94104 }
95105
96- return RichText (
97- text : TextSpan (
106+ return Text . rich (
107+ TextSpan (
98108 style: style.generateTextStyle (),
99109 children: children,
100110 ),
0 commit comments