Why when you pass modifier to a Button() and pass the same to inside element of the button like Column() the modifier was modified by the button and not be the same ? For Example :
The text was not just with fillMaxSize it has the padding the button add on modifier too.
c
czuckie
10/26/2022, 12:31 PM
I guess modifier instances are mutable; it definitely isn't typical to be passing one modifier instance into multiple composables though
czuckie
10/26/2022, 12:32 PM
though it should be said, even without a modifier, a button does introduce some padding to anything you place inside it
s
Stylianos Gakis
10/26/2022, 12:36 PM
What great timing to watch this video
https://youtu.be/BjGX2RftXsU?t=324▾
where Leland explains why each composable like that despite coming from the same val results in different instances of the Modifier. A perfect example with a modifier having a clickable and being applied to multiple composables doesn’t mean that the ripple will be synced across the two modifiers.
So no it’s not that the modifier is mutated, but maybe you’re experiencing the button adding paddings and such that you did not explicitly make yourself.