How to Check If Scroll Position is Top or Bottom?
AsadAMalikDeveloper opened this issue · 4 comments
AsadAMalikDeveloper commented
How to Check If Scroll Position is Top or Bottom?
lkrjangid1 commented
Use GroupedItemScrollController
final GroupedItemScrollController itemScrollController =
GroupedItemScrollController();
itemPositionsListener.itemPositions.addListener(() {
if (itemPositionsListener.itemPositions.value.last.index ==
itemsPosition) {
//run your code
}});
RajeshPandey057 commented
From where we get item position ?
bhanubbs commented
I used Notification Listener (ScrollUpdateNotification)
bool scrollListner(ScrollUpdateNotification scrollEnd) {
if (scrollEnd.metrics.pixels > scrollEnd.metrics.maxScrollExtent ) {
reached top (if reverse is true)
} else if (scrollEnd.metrics.pixels <
scrollEnd.metrics.minScrollExtent) {
print('Reached bottom');
}
return true;
}
asadamatic commented