如下图所示,我有第一个标签颜色为绿色
选项卡标题是彩色的,下划线不是
是否可以将标题下的行着色为相同的颜色green
?
child: TabBar(
onTap: (index) {
setState(() {
selectedIndex = index;
});
},
isScrollable: false,
padding: const EdgeInsets.symmetric(horizontal: 10),
controller: _tabController,
labelColor: getIndicatorAndLabelColor(selectedIndex),
unselectedLabelColor: Colors.black,
indicatorWeight: 4,
indicatorColor: getIndicatorAndLabelColor(selectedIndex),
indicatorPadding:
const EdgeInsets.only(left: 15, right: 15, bottom: 10),
indicator: const ShapeDecoration(
shape: UnderlineInputBorder(
borderSide: BorderSide(
color: myAccentColor,
width: 3,
style: BorderStyle.solid))),
tabs: const [
Tab(
text: 'APPROVED',
),
Tab(
text: 'DENIED',
),
Tab(
text: 'PENDING',
),
],
),
2条答案
按热度按时间krcsximq1#
您可以使用
indicatorColor
将其设置为绿色。50pmv0ei2#
谢谢@Yeasin Sheikh,我终于找到了解决办法