https://kotlinlang.org logo
q

Quentin Dommerc

07/20/2020, 2:06 PM
Hey everyone! What seems to be the encouraged alternative between
Modifier.foo() + Modifier.bar()
and
Modifier.foo().bar()
?
f

Fudge

07/20/2020, 2:30 PM
the shorter one
2
a

Adam Powell

07/20/2020, 2:34 PM
The
+
is leftover from before the fluent builder-factory style. There's work in progress to replace it with
Modifier.then(other).bar()
cc @matvei 🙂
m

matvei

07/20/2020, 2:39 PM
Yeah, it's WIP, but later
plus & +
will be replaced by
then
like
Modifier.padding(...).background(...).then(myModifierFromClosure)
. It's easier to read, easy to chain and by typing
.
after the modifier you immediately go into the autocompete world where all the accessible modifiers are visible.
👍 2
q

Quentin Dommerc

07/20/2020, 2:42 PM
alright thanks 🙂