Corrected default tab indicator color (#15959)
diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart
index c82a9ee..db2d61a 100644
--- a/packages/flutter/lib/src/material/tabs.dart
+++ b/packages/flutter/lib/src/material/tabs.dart
@@ -691,7 +691,7 @@
// 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 2193632..0bf2651 100644
--- a/packages/flutter/test/material/tabs_test.dart
+++ b/packages/flutter/test/material/tabs_test.dart
@@ -1721,4 +1721,15 @@
));
});
+ testWidgets('Default tab indicator color is white', (WidgetTester tester) async {
+ // Regression test for https://github.com/flutter/flutter/issues/15958
+ final List<String> tabs = <String>['LEFT', 'RIGHT'];
+ await tester.pumpWidget(buildLeftRightApp(tabs: tabs, value: 'LEFT'));
+ final RenderBox tabBarBox = tester.firstRenderObject<RenderBox>(find.byType(TabBar));
+ expect(tabBarBox, paints..line(
+ color: Colors.white,
+ ));
+
+ });
+
}