Hi Guys, I have a Lazycolumn inside a Box and a S...
# compose-android
r
Hi Guys, I have a Lazycolumn inside a Box and a Scaffold, with pagination. Whenever I need to load more data, I need to call this
Copy code
LaunchedEffect(endReached) {
    if (endReached && endCursor != null) {
        onEvent(ContentListEvent.LoadMore)
    }
}
the end reached is just this
Copy code
val endReached by remember {
    derivedStateOf {
        !listState.canScrollForward
    }
}
But when no item is left (the end cursor is null, and the onEvent function is not triggered), the last item of the lazy column is not fully visible. If I remove the Launched Effect block, it will work. Does anyone have any idea why?
p
Not sure why that would happen. You might want to consider the paging library, it's fairly straight forward to implement cursor based pagination with it and it doesn't exhibit that issue
r
which paging library?
p
Android specific (technically it is packaged as multiplatform but it's only fully functional on Android): https://developer.android.com/topic/libraries/architecture/paging/v3-overview Multiplatform: https://github.com/cashapp/multiplatform-paging
r
thanks