Unverified Commit 4be45e95 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Remove indicator from scrolling tab bars (#123057)

Remove indicator from scrolling tab bars
parent c40dd276
...@@ -1441,13 +1441,17 @@ class _TabBarState extends State<TabBar> { ...@@ -1441,13 +1441,17 @@ class _TabBarState extends State<TabBar> {
if (widget.isScrollable) { if (widget.isScrollable) {
_scrollController ??= _TabBarScrollController(this); _scrollController ??= _TabBarScrollController(this);
tabBar = SingleChildScrollView( tabBar = ScrollConfiguration(
dragStartBehavior: widget.dragStartBehavior, // The scrolling tabs should not show an overscroll indicator.
scrollDirection: Axis.horizontal, behavior: ScrollConfiguration.of(context).copyWith(overscroll: false),
controller: _scrollController, child: SingleChildScrollView(
padding: widget.padding, dragStartBehavior: widget.dragStartBehavior,
physics: widget.physics, scrollDirection: Axis.horizontal,
child: tabBar, controller: _scrollController,
padding: widget.padding,
physics: widget.physics,
child: tabBar,
),
); );
} else if (widget.padding != null) { } else if (widget.padding != null) {
tabBar = Padding( tabBar = Padding(
......
...@@ -1351,6 +1351,13 @@ void main() { ...@@ -1351,6 +1351,13 @@ void main() {
expect(controller.indexIsChanging, false); expect(controller.indexIsChanging, false);
}); });
testWidgets('Scrollable TabBar does not have overscroll indicator', (WidgetTester tester) async {
final List<String> tabs = <String>['A', 'B', 'C'];
await tester.pumpWidget(buildFrame(tabs: tabs, value: 'A', isScrollable: true));
expect(find.byType(GlowingOverscrollIndicator), findsNothing);
});
testWidgets('TabBar should not throw when animation is disabled in controller', (WidgetTester tester) async { testWidgets('TabBar should not throw when animation is disabled in controller', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/102600 // Regression test for https://github.com/flutter/flutter/issues/102600
final List<String> tabs = <String>['A']; final List<String> tabs = <String>['A'];
......
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