kaina404 / FlutterDouBan

🔥🔥🔥Flutter豆瓣客户端,Awesome Flutter Project,全网最100%还原豆瓣客户端。首页、书影音、小组、市集及个人中心,一个不拉。( https://img.xuvip.top/douyademo.mp4)
8.77k stars 1.83k forks source link

home_app_bar.dart 不支持TabController #61

Closed xiaobaogeit closed 4 years ago

kaina404 commented 4 years ago

@xiaobaogeit 能具体一点么?

xiaobaogeit commented 4 years ago

@kaina404 比如lib/pages/home/home_page.dart

 bottomTextString: _tabs,
 bottom: TabBar(
        // These are the widgets to put in each tab in the tab bar.
        tabs: _tabs.map((String name) => Container(
                      child: Text(
                         name,
                      ),
                     padding: const EdgeInsets.only(bottom: 5.0),
                )) .toList(),
         ),

再TabBar中加入tabController:tabController 从而通过tabController来进行控制,但是传进去是没有效果的,看了下源码的确几乎是没有用传过去的bottom

 bottomTextString: _tabs,
 bottom: TabBar(
        tabController:tabController,
        tabs: _tabs.map((String name) => Container(
                      child: Text(
                         name,
                      ),
                     padding: const EdgeInsets.only(bottom: 5.0),
                )) .toList(),
         ),