问题描述
但我希望我的标签看起来像这样
我用的是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,fontWeight: FontWeight.w400,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,