zoukankan      html  css  js  c++  java
  • Container

    Container是最常用的布局Widget,表示一个容器,其主要属性包括:

    • width

        表示容器的宽度。

    • Height

        表示容器的高度。

    • alignment

        容器中内容的对齐方式,包括:Alignment.topLeft、Alignment.topCenter、Alignment.topRight、Alignment.centerLeft、Alignment.center、Alignment.centerRight、Alignment.bottomLeft、Alignment.bottomCenter、Alignment.bottomRight等。

    • color

        容器的背景颜色。

    • padding

        容器中内边距。

    • decoration

        容器背景装饰,不能和color同时设置,设置此值时可以根据需要将容器设置为圆角矩形、特定边框宽度和颜色等。

    • foregroundDecoration

        容器内容的前景装饰,和背景装饰属性类似,通常可以通过此属性设置内容的半透明图层。

    • margin

        容器的外边距

    • child

        容器中的子Widget,只能设置一个子Widget。

    Widget getContainer() {
        return Container(
           200.0,
          height: 200.0,
    //      color: Colors.blueAccent,
          alignment: Alignment.center,
          padding: EdgeInsets.all(15.0),
          decoration: BoxDecoration(
            color: Colors.redAccent,
            border: Border.all(color: Colors.blueAccent,  2.0, style: BorderStyle.solid),
            borderRadius: BorderRadius.circular(15.0),
          ),
          foregroundDecoration: BoxDecoration(
            color: Color(0x66000000),
            borderRadius: BorderRadius.circular(15.0),
          ),
          child: Text('Hello'),
          margin: EdgeInsets.all(20.0),
        );
      }
  • 相关阅读:
    Lilo的实现
    通过Bochs分析Lilo启动Linux内核的过程
    Linux内核代码布局
    Linux启动过程的内核代码分析
    Linux启动过程的C语言代码分析
    Linux操作系统中对于NTFS读取目录功能的实现
    Linux初始化的汇编代码
    Linux文件映射的反思
    Xen的概况
    安装debian总结以及编译linux内核
  • 原文地址:https://www.cnblogs.com/timba1322/p/12487271.html
Copyright © 2011-2022 走看看