指标选项卡颤振
Indicator Tab Flutter
我有一个看起来像这样的标签
但我希望我的标签看起来像这样
我用的是TabBar,我想要绿线像我想要的那样在中间,请帮忙
TabBar(
indicatorColor: HexColor(ColorSetup().colorPrimary),
indicatorWeight: 8,
indicatorSize: TabBarIndicatorSize.tab,
indicatorPadding: EdgeInsets.only(left : 5.w, right : 5.w, top : 4.h),
labelColor: HexColor(ColorSetup().colorBlack),
labelStyle: TextStyle(
fontSize: 14.sp,
fontFamily: StringSetup().dinFont,
fontWeight: FontWeight.w700,
color: HexColor(ColorSetup().colorBlack)),
unselectedLabelStyle: TextStyle(
fontSize: 14.sp,
fontFamily: StringSetup().dinFont,
fontWeight: FontWeight.w400,
color: HexColor(ColorSetup().colorBlack)),
tabs: <Widget>[
Tab(
text: 'ALL REWARDS',
),
Tab(
text: 'MY REWARDS',
),
],
)
你可以使用这个参数
indicator: UnderlineTabIndicator(
borderSide: BorderSide(width: 3.0, color: Color(0XFF7E7E7E)),
insets: EdgeInsets.only(right: 25, bottom: 0, left: 2),
),
indicatorSize: TabBarIndicatorSize.label,
我有一个看起来像这样的标签
但我希望我的标签看起来像这样
我用的是TabBar,我想要绿线像我想要的那样在中间,请帮忙
TabBar(
indicatorColor: HexColor(ColorSetup().colorPrimary),
indicatorWeight: 8,
indicatorSize: TabBarIndicatorSize.tab,
indicatorPadding: EdgeInsets.only(left : 5.w, right : 5.w, top : 4.h),
labelColor: HexColor(ColorSetup().colorBlack),
labelStyle: TextStyle(
fontSize: 14.sp,
fontFamily: StringSetup().dinFont,
fontWeight: FontWeight.w700,
color: HexColor(ColorSetup().colorBlack)),
unselectedLabelStyle: TextStyle(
fontSize: 14.sp,
fontFamily: StringSetup().dinFont,
fontWeight: FontWeight.w400,
color: HexColor(ColorSetup().colorBlack)),
tabs: <Widget>[
Tab(
text: 'ALL REWARDS',
),
Tab(
text: 'MY REWARDS',
),
],
)
你可以使用这个参数
indicator: UnderlineTabIndicator(
borderSide: BorderSide(width: 3.0, color: Color(0XFF7E7E7E)),
insets: EdgeInsets.only(right: 25, bottom: 0, left: 2),
),
indicatorSize: TabBarIndicatorSize.label,