Is there a way to send Lambda to Screen compose us...
# multiplatform
m
Is there a way to send Lambda to Screen compose using voyager... so that actions can be taken at platform level lets say I have an action to increase/decrease volume but on android side its implementain is different and for ios its different
p
You can declare an interface in commonMain and pass the implementation to your Voyager Screen.
Or inject it in the Screen ViewModel
👍 1
v
The voyager will crash on android at least on attempt to pack your passed interface into a bundle after you minimize your app
I generally see 2 ways of passing some outside objects/listeners into the compose app: • Common one - inject the objects into VMs • Compose way one - pass them into Local composition and access them anywhere down the tree
m
Implemented this with pre-compose It's very similar to compose navigation on Android... So it does the job for me... Thanks for the response
👍 1
I actually needed to pass lambda when I am creating a nav graph ... So yeah pre-compose navigation solves this for me
💯 1