Lazy
is a bit of a special case:
// @Composable
LazyColumn {
// not @Composable
item {
// @Composable
Text(...)
}
}
The nice lambdas hide the types and obscure what’s going on a bit. Right inside
LazyColumn
is setting up a DSL for which items to (potentially) emit. So each
item
is defining a part of the lazy content, but since it’s lazy, it may not actually get executed.
So when you define an extension on
LazyGridScope
, you’re saying “here’s a portion of content to contribute to the DSL of items to show,” as opposed to saying “here’s content to directly place into the scope”
The latter case makes sense with a
ColumnScope
, since you are directly adding normal composables.