TabBar(
onTap: (index) {
// print(index);
},
indicatorPadding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30),
vertical: ScreenUtil().setWidth(15)),
indicatorColor: Colors.black,
labelPadding: EdgeInsets.symmetric(horizontal: 0.0),
isScrollable: true,
unselectedLabelStyle: TextStyle(fontSize: ScreenUtil().setSp(28)),
labelStyle: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold),
labelColor: Colors.black,
controller: _tabController,
// tabs: _tabs,
tabs: [
Container(
width: ScreenUtil().setWidth(100),
child: Tab(text: '推荐'),
),
Container(
width: ScreenUtil().setWidth(100),
child: Tab(text: '关注'),
),
Container(
width: ScreenUtil().setWidth(100),
child: Tab(text: '话题'),
),
FLutter tabbar样式
最新推荐文章于 2024-12-25 13:12:19 发布