📜  Flutter中如何获取移动端显示的显示尺寸 - Dart代码示例

📅  最后修改于: 2022-03-11 14:48:03.727000             🧑  作者: Mango

代码示例1
getHeightWidth(context){
 
    double width = MediaQuery.of(context).size.width;
 
    double height = MediaQuery.of(context).size.height;
 
    setState(() {
     heightHolder = height.roundToDouble();
     widthHolder = width.roundToDouble() ; 
    });
 
  }