https://kotlinlang.org logo
#compose
Title
# compose
g

Guy Bieber

08/20/2020, 5:52 PM
Idea. It would be nice to have a lint check or a way to designate that compose function is expected to start with a row or column.
r

romainguy

08/20/2020, 5:53 PM
What do you mean?
g

Guy Bieber

08/20/2020, 5:56 PM
I have compose functions calling other compose functions. If the invoked function is inside a row and starts with a row, bad things happen.
Perhaps passing in what the parent nesting is would help.
a

Adam Powell

08/20/2020, 6:47 PM
You can declare your composable functions as extensions on the children scopes for those layouts, e.g.
Copy code
@Composable fun RowScope.MyFunction() {
👍 3
👆 1