useTabController function
TabController
useTabController({
- required int length,
- int initialIndex = 0,
- TickerProvider? vsync,
- Duration? animationDuration,
Creates a Tab controller
The controller will be automatically disposed when the component is unmounted
length Number of tabs (required)
initialIndex Initial selected tab index
Implementation
TabController useTabController({
required int length,
int initialIndex = 0,
TickerProvider? vsync,
Duration? animationDuration,
}) {
return useChangeNotifier(
() => TabController(
length: length,
initialIndex: initialIndex,
vsync: vsync ?? useSingleTickerProvider(),
animationDuration: animationDuration,
),
);
}