Flutter -- Tab

Flutter – Tab

本文通过提供几个例子介绍Flutter Tab的使用
http://cairuoyu.com/flutter_demo
在这里插入图片描述

Demo

使用TabController

使用时需要with TickerProviderStateMixin

List<Tab> tabs = <Tab>[
  Tab(text: 'tab1'),
  Tab(text: 'tab2'),
];

List<Widget> tabBarViews = <Widget>[
  Center(child: Text('tabPage1')),
  Center(child: Text('tabPage2')),
];
class TabSimple extends StatefulWidget {
  @override
  _TabSimpleState createState() => _TabSimpleState();
}

class _TabSimpleState extends State<TabSimple> with TickerProviderStateMixin {
  TabController _tabController;

  @

猜你喜欢

转载自blog.csdn.net/cry121212/article/details/114393507
Tab