hello please what's the equivalent of this compose...
# compose
t
hello please what's the equivalent of this compose desktop code in mobile:
LocalAppWindow.current.height
j
What is your use case? If you are building responsive layouts, it's generally a better practice to use
BoxWithConstraints
which gives you information about the amount of space available for a particular widget (which could be used near the root for whole page layout decisions or at the leaves for when widgets are a little more squished/comfortable). You can then use the constraint (size) information to make all sorts of decisions from which layouts to choose, to which widgets/data to render, to how much padding should be on an object. It gives you a lot of flexibility, allows you to think in a more modular way, and not depend on platform specific APIs.
t
hmm the use case for this is getting the height of screen automatically
z
How about ``LocalConfiguration.current.screenHeightDp`
t
thanks @zoha131 it works👍
@jim thanks for the explanation, would definitely go that way to make it responsive when i'm working with an implementation like that