更新时间:2021-12-26 06:43:58
尝试添加这种空函数调用或像这样的onTap为空
Try this adding empty function call or null onTap like this
Widget tabBarWidget() {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1),
border: Border.all(color: Colors.grey, width: 1)),
child: TabBar(
controller: TabController(length: 2, vsync: this),
onTap:(i){}, // or onTap: null,
tabs: [
Tab(
text: 'Recommended',
),
Tab(
text: 'Trending',
)
],
),
);
}