我已经TabBar()在我的AppBar().
现在,选项卡之间有额外的空间。我在 Chrome(网络)上运行它。我尝试向indicatorPadding,labelPadding和padding内部参数添加零填充TabBar(),但没有任何内容缩小选项卡栏项目。
那么如何减少它们之间的空间呢?这是代码:
Widget build(BuildContext context) {
return Container(
height: height,
color: Colors.white,
child: TabBar(
indicatorColor: Colors.black,
unselectedLabelColor: Colors.black54,
indicatorSize: TabBarIndicatorSize.label,
labelColor: Colors.black,
labelStyle: const TextStyle(
fontSize: 12,
),
tabs: [
Container(
color: Colors.red,
child: const Tab(
icon: Icon(Icons.home_rounded),
text: "Home",
iconMargin: EdgeInsets.zero,
),
),
Container(
color: Colors.green,
child: const Tab(
icon: Icon(Icons.groups_rounded),
iconMargin: EdgeInsets.zero,
text: "My Network",
),
),
const Tab(
iconMargin: EdgeInsets.zero,
icon: Icon(
Icons.work_rounded, …Run Code Online (Sandbox Code Playgroud)