[英]Flutter Custom Tab bar
更改为您的图标和颜色
DefaultTabController(
length: 2, // length of tabs
initialIndex: 0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TabBar(
indicatorColor: Colors.white,
labelColor: Colors.white,
unselectedLabelColor: Colors.grey,
labelStyle: TextStyle(
fontSize: 22.0,
fontWeight:
FontWeight.bold), //For Selected tab
unselectedLabelStyle: TextStyle(
fontSize: 17.0,
fontWeight: FontWeight.bold),
tabs: [
Tab(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.compare_arrows),
const SizedBox(width: 8),
Text('GAMES'),
],
),
),
Tab(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.chat),
const SizedBox(width: 8),
Text('CHAT'),
],
),
),
],
),
Container(
height: 450,
child: TabBarView(children: <Widget>[
Container(),
Container(),
]),
)
],),
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.