@@ -29,9 +29,7 @@ class TabBarTheme with Diagnosticable {
2929 /// Creates a tab bar theme that can be used with [ThemeData.tabBarTheme] .
3030 const TabBarTheme ({
3131 this .indicator,
32- this .indicatorColor,
3332 this .indicatorSize,
34- this .dividerColor,
3533 this .labelColor,
3634 this .labelPadding,
3735 this .labelStyle,
@@ -45,15 +43,9 @@ class TabBarTheme with Diagnosticable {
4543 /// Overrides the default value for [TabBar.indicator] .
4644 final Decoration ? indicator;
4745
48- /// Overrides the default value for [TabBar.indicatorColor] .
49- final Color ? indicatorColor;
50-
5146 /// Overrides the default value for [TabBar.indicatorSize] .
5247 final TabBarIndicatorSize ? indicatorSize;
5348
54- /// Overrides the default value for [TabBar.dividerColor] .
55- final Color ? dividerColor;
56-
5749 /// Overrides the default value for [TabBar.labelColor] .
5850 final Color ? labelColor;
5951
@@ -88,9 +80,7 @@ class TabBarTheme with Diagnosticable {
8880 /// new values.
8981 TabBarTheme copyWith ({
9082 Decoration ? indicator,
91- Color ? indicatorColor,
9283 TabBarIndicatorSize ? indicatorSize,
93- Color ? dividerColor,
9484 Color ? labelColor,
9585 EdgeInsetsGeometry ? labelPadding,
9686 TextStyle ? labelStyle,
@@ -102,9 +92,7 @@ class TabBarTheme with Diagnosticable {
10292 }) {
10393 return TabBarTheme (
10494 indicator: indicator ?? this .indicator,
105- indicatorColor: indicatorColor ?? this .indicatorColor,
10695 indicatorSize: indicatorSize ?? this .indicatorSize,
107- dividerColor: dividerColor ?? this .dividerColor,
10896 labelColor: labelColor ?? this .labelColor,
10997 labelPadding: labelPadding ?? this .labelPadding,
11098 labelStyle: labelStyle ?? this .labelStyle,
@@ -132,15 +120,13 @@ class TabBarTheme with Diagnosticable {
132120 assert (t != null );
133121 return TabBarTheme (
134122 indicator: Decoration .lerp (a.indicator, b.indicator, t),
135- indicatorColor: Color .lerp (a.indicatorColor, b.indicatorColor, t),
136123 indicatorSize: t < 0.5 ? a.indicatorSize : b.indicatorSize,
137- dividerColor: Color .lerp (a.dividerColor, b.dividerColor, t),
138124 labelColor: Color .lerp (a.labelColor, b.labelColor, t),
139125 labelPadding: EdgeInsetsGeometry .lerp (a.labelPadding, b.labelPadding, t),
140126 labelStyle: TextStyle .lerp (a.labelStyle, b.labelStyle, t),
141127 unselectedLabelColor: Color .lerp (a.unselectedLabelColor, b.unselectedLabelColor, t),
142128 unselectedLabelStyle: TextStyle .lerp (a.unselectedLabelStyle, b.unselectedLabelStyle, t),
143- overlayColor: MaterialStateProperty . lerp < Color ?> (a.overlayColor, b.overlayColor, t, Color .lerp ),
129+ overlayColor: _LerpColors (a.overlayColor, b.overlayColor, t),
144130 splashFactory: t < 0.5 ? a.splashFactory : b.splashFactory,
145131 mouseCursor: t < 0.5 ? a.mouseCursor : b.mouseCursor,
146132 );
@@ -149,9 +135,7 @@ class TabBarTheme with Diagnosticable {
149135 @override
150136 int get hashCode => Object .hash (
151137 indicator,
152- indicatorColor,
153138 indicatorSize,
154- dividerColor,
155139 labelColor,
156140 labelPadding,
157141 labelStyle,
@@ -172,9 +156,7 @@ class TabBarTheme with Diagnosticable {
172156 }
173157 return other is TabBarTheme
174158 && other.indicator == indicator
175- && other.indicatorColor == indicatorColor
176159 && other.indicatorSize == indicatorSize
177- && other.dividerColor == dividerColor
178160 && other.labelColor == labelColor
179161 && other.labelPadding == labelPadding
180162 && other.labelStyle == labelStyle
@@ -185,3 +167,39 @@ class TabBarTheme with Diagnosticable {
185167 && other.mouseCursor == mouseCursor;
186168 }
187169}
170+
171+
172+ @immutable
173+ class _LerpColors implements MaterialStateProperty <Color ?> {
174+ const _LerpColors (this .a, this .b, this .t);
175+
176+ final MaterialStateProperty <Color ?>? a;
177+ final MaterialStateProperty <Color ?>? b;
178+ final double t;
179+
180+ @override
181+ Color ? resolve (Set <MaterialState > states) {
182+ final Color ? resolvedA = a? .resolve (states);
183+ final Color ? resolvedB = b? .resolve (states);
184+ return Color .lerp (resolvedA, resolvedB, t);
185+ }
186+
187+ @override
188+ int get hashCode {
189+ return Object .hash (a, b, t);
190+ }
191+
192+ @override
193+ bool operator == (Object other) {
194+ if (identical (this , other)) {
195+ return true ;
196+ }
197+ if (other.runtimeType != runtimeType) {
198+ return false ;
199+ }
200+ return other is _LerpColors
201+ && other.a == a
202+ && other.b == b
203+ && other.t == t;
204+ }
205+ }
0 commit comments