If I have a `Scaffold` with a `TopAppBar` is the r...
# compose
e
If I have a
Scaffold
with a
TopAppBar
is the reason that I'm supposed to add the
consumeWindowInsets
Modifier on the scaffold content because
TopAppBar
is a sibling to it, and therefore doesn't consume the inset as far as the content is concerned?
a
Right, and the
paddingValues
are given to the main body of the
Scaffold
for you to handle directly, so the insets may not be consumed until you apply the
paddingValues
as padding to something.
e
Thanks! I saw a distinction in a few places throughout the documentation between applying the padding first vs consuming the insets first. Does "first" mean in the hierarchical sense, or in a modifier order sense? Is there any difference between
Modifier.padding(paddingValues).consumeWindowInsets(paddingValues)
and
Modifier.consumeWindowInsets(paddingValues).padding(paddingValues)
?
a
There shouldn’t be any noticeable difference between those two in particular. The case where it would matter would be something like
Modifier.consumeWindowInsets(paddingValues).windowInsetsPadding(WindowInsets.safeDrawing)
versus
Modifier.windowInsetsPadding(WindowInsets.safeDrawing).consumeWindowInsets(paddingValues)
since both modifiers are interacting with inset consumption. And “first” should be the same between the hierarchical sense and then modifier order sense