flutter - 如何布置容器,我不知道 W&H

标签 flutter

Container怎么布局,不知道W&H

only know margin  left&right 15.0     top:20.0    bottom:30.0

Scaffold->Container->Column->**Container**

像这样:

enter image description here

谢谢

最佳答案

这应该做你想做的:

  body: Column(                                   
    children: [                                   
      Expanded(                                   
        child: Container(                         
          padding: EdgeInsets.only(               
            left: 15.0,                           
            right: 15.0,                          
            top: 20.0,                            
            bottom: 30.0,                         
          ),                                      
          child: Center(                          
            child: Text('child'),                 
          ),                                      
        ),                                        
      ),                                          
    ],                                            
  ),                                              

关于flutter - 如何布置容器,我不知道 W&H,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51440857/

相关文章:

flutter - 无法使用静态访问访问实例成员 'pickImage'

flutter - 如何在列表上方添加按钮?

gridview - Flutter 混合布局 - 带行的网格

dart - 如何在flutter中返回一个项目和项目列表

flutter - 如何在 Flutter 中滚动带有粘性标题的堆叠容器?

android - 如何在 flutter 中制作不透明的教程屏幕?

dart - 如何在 flutter 中提供路径 - 路径组合

dart - 如何使用 Positioned 小部件定位在堆栈的右上角

JSON 只解析为动态类型,而不是 Map

flutter - 出现错误 "The argument type ' JsObject' 无法分配给参数类型 'BuildContext' ”