Hi, what is the best way to use dimensions from si...
# compose
s
Hi, what is the best way to use dimensions from single place in compose multiplatform like we used to do in android?
a
Why not to just store them in separate Kotlin file? Are there so many different dimens that they cannot be bundled with the app?
s
You mean making a static class and then define dp constants and use them
a
Something like that. You can even make it via expect/actual to automatically change dimens across platforms if needed
Or create a dimens interface and provide it to compose using CompositionLocalProvider. Probably the cleanest solution
s
Cool, i will try CompositionLocalProvider solution. How i didnt got this solution earlier🤔 even when i was doing the same thing for passing the screen width and height down the tree using the composition local. Thanx.