Tabbar居左
const double _kTabHeight = 46.0;
return PreferredSize(
preferredSize: Size.fromHeight(_kTabHeight),
child: TabBar(),
//child: buildTheme(),
);
对TabController的监听在点击Tab后会执行两次
tabController.addListener(() {
if (tabController.indexIsChanging) {
print(tabController.index);
}
});
去除点击色
return Theme(
data: ThemeData(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
),
child: new TabBar(
controller: tabController,
tabs: <Tab>[
new Tab(text: "首页"),
],
// 去除下划线
indicator: const BoxDecoration(),
),
);