KeyedTabController<K> constructor
KeyedTabController<K> ({
- required K? initialKey,
- required List<
K> keys, - Duration? animationDuration,
- required TickerProvider vsync,
Implementation
KeyedTabController({
required K? initialKey,
required List<K> keys,
Duration? animationDuration,
required TickerProvider vsync,
}) : _keys = keys,
_vsync = vsync,
_unanimated = null,
_indexedController = TabController(
initialIndex: initialKey == null
? 0
: max(keys.indexOf(initialKey), 0), // If not found: -1 -> 0.
animationDuration: animationDuration,
length: keys.length,
vsync: vsync,
) {
_proxyAnimation.parent = _indexedController.animation;
_indexedController.addListener(_onControllerChanged);
}