相关疑难解决方法(0)

颤动:使用按钮更改标签栏视图中的当前选项卡

我正在创建一个在其主页上包含标签栏的应用程序.我希望能够使用我的导航到其中一个标签.另外,我想保留导航到该选项卡的默认方法,即通过在屏幕上滑动或单击选项卡.FloatingActionButton

我还想知道如何将该选项卡链接到其他按钮.

这是我的主页的屏幕截图.

主页带有导航标签和浮动操作按钮

dart flutter

20
推荐指数
4
解决办法
2万
查看次数

如何在颤动的选中和未选中状态下更改选项卡图标的颜色?

我想在选项卡中定义图标的未选择颜色,就像unselectedLabelColor一样。

  TabBar(
          indicatorColor: Colors.grey,
          labelColor: Colors.black,
          unselectedLabelColor: Colors.grey,
          tabs: [
            Tab(
                text: 'first',
                icon: Icon(Icons.directions_car, color: Colors.grey)),
            Tab(
                text: 'second',
                icon: Icon(Icons.directions_transit, color: Colors.grey)),
            Tab(
                text: 'third',
                icon: Icon(Icons.directions_bike, color: Colors.grey)),
          ],
        )
Run Code Online (Sandbox Code Playgroud)

flutter

4
推荐指数
5
解决办法
3356
查看次数

选择选项卡时的 TabBar 图标颜色

选择选项卡时,我试图更改选项卡图标的颜色。我知道如何更改图标的颜色,但我不知道如何在选择选项卡时更改颜色。

我的代码:

child: AppBar(
    bottom: TabBar(
        tabs: <Tab>[
            Tab(
                child: new Row(
                    children: <Widget>[
                        new Text("Select", textAlign: TextAlign.start),
                        new SizedBox(
                            width: 24.0,
                        ),
                        new Icon(
                            Icons.arrow_drop_down,
                            color: Colors.blue.shade400,
                        ),
                    ],
                    ....
                )
            )
        ]
    )
)
Run Code Online (Sandbox Code Playgroud)

tabs colors flutter

2
推荐指数
1
解决办法
1751
查看次数

标签 统计

flutter ×3

colors ×1

dart ×1

tabs ×1