Skip to content

Instantly share code, notes, and snippets.

@ymkp
Created February 3, 2022 07:33
Show Gist options
  • Save ymkp/2f49ae882dc52c24c33be61103ce4b45 to your computer and use it in GitHub Desktop.
Save ymkp/2f49ae882dc52c24c33be61103ce4b45 to your computer and use it in GitHub Desktop.
NotificationListener<ScrollNotification>(
onNotification: (ScrollNotification scrollInfo) {
if (scrollInfo is ScrollEndNotification && // ? <-- dia dah di paling bawah, padding child juga dihitung
scrollInfo.metrics.extentAfter == 0 && // ? <-- bener2 mentok sampai ada splash-nya
_shopController.productState == ProductState.ok && //? <-- kondisi tambahan, cuma reload kalau lagi tidak loading
_shopController.pageQ != -1) { //? <-- kondisi tambahan, cuma reload kalau bukan halaman/paginasi terakhir
_shopController.getAllProductsNextPage(); //? <-- yang dilakukan untuk get next items
return true;
}
return false;
},
child: ListView.builder(
shrinkWrap: true,
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment