我正在创建一个在其主页上包含标签栏的应用程序.我希望能够使用我的导航到其中一个标签.另外,我想保留导航到该选项卡的默认方法,即通过在屏幕上滑动或单击选项卡.FloatingActionButton
我还想知道如何将该选项卡链接到其他按钮.
这是我的主页的屏幕截图.

我想在选项卡中定义图标的未选择颜色,就像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) 选择选项卡时,我试图更改选项卡图标的颜色。我知道如何更改图标的颜色,但我不知道如何在选择选项卡时更改颜色。
我的代码:
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)