微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

指标标签颤动

如何解决指标标签颤动

我有一个看起来像这样的标签

enter image description here

但我希望我的标签看起来像这样

enter image description here

我用的是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,

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。