fluttercandies / extended_tabs

A powerful official extension library of Tab/TabBar/TabView, which support to scroll ancestor or child Tabs when current is overscroll, and set scroll direction and cache extent.
https://fluttercandies.github.io/extended_tabs/
MIT License
268 stars 49 forks source link

tab 文字设置背景色的时候 设置 foregroundIndicator: true, 这时候 指示器的颜色会盖住文字颜色 #26

Closed desire0420 closed 1 year ago

desire0420 commented 1 year ago

ExtendedTabBar( tabs: List.generate(_tabTitle.length, (int index) => Container( color: Colors.red, child: Tab(text: _tabTitle[index].title))), controller: _tabController, labelPadding: EdgeInsets.symmetric(horizontal: 12.w), indicatorSize: TabBarIndicatorSize.tab, labelColor: MyColor.color_FF000000, labelStyle: TextStyle(fontSize: 15.sp, color: MyColor.color_FF000000, fontWeight: FontWeight.w700), unselectedLabelColor: MyColor.color_FFFFFFFF, unselectedLabelStyle: TextStyle(fontSize: 15.sp, color: MyColor.color_FFFFFFFF), dragStartBehavior: DragStartBehavior.start, foregroundIndicator: true, indicatorWeight: 0, isScrollable: true, indicator: ColorTabIndicator(Colors.blue), )

tab 文字设置背景色的时候 设置 foregroundIndicator: true, 这时候 指示器的颜色会盖住文字颜色 如下图 选中的指示器是蓝色 未选中的背景色是红色

image
zmtzawqlp commented 1 year ago

foregroundIndicator 为true 的意思就是 装饰器在文本之前,就是这样设计的

desire0420 commented 1 year ago

foregroundIndicator 为true 的意思就是 装饰器在文本之前,就是这样设计的 请问下这种效果 要怎么样实现呢

image
zmtzawqlp commented 1 year ago

别设置成 true 不就好了吗,demo里面的不就是这样子的。