TabBar _tabBar() {
return TabBar(
isScrollable: true, // 是否可以滑动
controller: controller,//需要显示tab表头的列表TabController(length: state.tabs.length, vsync: this);final tabs = ["待办事项", "通 知"];
//tab文字类型
unselectedLabelStyle:
TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w500),
//未选择样式
labelStyle: TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w500),
//选择样式
//选中的颜色
labelColor: AppStyle.color1A1A1A,
//未选中的颜色
unselectedLabelColor: AppStyle.color666666,
//自定义指示器
indicator: BoxDecoration(
border: Border.all(
color: AppStyle.colorFFFFFF,
width: 1.w,
),
),
//文本偏移
// labelPadding: EdgeInsets.only(left: 16,top: 15, right: 10),
tabs: controller.state.tabNames.map((value) {
return Center(child: Text(value));
}).toList(),
);
}