What would be the best way for me to create spacing between the last item of a lazy list and a FAB in the scaffold encompassing the screen UI. I know that I can easily add an item trailing the list with a Spacer of height 64.dp (This is due to the 48.dp Extended FAB default minheight and a 16.dp spacer from the bottom of the fab to the bottom Nav bar), but I'm wondering if there is a better approach.
➕ 1
p
PHondogo
08/13/2021, 9:30 AM
There is contentPadding parameter in LazyColumn composable. It adds padding to list content not for all LazyColumn. Specify bottom = 64.dp for your case.
c
Chuck Stein
09/07/2021, 8:51 PM
@Anton Dmytryshyn how do you know the default FAB height and height of the spacing below the FAB in a Scaffold? Are these variables we can reference somewhere?
a
Anton Dmytryshyn
09/07/2021, 9:24 PM
@Chuck Stein If you go into the source code, (Ctrl Click on a method) you can see what the default size of a FAB is, and in the scaffold source code there is
Copy code
private val FabSpacing = 16.dp
c
Chuck Stein
09/07/2021, 10:52 PM
It's a shame that they hide all these properties from developers when clearly they are needed in pretty common cases. Without a public property, we are forced to hardcode our own based on the private one, and then have silent layout issues if they ever change the actual private value in the future