你好,我在Flutter中有一个标签栏,想要禁用在标签之间滑动的功能。
// Set the bottom navigation bar
bottomNavigationBar: new Material(
// set the color of the bottom navigation bar
color: const Color(0xFFF7F7F7),
// set the tab bar as the child of bottom navigation bar
child: new TabBar(
tabs: <Tab>[
new Tab(
// set icon to the tab
icon: new Icon(Icons.home,color: Colors.black),
),
new Tab(
icon: new Icon(Icons.favorite,color: Colors.black),
),
new Tab(
icon: new Icon(Icons.search,color: Colors.black),
),
new Tab(
icon: new Icon(Icons.settings,color: Colors.black),
),
],
// setup the controller
controller: controller,
),
),
);
}
}
我正在点击每个选项卡按钮并移动选项卡,我想禁用滑动,谢谢。