Tgo1014
10/21/2024, 1:43 PMmodifier
and then the local modifiers or local modifiers first and then .then(modifier)
?Stylianos Gakis
10/21/2024, 1:44 PMmodifier
first in the chainStylianos Gakis
10/21/2024, 1:45 PMTgo1014
10/21/2024, 1:47 PMthen
?Stylianos Gakis
10/21/2024, 1:47 PM.moreModifiersInTheChain()
.then(
if (someCondition) {
Modifier.clickable()
} else {
Modifier
}
)
.moreModifiersInTheChain()
is a good exampleStylianos Gakis
10/21/2024, 1:49 PMapply
, you are not actually returning the modifier you just edited, apply
returns the receiver just as it was before the block inside did anything.
It's the same as doing
val x = 5.apply {
this + 1
}
println(x) // <-- prints (5)
Tgo1014
10/21/2024, 1:50 PM