Hi everyone! I would very much like to hear ideas ...
# compose
y
Hi everyone! I would very much like to hear ideas regarding he best practices of showing a snackbar when clicking a sub-composable. I have a pretty deep hierarchy of composables, and it feels weird to pass a ScaffoldStates all the way “down” to the required element, just to invoke a simple method…
a
Maybe pass a callback instead all the way up?
y
Yeah I do prefer this approach, but it’s still pretty much the same - I still need to pass the callback across the entire hierarchy…
d
Maybe pass a ViewModel all the way down (it is going to be useful for other state manipulations anyway). Then inside the viewmodel define a listener.