Loney Chou
04/01/2023, 10:22 AMoffset
, onFocusChanged
, pointerInput
, where users need to write those logic over and over again.Zach Klippenstein (he/him) [MOD]
04/04/2023, 6:27 PMZach Klippenstein (he/him) [MOD]
04/04/2023, 6:28 PMLoney Chou
04/05/2023, 2:38 AMfun Modifier.themePadding(
size: ThemePaddingSize
): Modifier = composed {
val themePadding = LocalThemePadding.current
padding(themePadding[size])
}
enum class ThemePaddingSize { /* ... */ }
I would have to use padding
like the following if I want to get rid of `composed`:
modifier = Modifier.padding(LocalThemePadding.current[/* ... */])
where I have to add Local...
on each invocation.
I like the fact that DelegatingNode and CompositionLocalConsumerModifierNode is coming into view, but as you said, if the corresponding Modifier.Node type is not public, like padding
, there's nothing you can't do 😥