Mark
02/10/2023, 3:39 AMModifiercurioustechizen
02/10/2023, 4:17 AMMark
02/10/2023, 4:19 AMMark
02/10/2023, 4:38 AMbuilderActionModifiermattinger
02/10/2023, 5:34 AM@Composable
@Preview
fun SomeComposablePreview() {
    SomeComposable("foobar")
}
@Composable
fun SomeComposable(
    modifier: Modifier = Modifier,
    text: String,
) {
    
}mattinger
02/10/2023, 5:36 AMmattinger
02/10/2023, 5:41 AMMark
02/10/2023, 5:42 AMfun FooButton("foo") {
    doSomethingOnClick(...)
}mattinger
02/10/2023, 5:43 AMMark
02/10/2023, 5:43 AMmattinger
02/10/2023, 5:43 AMephemient
02/10/2023, 5:56 AMandroidx.compose.material.ButtononClick: () -> UnitMark
02/10/2023, 5:57 AMMark
02/10/2023, 5:58 AMephemient
02/10/2023, 6:01 AMLayout functions SHOULD place their primary or most commonyesfunction parameter in the last parameter position to permit the use of Kotlin's trailing lambda syntax for that parameter.@Composable
ephemient
02/10/2023, 6:05 AMandroidx.compose.ui.layout.Layoutcontent: @Composable () -> Unitcontents: List<@Composable () -> Unit>MeasurePolicyephemient
02/10/2023, 6:06 AMMark
02/10/2023, 6:08 AMephemient
02/10/2023, 6:10 AM@ComposableUnitephemient
02/10/2023, 6:11 AMephemient
02/10/2023, 6:12 AMMark
02/10/2023, 8:01 AM() -> UnitParameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param.Filip Wiesner
02/10/2023, 1:51 PMExcept that when people read compose code, they expect trailing lamba blocks of a composable function to be composable code. It's about conventions.That is the main argument for me. Doesn't matter if it's leaf composable or not. I expect UI elements with trailing lambda to be "composable". I don't want to check the documentation to know if it is or isn't composable and the annotation is not visible when typing parameters.
Mark
02/10/2023, 1:52 PMcompose-lintsFilip Wiesner
02/10/2023, 1:57 PM