dead.fish
05/09/2022, 11:55 AM.then()
would replace the configuration of earlier modifiers. Now I stand corrected that an application of the .padding(...)
modifier and an additional Modifier.padding(...)
applied via .then()
is actually additive. Is this really so or did I hit a weird bug here?
I looked into the implementation of padding and this just measures / places the contents, I guess the culprit might be somewhere in CombinedModifier
which I haven’t fully understood how it works (and if there is special code somewhere that folds “padding” modifiers by adding their values together).Filip Wiesner
05/09/2022, 12:00 PMalign
or size
dead.fish
05/09/2022, 12:02 PMFilip Wiesner
05/09/2022, 12:10 PMAdam Powell
05/09/2022, 2:05 PMPadding(16.dp) {
Padding(4.dp) {
Text("Hello, world!")
}
}
you would not expect one to outright replace the other, and the expectation of modifiers is the same. If this were not the case, composability (little-c) suffers as writing a reusable component or widget becomes far more complex; every modifier and how it might replace an inner implementation detail from the outside suddenly becomes a public api considerationdead.fish
05/09/2022, 2:19 PM