useTabController function

TabController useTabController({
  1. required int initialLength,
  2. TickerProvider? vsync,
  3. int initialIndex = 0,
  4. List<Object?>? keys,
})

Creates a TabController that will be disposed automatically.

See also:

Implementation

TabController useTabController({
  required int initialLength,
  TickerProvider? vsync,
  int initialIndex = 0,
  List<Object?>? keys,
}) {
  vsync ??= useSingleTickerProvider(keys: keys);

  return use(
    _TabControllerHook(
      vsync: vsync,
      length: initialLength,
      initialIndex: initialIndex,
      keys: keys,
    ),
  );
}