Check MediaQuery
class
For example, to learn the size of the current media (e.g., the window containing your app), you can read the
MediaQueryData.size
property from theMediaQueryData
returned byMediaQuery.of
:MediaQuery.of(context).size
.
So you can do the following:
new Container(
height: MediaQuery.of(context).size.height/2,
.. )