QuirijnGB / lazy-load-scrollview

A wrapper for a Flutter ScrollView which enables lazy loading
BSD 2-Clause "Simplified" License
108 stars 26 forks source link

Check for notification level depth #15

Open carmas123 opened 3 years ago

carmas123 commented 3 years ago

Hi please can you add a level depth check into _onNotifcation method. If you have a list with animated widget that scroll vertically this method is calle endlessly and also _loadMore.

The changes to do are these: At row 61 of lazy_load_scrollview.dart

if (widget.scrollDirection == notification.metrics.axis) {

should turn into

if (widget.scrollDirection == notification.metrics.axis && defaultScrollNotificationPredicate(notification)) {

This check if the scroll came from the real list scroll and not from a scrollable item into it.

Regards Massimo

QuirijnGB commented 3 years ago

Heya,

Thanks for that! Can you create a PR for it, so you can get credit