Sizing a container to exact half the screen size in flutter

后端 未结 5 1605
天命终不由人
天命终不由人 2021-02-18 23:51

I am trying to get a container to be exactly half the screen height[after considering the AppBar height] and half the screen width.

This is what I came up with...

<
5条回答
  •  迷失自我
    2021-02-19 00:10

    Or just simply...

    SizedBox(
              height: MediaQuery.of(context).size.height*0.5,
              child: ...,
            ),
    

提交回复
热议问题