From 8ca99327f9091a7c7ef72bae415f38823ae79144 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Tue, 27 Mar 2018 13:39:05 -0700 Subject: [PATCH] Corrected default tab indicator color (#15959) --- packages/flutter/lib/src/material/tabs.dart | 2 +- packages/flutter/test/material/tabs_test.dart | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index c82a9ee980..db2d61a801 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -691,7 +691,7 @@ class _TabBarState extends State { // When that happens, automatic transitions of the theme will likely look // ugly as the indicator color suddenly snaps to white at one end, but it's // not clear how to avoid that any further. - if (color == Material.of(context).color) + if (color.value == Material.of(context).color.value) color = Colors.white; return new UnderlineTabIndicator( diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 2193632339..0bf2651fd3 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -1721,4 +1721,15 @@ void main() { )); }); + testWidgets('Default tab indicator color is white', (WidgetTester tester) async { + // Regression test for https://github.com/flutter/flutter/issues/15958 + final List tabs = ['LEFT', 'RIGHT']; + await tester.pumpWidget(buildLeftRightApp(tabs: tabs, value: 'LEFT')); + final RenderBox tabBarBox = tester.firstRenderObject(find.byType(TabBar)); + expect(tabBarBox, paints..line( + color: Colors.white, + )); + + }); + }