Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save saqib-github-commits/a852e0bf6197fc2400071e945671fa6e to your computer and use it in GitHub Desktop.
Save saqib-github-commits/a852e0bf6197fc2400071e945671fa6e to your computer and use it in GitHub Desktop.
// Button to Go To Bottom of the list
Button(onClick = {
coroutineScope.launch { lazyListState.animateScrollToItem(messages.size - 1) }
}) {
Text(text = "Go To Bottom")
}
// Button to Go To Top of the list
Button(onClick = {
coroutineScope.launch { lazyListState.animateScrollToItem(0) }
}) {
Text(text = "Go To Top")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment