Hi everyone I have a question. Why do compose show...
# compose
t
Hi everyone I have a question. Why do compose show an error when I did not use Scaffold’s padding parameter? Why it is important?
s
Because your content may then draw behind the Scaffold making it not interactable or completely invisible with no way to scroll to see it.
t
Thank you guys I got it.
c
Do people typically just apply that padding to their router in this case? Or do you need to use the paddingValue to pass into a Lazy* which has a contentPadding param?
s
I think the passed paddings are not of transparent items, so it's not like you'll see what's behind it. With that said, if your container is one which takes contentPadding, it may be better to use that as it may interact better with scroll positions as those paddings may animate in and out? I'd test it though to see if it has any difference. The big difference is if the top bar or whatever else is transparent, then if you use the paddings as actual padding you may see no background behind if the container you use has a different color than whatever is behind, but if you use contentPadding it'd have the container occupy the space under the transparent items too, making it look normal again.
c
hm. yeah. i might need to play around with this a bit more. i mostly just surpress the error 🙈
s
Uhmm, that is definitely not a good idea 😅
d
Don’t forget that Scaffold is overkill if your layout is really just a Column. I don’t think I’ve seen an animated version of Scaffold with BottomBar + paddings that works really well when you navigate (with slide animation at the very least) and it needs to hide the bottom bar on that new page… (we ended up rolling a custom implementation that uses a Box instead of a Column…)