Flutter Media查询机身尺寸

时间:2018-10-05 15:16:44

标签: flutter media-queries

我正在尝试在主体中创建3个部分,但我希望这3个部分始终覆盖整个屏幕。

<SystemName>mysystem</SystemName>
<Good>60</Good>
<Bad>10</Bad>
<MachineStatus>stop</MachineStatus>
<IpAddress>127.0.0.1</IpAddress>        
<Username>username</Username>       
<Password>password</Password> 

Result Screen

MediaQuery将整个屏幕作为参考,这就是为什么最后一节的溢出高度与应用栏相同。

是否可以使用主体作为MediaQuery的引用?

1 个答案:

答案 0 :(得分:1)

尝试对由Column包裹的子项使用Expanded,每个子项的大小相同。

  Column(
        children: <Widget>[
          Expanded(
            child: Container(color: Colors.white),
          ),
          Expanded(
            child: Container(color: Colors.red),
          ),
          Expanded(
            child: Container(color: Colors.green),
          ),
        ],
      );