@@ -31,6 +31,7 @@ class IconThemeData with Diagnosticable {
3131 this .color,
3232 double ? opacity,
3333 this .shadows,
34+ this .applyTextScaling,
3435 }) : _opacity = opacity,
3536 assert (fill == null || (0.0 <= fill && fill <= 1.0 )),
3637 assert (weight == null || (0.0 < weight)),
@@ -48,7 +49,8 @@ class IconThemeData with Diagnosticable {
4849 opticalSize = 48.0 ,
4950 color = const Color (0xFF000000 ),
5051 _opacity = 1.0 ,
51- shadows = null ;
52+ shadows = null ,
53+ applyTextScaling = false ;
5254
5355 /// Creates a copy of this icon theme but with the given fields replaced with
5456 /// the new values.
@@ -61,6 +63,7 @@ class IconThemeData with Diagnosticable {
6163 Color ? color,
6264 double ? opacity,
6365 List <Shadow >? shadows,
66+ bool ? applyTextScaling,
6467 }) {
6568 return IconThemeData (
6669 size: size ?? this .size,
@@ -71,6 +74,7 @@ class IconThemeData with Diagnosticable {
7174 color: color ?? this .color,
7275 opacity: opacity ?? this .opacity,
7376 shadows: shadows ?? this .shadows,
77+ applyTextScaling: applyTextScaling ?? this .applyTextScaling,
7478 );
7579 }
7680
@@ -90,6 +94,7 @@ class IconThemeData with Diagnosticable {
9094 color: other.color,
9195 opacity: other.opacity,
9296 shadows: other.shadows,
97+ applyTextScaling: other.applyTextScaling,
9398 );
9499 }
95100
@@ -118,7 +123,8 @@ class IconThemeData with Diagnosticable {
118123 && grade != null
119124 && opticalSize != null
120125 && color != null
121- && opacity != null ;
126+ && opacity != null
127+ && applyTextScaling != null ;
122128
123129 /// The default for [Icon.size] .
124130 ///
@@ -163,6 +169,9 @@ class IconThemeData with Diagnosticable {
163169 /// The default for [Icon.shadows] .
164170 final List <Shadow >? shadows;
165171
172+ /// The default for [Icon.applyTextScaling] .
173+ final bool ? applyTextScaling;
174+
166175 /// Linearly interpolate between two icon theme data objects.
167176 ///
168177 /// {@macro dart.ui.shadow.lerp}
@@ -179,6 +188,7 @@ class IconThemeData with Diagnosticable {
179188 color: Color .lerp (a? .color, b? .color, t),
180189 opacity: ui.lerpDouble (a? .opacity, b? .opacity, t),
181190 shadows: Shadow .lerpList (a? .shadows, b? .shadows, t),
191+ applyTextScaling: t < 0.5 ? a? .applyTextScaling : b? .applyTextScaling,
182192 );
183193 }
184194
@@ -195,7 +205,8 @@ class IconThemeData with Diagnosticable {
195205 && other.opticalSize == opticalSize
196206 && other.color == color
197207 && other.opacity == opacity
198- && listEquals (other.shadows, shadows);
208+ && listEquals (other.shadows, shadows)
209+ && other.applyTextScaling == applyTextScaling;
199210 }
200211
201212 @override
@@ -208,6 +219,7 @@ class IconThemeData with Diagnosticable {
208219 color,
209220 opacity,
210221 shadows == null ? null : Object .hashAll (shadows! ),
222+ applyTextScaling,
211223 );
212224
213225 @override
@@ -221,5 +233,6 @@ class IconThemeData with Diagnosticable {
221233 properties.add (ColorProperty ('color' , color, defaultValue: null ));
222234 properties.add (DoubleProperty ('opacity' , opacity, defaultValue: null ));
223235 properties.add (IterableProperty <Shadow >('shadows' , shadows, defaultValue: null ));
236+ properties.add (DiagnosticsProperty <bool >('applyTextScaling' , applyTextScaling, defaultValue: null ));
224237 }
225238}
0 commit comments