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
Alexandru Caraus
10/07/2024, 11:46 AM
Afaik nesting is not a big problem in compose.
k
Kavin
10/07/2024, 11:56 AM
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
dorche
10/07/2024, 4:20 PM
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
Kavin
10/07/2024, 4:38 PM
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
Stylianos Gakis
10/07/2024, 4:45 PM
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
dorche
10/07/2024, 5:00 PM
Yeah, always go with the simplest option (row and columns) and if that doesn't do enough then use a more complex component