fluttercandies / extended_tabs

A powerful official extension library of Tab/TabBar/TabView, which support to scroll ancestor or child Tabs when current is overscroll, and set scroll direction and cache extent.
https://fluttercandies.github.io/extended_tabs/
MIT License
271 stars 49 forks source link

如何动态改变 TabController length #33

Open giantss opened 1 year ago

giantss commented 1 year ago

Platforms

dart

Description

我在初始化函数里面初始化代码如下:

 tabController = TabController(
      initialIndex: idx,
      length:  arr.length, // 初始长度是4
      vsync: this,
    );

目前有这个一个需求,需要动态改变增加 TabController length的初始长度。请教一下应该如何实现。

目前尝试在逻辑中再次调用上面的代码,这次长度是8,出现报错了。

image

My code

No response

Try do it

No response