主要内容有:TabBar、TabBarView、TabController、TabPageSelector。
It is typically not necessary to nest Scaffolds. For example, in a tabbed UI, where the bottomNavigationBar is a TabBar and the body is a TabBarView, you might be tempted to make each tab bar view a scaffold with a differently titled AppBar. Rather, it would be better to add a listener to the TabController that updates the AppBar
TabController(vsync: tickerProvider, length: tabCount)..addListener(() {
if (!tabController.indexIsChanging) {
setState(() {
// Rebuild the enclosing scaffold with a new AppBar title
appBarTitle = 'Tab ${tabController.index}';
});
}
})