fix(ui): fix lazy load scroll view

This commit is contained in:
Salvatore Giordano
2022-07-04 15:33:15 +02:00
parent 4153f0d6cb
commit d2883c87f0
@@ -63,13 +63,13 @@ class _LazyLoadScrollViewState extends State<LazyLoadScrollView> {
if (notification is ScrollStartNotification) { if (notification is ScrollStartNotification) {
if (widget.onPageScrollStart != null) { if (widget.onPageScrollStart != null) {
widget.onPageScrollStart!(); widget.onPageScrollStart!();
return widget.allowNotificationBubbling; return !widget.allowNotificationBubbling;
} }
} }
if (notification is ScrollEndNotification) { if (notification is ScrollEndNotification) {
if (widget.onPageScrollEnd != null) { if (widget.onPageScrollEnd != null) {
widget.onPageScrollEnd!(); widget.onPageScrollEnd!();
return widget.allowNotificationBubbling; return !widget.allowNotificationBubbling;
} }
} }
if (notification is ScrollUpdateNotification) { if (notification is ScrollUpdateNotification) {
@@ -82,7 +82,7 @@ class _LazyLoadScrollViewState extends State<LazyLoadScrollView> {
pixels < (maxScrollExtent - scrollOffset)) { pixels < (maxScrollExtent - scrollOffset)) {
if (widget.onInBetweenOfPage != null) { if (widget.onInBetweenOfPage != null) {
widget.onInBetweenOfPage!(); widget.onInBetweenOfPage!();
return widget.allowNotificationBubbling; return !widget.allowNotificationBubbling;
} }
} }
@@ -94,12 +94,12 @@ class _LazyLoadScrollViewState extends State<LazyLoadScrollView> {
if (scrollingDown) { if (scrollingDown) {
if (extentAfter <= scrollOffset) { if (extentAfter <= scrollOffset) {
_onEndOfPage(); _onEndOfPage();
return widget.allowNotificationBubbling; return !widget.allowNotificationBubbling;
} }
} else { } else {
if (extentBefore <= scrollOffset) { if (extentBefore <= scrollOffset) {
_onStartOfPage(); _onStartOfPage();
return widget.allowNotificationBubbling; return !widget.allowNotificationBubbling;
} }
} }
} }
@@ -110,9 +110,9 @@ class _LazyLoadScrollViewState extends State<LazyLoadScrollView> {
if (notification.overscroll < 0) { if (notification.overscroll < 0) {
_onStartOfPage(); _onStartOfPage();
} }
return widget.allowNotificationBubbling; return !widget.allowNotificationBubbling;
} }
return widget.allowNotificationBubbling; return false;
} }
void _onEndOfPage() { void _onEndOfPage() {