|
|
@@ -35,63 +35,72 @@ class IntimacyAnalyseScreenshotReplyView
|
|
|
|
|
|
/// TabBar
|
|
|
Widget _buildTabBar() {
|
|
|
- return Container(
|
|
|
- padding: EdgeInsets.symmetric(vertical: 2.w, horizontal: 2.w),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: ColorName.white50,
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(18.r)),
|
|
|
- ),
|
|
|
- child: TabBar(
|
|
|
- // 是否可以滚动
|
|
|
- isScrollable: false,
|
|
|
- // Tab居中
|
|
|
- tabAlignment: TabAlignment.center,
|
|
|
- // 去除底部的黑线
|
|
|
- dividerHeight: 0,
|
|
|
- indicatorPadding: EdgeInsets.zero,
|
|
|
- // 让Tab严格贴近背景,默认左右会有padding
|
|
|
- indicatorSize: TabBarIndicatorSize.tab,
|
|
|
- // 去除Tab默认的padding,否则Tab之间会有默认的间距
|
|
|
- labelPadding: EdgeInsets.zero,
|
|
|
- // 渐变指示器
|
|
|
- indicator: BoxDecoration(
|
|
|
- // 渐变背景
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [ColorName.bgPurpleTab1, ColorName.bgPurpleTab2],
|
|
|
- begin: Alignment.centerLeft,
|
|
|
- end: Alignment.centerRight,
|
|
|
+ return Stack(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ width: 258.w,
|
|
|
+ height: 40.h,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.white50,
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(18.r)),
|
|
|
),
|
|
|
- shape: BoxShape.rectangle,
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(47.r)),
|
|
|
- ),
|
|
|
- // 选中时的颜色
|
|
|
- labelStyle: TextStyle(
|
|
|
- fontSize: 12.sp,
|
|
|
- fontWeight: FontWeight.w700,
|
|
|
- color: ColorName.white,
|
|
|
),
|
|
|
- // 未选中时的颜色
|
|
|
- unselectedLabelStyle: TextStyle(
|
|
|
- fontSize: 12.sp,
|
|
|
- color: ColorName.black60,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
- ),
|
|
|
- // 配置Tab数据
|
|
|
- tabs:
|
|
|
- controller.tabBarList.mapIndexed((int index, tabName) {
|
|
|
- return Tab(
|
|
|
- height: 38.h,
|
|
|
- child: SizedBox(
|
|
|
- width: 127.w,
|
|
|
- child: Center(child: Text(tabName)),
|
|
|
+ Positioned.fill(
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.all(2.w),
|
|
|
+ child: TabBar(
|
|
|
+ // 是否可以滚动
|
|
|
+ isScrollable: false,
|
|
|
+ // Tab居中
|
|
|
+ tabAlignment: TabAlignment.center,
|
|
|
+ // 去除底部的黑线
|
|
|
+ dividerHeight: 0,
|
|
|
+ indicatorPadding: EdgeInsets.zero,
|
|
|
+ // 让Tab严格贴近背景,默认左右会有padding
|
|
|
+ indicatorSize: TabBarIndicatorSize.tab,
|
|
|
+ // 去除Tab默认的padding,否则Tab之间会有默认的间距
|
|
|
+ labelPadding: EdgeInsets.zero,
|
|
|
+ // 渐变指示器
|
|
|
+ indicator: BoxDecoration(
|
|
|
+ // 渐变背景
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [ColorName.bgPurpleTab1, ColorName.bgPurpleTab2],
|
|
|
+ begin: Alignment.centerLeft,
|
|
|
+ end: Alignment.centerRight,
|
|
|
),
|
|
|
- );
|
|
|
- }).toList(),
|
|
|
- controller: controller.tabController,
|
|
|
- onTap: (index) {
|
|
|
- controller.handleTabChange(index);
|
|
|
- },
|
|
|
- ),
|
|
|
+ shape: BoxShape.rectangle,
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(47.r)),
|
|
|
+ ),
|
|
|
+ // 选中时的颜色
|
|
|
+ labelStyle: TextStyle(
|
|
|
+ fontSize: 12.sp,
|
|
|
+ fontWeight: FontWeight.w700,
|
|
|
+ color: ColorName.white,
|
|
|
+ ),
|
|
|
+ // 未选中时的颜色
|
|
|
+ unselectedLabelStyle: TextStyle(
|
|
|
+ fontSize: 12.sp,
|
|
|
+ color: ColorName.black60,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ // 配置Tab数据
|
|
|
+ tabs:
|
|
|
+ controller.tabBarList.mapIndexed((int index, tabName) {
|
|
|
+ return Tab(
|
|
|
+ child: SizedBox(
|
|
|
+ width: 127.w,
|
|
|
+ child: Center(child: Text(tabName)),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }).toList(),
|
|
|
+ controller: controller.tabController,
|
|
|
+ onTap: (index) {
|
|
|
+ controller.handleTabChange(index);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
);
|
|
|
}
|
|
|
|