Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scrollable
TabBar
jittering (#150041)
fixes [TabBar with isScrollable set to true is broken](flutter/flutter#150000) This regressed due to a tiny mistake in flutter/flutter#146293 ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'dart:ui'; import 'package:flutter/material.dart'; /// Flutter code sample for [TabBar]. void main() => runApp(const TabBarApp()); class TabBarApp extends StatelessWidget { const TabBarApp({super.key}); @OverRide Widget build(BuildContext context) { return const MaterialApp( home: TabBarExample(), ); } } class TabBarExample extends StatelessWidget { const TabBarExample({super.key}); @OverRide Widget build(BuildContext context) { final List<Tab> tabs = List<Tab>.generate(20, (int index) => Tab(text: 'Tab $index')); return ScrollConfiguration( behavior: ScrollConfiguration.of(context) .copyWith(dragDevices: <PointerDeviceKind>{ PointerDeviceKind.touch, PointerDeviceKind.mouse, }), child: DefaultTabController( length: tabs.length, child: Scaffold( appBar: AppBar( title: const Text('TabBar Sample'), bottom: TabBar( isScrollable: true, tabs: tabs, tabAlignment: TabAlignment.start, ), ), body: TabBarView( children: <Widget>[ for (int i = 0; i < tabs.length; i++) Center( child: Text('Page $i'), ), ], ), ), ), ); } } ``` </details> ### Before https://github.com/flutter/flutter/assets/48603081/b7aa98a2-a6a5-431e-8327-859a11efa129 ### After https://github.com/flutter/flutter/assets/48603081/0435719f-03d4-4d76-8b5a-532894fcf4a3
- Loading branch information