Is there any way to change the length of tabController?

875 views
Skip to first unread message

Simon Chen

unread,
Jun 20, 2018, 12:01:51 AM6/20/18
to Flutter Dev
Hi guys, I am a newbie to flutter and I want to implement a tabbar with 3 tabs initially, but with a feature to increment the count of tabs later. I've noticed the length prop of tabbarcontroller is final, so is there any tips to do this?

Adam Barth

unread,
Jun 21, 2018, 1:33:33 AM6/21/18
to simon...@gmail.com, Flutter Dev
What happens if you create a new TabController with a different length and rebuild the widgets use the TabController?  I would expect them to notice that the TabController has changed and start listening to the new one.

Adam


On Tue, Jun 19, 2018 at 9:01 PM Simon Chen <simon...@gmail.com> wrote:
Hi guys, I am a newbie to flutter and I want to implement a tabbar with 3 tabs initially, but with a feature to increment the count of tabs later. I've noticed the length prop of tabbarcontroller is final, so is there any tips to do this?

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages