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(), ); }