Я не нашел никаких ссылок в документации о том, как настроить отключенный индикатор. Однако вы можете создать свой собственный виджет, который будет принимать дополнительный украшение параметр:
class DecoratedTabBar extends StatelessWidget implements PreferredSizeWidget {
DecoratedTabBar({@required this.tabBar, @required this.decoration});
final TabBar tabBar;
final BoxDecoration decoration;
@override
Size get preferredSize => tabBar.preferredSize;
@override
Widget build(BuildContext context) {
return Stack(
children: [
Positioned.fill(child: Container(decoration: decoration)),
tabBar,
],
);
}
}
Тогда вы можете украсить свой TabBar так, как вы хотите:
appBar: AppBar(
bottom: DecoratedTabBar(
tabBar: TabBar(
tabs: [
// ...
],
),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.blue,
width: 2.0,
),
),
),
),
),
Что приведет к желаемому поведению:
![TabBar custom decoration](https://i.stack.imgur.com/KkCxR.png)