Is there a recommended way when it comes to having...
# compose-android
k
Is there a recommended way when it comes to having a nested Scaffolds? I have an app with BottomBar and also TopAppBar for each screen. The MainActivity displays the BottomBar with scaffold. And each screen has its own scaffold with TopAppBar. Since my actions varies for each TopAppBar it is difficult to have a single toolbar and updates its state for each screen. Hence I prefer to use TopAppBar for each screen. But just wondering is there anything that I need to know using nested scaffolds!
a
Afaik nesting is not a big problem in compose.
k
Thank you. I did not see any problem as well. But there is no recommendations/samples in this approach. Also, this will help create scoping Snackbars and so on
d
Just make sure you consider if you actually need a Scaffold. If all it does can be achieved with a simple Column, use that instead.
k
This is exactly what I am trying to understand. Is there something that I’ll miss by not having the toolbar in the scaffold!? I don’t see much of it but still not sure about my unknowns here
s
I'd suggest you don't use scaffold at all, or just use them per-screen only. If you use it at both ends it can be tricky with the insets handling etc.
d
Yeah, always go with the simplest option (row and columns) and if that doesn't do enough then use a more complex component