Corrected default tab indicator color (#15959)
This commit is contained in:
@@ -691,7 +691,7 @@ class _TabBarState extends State<TabBar> {
|
||||
// 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(
|
||||
|
||||
@@ -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<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,
|
||||
));
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user