Paging 3 là thư viện phân trang được khuyến nghị, load hiệu quả dataset lớn từ nguồn local/remote.
- Bạn tạo
PagingSource(hoặcRemoteMediatorcho network+database), dùngPagerđể tạo paginated stream, và collectPagingDatatrong UI vớicollectAsLazyPagingItems(). - Nó xử lý tự động loading, appending, retry, và deduplication, loại bỏ lỗi phân trang thủ công.
Paging 3 is the recommended pagination library that efficiently loads large datasets from local/remote sources.
- You create a
PagingSource(orRemoteMediatorfor network+database), usePagerto create paginated streams, and collectPagingDatain the UI withcollectAsLazyPagingItems(). - It handles loading, appending, retrying, and deduplication automatically.