attach method
Register the given position with this controller.
After this function returns, the animateTo and jumpTo methods on this controller will manipulate the given position.
Implementation
@override
void attach(ScrollPosition position) {
super.attach(position);
if (position is! _CarouselPosition || _carouselState == null) {
return;
}
position
..flexWeights = _carouselState!._flexWeights
..restingExtents = _carouselState!.widget.restingExtents
..itemExtent = _carouselState!._itemExtent
..consumeMaxWeight = _carouselState!._consumeMaxWeight
..infinite = _carouselState!.widget.infinite
..itemCount = _getItemCount();
}