2017-05-30 5 views
1

私は子ウィジェットとしてScaffoldを持つDefaultTabControllerを使用しています。 appBarでは、TabBarを使用しています。私はTabBarの周りにいくつかのパディングを追加したいと思いますが、appBarプロパティはPreferredSizeWidgetを継承するクラスを必要とします。私は建物だタブコントローラのDefaultTabControllerでAppBarをパディングする

例スニペット:足場クラスから

new DefaultTabController(
    length: tabs.length, 
    child: new Scaffold(
     backgroundColor: const Color(0xFFF3EEE1), 
     appBar: new TabBar(
     tabs: tabs, 
    ), 
     body: new TabBarView(
     children: _testPacks.map((TestPack testPack) { 
      return _contentWidget(context: context, testPack: testPack); 
     }).toList(), 
    ), 
    ), 
); 

/// An app bar to display at the top of the scaffold. 
final PreferredSizeWidget appBar; 

答えて

1

あなたTabBar年代PreferredSizeContainerをラップすることができます。

関連する問題