(12)、Study Flutter Container Widget组件学习补充

body: Container(
          ///设置容器中child对齐方式
          alignment: Alignment.bottomCenter,

          ///设置容器中child的padding值
          padding: EdgeInsets.all(20),

          ///设置容器背景颜色。如果foregroundDecoration设置的话,可能会遮盖color效果。与decoration属性中的color冲突。
          //color: Colors.amberAccent,

          ///绘制在child前面的装饰。
          foregroundDecoration: BoxDecoration(color: Color.fromARGB(20, 156, 212, 80)),

          ///指定容器的宽度
          width: 200,

          ///指定容器的高度
          height: 300,

          ///设置容器中child额外的约束条件,double.infinity:强制铺满屏幕
          constraints: BoxConstraints(minWidth: double.infinity),

          ///给容器设置装饰
          decoration: BoxDecoration(
              shape: BoxShape.rectangle, color: Colors.deepOrangeAccent),

          ///设置容器的边距
          margin: EdgeInsets.all(30),

          ///给容器设置变换矩阵()
          transform: Matrix4.rotationZ(0.1),

          ///给容器设置子widget
          child: Text(title),
        ),

关于Flutter Matrix4矩阵变换参考文章:https://www.jianshu.com/p/cc2f9a088fc9

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容