【发布时间】:2019-03-27 12:43:45
【问题描述】:
我有一个标签栏功能,其中我显示了一个圆环图和车辆列表,但我需要显示用户选择的哪个标签,我在 TabBar 中有 indicatorColor 但我需要填充渐变线,如图所示请帮帮我。
PS:如果可能的话,请告诉我如何给主题颜色表示主色作为渐变的主要颜色???
return Scaffold(
body: new DefaultTabController(
length: 2,
child: new Column(
children: <Widget>[
new Container(
width: 1200.0,
child: new Container(
color: Colors.white,
child: new TabBar(
labelColor: Colors.black,
tabs: [
Tab(
child: new Text("Visual",
style: new TextStyle(fontSize: 20.0)
),
),
Tab(
child: new Text("Tabular",
style: new TextStyle(fontSize: 20.0)),
),
],
),
),
),
new Expanded(
child: new TabBarView(
children: [
Tab(
child: new RefreshIndicator(
child: new Text('DONUT CHART'),
onRefresh: refreshList,
key: refreshKey1,
),
),
Tab(
child: new RefreshIndicator(
child: new Text('List of vehicles'),
onRefresh: refreshList,
key: refreshKey2,
),
),
],
),
),
],
),
),
);
【问题讨论】:
-
我处理了)更新了我的答案
-
是的,一个有效,我还有一个疑问,我们如何为底部导航栏图标提供渐变?请帮帮我先生.. 如图所示..
-
必须调查 %) 我认为创建新问题会更好。也许有人已经知道答案了