Does anyone know why the new `BottomSheetState` re...
# compose
z
Does anyone know why the new
BottomSheetState
requires the developer supply a density? I’m just going to end up doing
LocalDensity.current
which seems like it would be fine as a default value internall.
🤔 1
s
Which BottomSheetState requires that? I haven’t seen any compose API require density like that before 👀
s
Right, so it probably asks because it’s not a composable function itself. So it couldn’t do
LocalDensity.current
as a default parameter since it can’t ready from composition locals by itself. And for the convenience function which does this for you which can be called from composition already you got this https://github.com/androidx/androidx/blob/3e16a32094211f297ee74f1bbcfaa498175061dc[…]monMain/kotlin/androidx/compose/material/BottomSheetScaffold.kt I think that’s the idea here
z
ahhh got it, it looks like we were using a BottomSheetScaffoldState and manually constructing a BottomSheetState (which isn’t even needed since it has a default and we weren’t using the bottom sheet state)
thanks!