I sometimes get warning of putting `modifier` as first optional argument. May I know why? I've som...
k
I sometimes get warning of putting
modifier
as first optional argument. May I know why? I've some Custom Composables like
HeaderText
which used to have first parameter the text itself so I didn't need to write parameter names explicitly, but putting modifier as first parameter makes me lose this power.
a
First optional as in, you can still have the (required) text of a
HeaderText
come first. The intent of the guideline is that you can always supply a modifier to a compose UI function without using named parameters, it always comes right after the last required parameter.
k
Okay, so if my Composable has all optional parameters, modifier should be first among them?
a
Yes