fun List(modifier: Modifier = Modifier, content: @Composable () -> Unit)Overview
Put rows inside the content lambda, or group them with Section. For long data, use LazyForEach: each row is composed only while it is on screen.
List {
LazyForEach(messages, key = { it.id }) { message ->
Text(message.subject)
}
}This is the Kotlin form of SwiftUI List.init(content:): SwiftUI documentation. In Swift it reads:
nonisolated init(@ContentBuilder content: () -> Content)Topics
Creating a List
fun List(selection: Any, modifier: Modifier = Modifier, onSelectionChange: (Any) -> Unit, content: @Composable () -> Unit)
fun List(modifier: Modifier = Modifier, content: @Composable () -> Unit)