FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Cursor-Based Pagination with Infinite Scroll in Compose
NewsCareer

Cursor-Based Pagination with Infinite Scroll in Compose

via Dev.to TutorialmyougaTheAxo0mo ago

Cursor-Based Pagination with Infinite Scroll in Compose Cursor-based pagination is efficient for large datasets. Implement infinite scroll by loading more items as the user scrolls. Data Model data class PaginatedResponse < T >( val data : List < T >, val nextCursor : String ? = null , val hasMore : Boolean = false ) data class Post ( val id : String , val title : String , val content : String , val timestamp : Long ) Repository with Pagination class PostRepository ( private val api : PostApi ) { suspend fun getPosts ( cursor : String ? = null ): PaginatedResponse < Post > { return api . fetchPosts ( cursor = cursor ) } } ViewModel State Management class PostViewModel ( private val repository : PostRepository ) : ViewModel () { private val _posts = MutableStateFlow < List < Post >>( emptyList ()) val posts : StateFlow < List < Post >> = _posts . asStateFlow () private val _isLoading = MutableStateFlow ( false ) val isLoading : StateFlow < Boolean > = _isLoading . asStateFlow () private

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
20 views

Related Articles

News

Fully Local Code Embeds

Lobsters • 1d ago

What Happens to Crypto When No One Can Afford to Mine?
News

What Happens to Crypto When No One Can Afford to Mine?

Hackernoon • 1d ago

News

UVWATAUAVAWH, The Pushy String

Lobsters • 1d ago

15 Years of Forking (Waterfox)
News

15 Years of Forking (Waterfox)

Lobsters • 1d ago

Refactoring 008 - Variables That Never Change Should Be Constants
News

Refactoring 008 - Variables That Never Change Should Be Constants

Hackernoon • 1d ago

Discover More Articles