Unverified Commit bef6f306 authored by Darren Austin's avatar Darren Austin Committed by GitHub

Fixed an iconTheme lerping problem with ChipThemeData. (#112216)

parent f16fe11e
......@@ -510,7 +510,9 @@ class ChipThemeData with Diagnosticable {
brightness: t < 0.5 ? a?.brightness ?? Brightness.light : b?.brightness ?? Brightness.light,
elevation: lerpDouble(a?.elevation, b?.elevation, t),
pressElevation: lerpDouble(a?.pressElevation, b?.pressElevation, t),
iconTheme: IconThemeData.lerp(a?.iconTheme, b?.iconTheme, t),
iconTheme: a?.iconTheme != null || b?.iconTheme != null
? IconThemeData.lerp(a?.iconTheme, b?.iconTheme, t)
: null,
);
}
......
......@@ -443,6 +443,7 @@ void main() {
expect(lerp.elevation, 3.0);
expect(lerp.pressElevation, 7.0);
expect(lerp.checkmarkColor, equals(middleGrey));
expect(lerp.iconTheme, isNull);
expect(ChipThemeData.lerp(null, null, 0.25), isNull);
......@@ -466,6 +467,7 @@ void main() {
expect(lerpANull25.elevation, 1.25);
expect(lerpANull25.pressElevation, 2.5);
expect(lerpANull25.checkmarkColor, equals(Colors.white.withAlpha(0x40)));
expect(lerp.iconTheme, isNull);
final ChipThemeData lerpANull75 = ChipThemeData.lerp(null, chipThemeWhite, 0.75)!;
expect(lerpANull75.backgroundColor, equals(Colors.black.withAlpha(0x17)));
......@@ -508,6 +510,7 @@ void main() {
expect(lerpBNull25.elevation, 0.75);
expect(lerpBNull25.pressElevation, 3.0);
expect(lerpBNull25.checkmarkColor, equals(Colors.black.withAlpha(0xbf)));
expect(lerp.iconTheme, isNull);
final ChipThemeData lerpBNull75 = ChipThemeData.lerp(chipThemeBlack, null, 0.75)!;
expect(lerpBNull75.backgroundColor, equals(Colors.white.withAlpha(0x08)));
......@@ -529,6 +532,7 @@ void main() {
expect(lerpBNull75.elevation, 0.25);
expect(lerpBNull75.pressElevation, 1.0);
expect(lerpBNull75.checkmarkColor, equals(Colors.black.withAlpha(0x40)));
expect(lerp.iconTheme, isNull);
});
testWidgets('Chip uses stateful color from chip theme', (WidgetTester tester) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment