@@ -12,6 +12,7 @@ class CssBoxWidget extends StatelessWidget {
12
12
this .textDirection,
13
13
this .childIsReplaced = false ,
14
14
this .shrinkWrap = false ,
15
+ this .top = false ,
15
16
});
16
17
17
18
/// Generates a CSSBoxWidget that contains a list of InlineSpan children.
@@ -22,6 +23,7 @@ class CssBoxWidget extends StatelessWidget {
22
23
this .textDirection,
23
24
this .childIsReplaced = false ,
24
25
this .shrinkWrap = false ,
26
+ this .top = false ,
25
27
}) : child = _generateWidgetChild (children, style);
26
28
27
29
/// The child to be rendered within the CSS Box.
@@ -45,6 +47,9 @@ class CssBoxWidget extends StatelessWidget {
45
47
/// necessarily take up the full available width unless necessary
46
48
final bool shrinkWrap;
47
49
50
+ /// For the root widget, so textScaleFactor, etc are only applied once
51
+ final bool top;
52
+
48
53
@override
49
54
Widget build (BuildContext context) {
50
55
final markerBox = style.listStylePosition == ListStylePosition .outside
@@ -70,7 +75,12 @@ class CssBoxWidget extends StatelessWidget {
70
75
),
71
76
width: _shouldExpandToFillBlock () ? double .infinity : null ,
72
77
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
+ ),
74
84
),
75
85
if (markerBox != null ) Text .rich (markerBox),
76
86
],
@@ -93,8 +103,8 @@ class CssBoxWidget extends StatelessWidget {
93
103
}
94
104
}
95
105
96
- return RichText (
97
- text : TextSpan (
106
+ return Text . rich (
107
+ TextSpan (
98
108
style: style.generateTextStyle (),
99
109
children: children,
100
110
),
0 commit comments