小编Chi*_*jar的帖子

如何删除颤振中选项卡之间的多余空间?

我已经TabBar()在我的AppBar().

现在,选项卡之间有额外的空间。我在 Chrome(网络)上运行它。我尝试向indicatorPadding,labelPaddingpadding内部参数添加零填充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)

tabbar flutter flutter-layout

15
推荐指数
3
解决办法
2万
查看次数

标签 统计

flutter ×1

flutter-layout ×1

tabbar ×1