I am developing a Flutter app. In this app I have used TabBarController in app bar. I am not using icons and title for AppBar so height is showing me more than expectation. I need help to do this with desired size. I am using following code:
class Dashboard extends StatefulWidget{
@override
State<StatefulWidget> createState() => new _DashboardState();
}
class _DashboardState extends State<Dashboard> with SingleTickerProviderStateMixin{
final List<Tab> myTabs = <Tab>[
new Tab(text: 'page1.',),
new Tab(text: 'page2.'),
];
TabController _tabController;
@override
void initState() {
super.initState();
_tabController = new TabController(length: 3, vsync: this
);
}
@override
void dispose() {
_tabController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: new AppBar(
bottom: new TabBar(
indicatorSize:TabBarIndicatorSize.tab,
controller: _tabController,
tabs: myTabs,
labelStyle: styleTabText,
),
),
body: new TabBarView(
controller: _tabController,
children: myTabs.map((Tab tab) {
return new Center(
child: new Text(
tab.text
)
);
}).toList(),
),
);
}
}

