KeyedTabController<K>.fromUnanimated constructor
KeyedTabController<K>.fromUnanimated ({
- required UnanimatedKeyedTabController<
K> controller, - Duration? animationDuration,
- required TickerProvider vsync,
Creates the controller from the given UnanimatedKeyedTabController
controller
and links the two.
Implementation
KeyedTabController.fromUnanimated({
required UnanimatedKeyedTabController<K> controller,
Duration? animationDuration,
required TickerProvider vsync,
}) : _keys = controller.keys,
_vsync = vsync,
_unanimated = controller,
_indexedController = TabController(
initialIndex: controller.currentKey == null
? 0
: max(controller.keys.indexOf(controller.currentKey as K), 0),
animationDuration: animationDuration,
length: controller.keys.length,
vsync: vsync,
) {
_proxyAnimation.parent = _indexedController.animation;
_unanimated!.addListener(_onUnanimatedChanged);
_indexedController.addListener(_onControllerChanged);
}