SingleWebPageController constructor
SingleWebPageController({})
Implementation
SingleWebPageController({
this.snaps = const [],
this.topSnapExtraOffset = 0,
this.centerSnapExtraOffset = 0,
this.bottomSnapExtraOffset = 0,
this.onAnimatedScrollStart,
this.onAnimatedScrollEnd,
this.onScrollEnd,
this.triggerSameIndexAnimationEffect = true,
}) {
addListener(() {
if (!_isAnimating) {
int visibleIndex = 0;
_sectionHeights.forEach((index, _) {
final snapOffset = _bottomSnapOffsets[index];
if (snapOffset == null) {
return;
}
if (position.pixels >= snapOffset) {
visibleIndex = index;
}
});
if (onScrollEnd != null) {
onScrollEnd!(visibleIndex);
}
}
});
}