import 'package:flutter/material.dart';

 class LayoutDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// aspectratio会自动填充父元素宽度,根据设定的宽高比自动扩充高度。
AspectRatio(
aspectRatio: /,
child: Container(
color: Colors.black87,
),
),
SizedBox(
height: ,
width: ,
child: Container(
child: Icon(Icons.poll, size: ),
alignment: Alignment.topRight,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(),
gradient: LinearGradient(
colors: [
Color.fromRGBO(, , , 0.9),
Color.fromRGBO(, , , 0.95),
],
),
boxShadow: [
BoxShadow(
color: Colors.black87,
offset: Offset(, ),
blurRadius: ,
spreadRadius: -
)
]
),
),
),
// 这里的sizedbox可当divider用
SizedBox(
height: ,
),
SizedBox(
height: ,
width: ,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color.fromRGBO(, , , ),
Color.fromRGBO(, , , ),
],
),
),
),
)
],
);
}
}

比较常用的就是Row()、Colmun(),具体的用法参考css的flexbox布局,比较相似。

flutter 布局简介的更多相关文章

  1. Flutter 布局(五)- LimitedBox、Offstage、OverflowBox、SizedBox详解

    本文主要介绍Flutter布局中的LimitedBox.Offstage.OverflowBox.SizedBox四种控件,详细介绍了其布局行为以及使用场景,并对源码进行了分析. 1. Limited ...

  2. Flutter 布局(三)- FittedBox、AspectRatio、ConstrainedBox详解

    本文主要介绍Flutter布局中的FittedBox.AspectRatio.ConstrainedBox,详细介绍了其布局行为以及使用场景,并对源码进行了分析. 1. FittedBox Scale ...

  3. Flutter 布局(四)- Baseline、FractionallySizedBox、IntrinsicHeight、IntrinsicWidth详解

    本文主要介绍Flutter布局中的Baseline.FractionallySizedBox.IntrinsicHeight.IntrinsicWidth四种控件,详细介绍了其布局行为以及使用场景,并 ...

  4. Flutter 布局(二)- Padding、Align、Center详解

    本文主要介绍Flutter布局中的Padding.Align以及Center控件,详细介绍了其布局行为以及使用场景,并对源码进行了分析. 1. Padding A widget that insets ...

  5. Flutter 布局详解

    本文主要介绍了Flutter布局相关的内容,对相关知识点进行了梳理,并从实际例子触发,进一步讲解该如何去进行布局. 1. 简介 在介绍Flutter布局之前,我们得先了解Flutter中的一些布局相关 ...

  6. Flutter 布局(十)- ListBody、ListView、CustomMultiChildLayout详解

    本文主要介绍Flutter布局中的ListBody.ListView.CustomMultiChildLayout控件,详细介绍了其布局行为以及使用场景,并对源码进行了分析. 1. ListBody ...

  7. Flutter 布局(七)- Row、Column详解

    本文主要介绍Flutter布局中的Row.Column控件,详细介绍了其布局行为以及使用场景,并对源码进行了分析. 1. Row A widget that displays its children ...

  8. Flutter 布局(八)- Stack、IndexedStack、GridView详解

    本文主要介绍Flutter布局中的Stack.IndexedStack.GridView控件,详细介绍了其布局行为以及使用场景,并对源码进行了分析. 1. Stack A widget that po ...

  9. Flutter 布局(九)- Flow、Table、Wrap详解

    本文主要介绍Flutter布局中的Flow.Table.Wrap控件,详细介绍了其布局行为以及使用场景,并对源码进行了分析. 1. Flow A widget that implements the ...

随机推荐

  1. 第四周学习总结&实验报告

    学习总结; String类: 1.方法只会开辟一块堆内存空间,且会自动保存在对象池中以供下次重复使用: 2方法会开辟两块堆内存空间,其中一块会成为垃圾空间. 1."=="比的是地址 ...

  2. 2018年5月6日GDCPC(广东赛区)总结

    大二第二次参加省赛了,这次成绩不是太理想. ———————————————————————————————— day1:试机 约好的12点钟在地铁站集合,好像就我一个人迟到了5分钟,被sen主席批判一 ...

  3. maven setting.xml文件配置详情

    1 首先,setting.xml一般存在与两个地方:maven的安装目录/conf/,和${user.home}/.m2/下.他们的区别是在maven安装目录下的setting.xml是所有用户都可以 ...

  4. Unity3D(C#)连接SQL Server2008

    首先部署安装sql server2008,添加Sql Manager. Unity3D连接需要在Unity2017\Editor\Data\Mono\lib\mono\unity文件下找到4个头文件l ...

  5. 大sd卡 裂开了,写保护掉了。重新装好后,被写保护的解决办:

    大sd卡 裂开了,写保护掉了.重新装好后,被写保护的解决办: 1.用烙铁把写保护附近的塑料往外顶一点点,就ok   别太热,也别劲太大.容易过,不能破坏原来的部分. 解决问题. 总结: 写保护,就是检 ...

  6. date picker with jquery

    <html> <input id="from_time" name="from_time"type="text" valu ...

  7. cocos2dx基础篇(16) 基本绘图DrawPrimitives

    [3.x] (1)去掉前缀 "cc" (2)将 ccDraw***() 封装到了 DrawPrimitives 命名空间中. (3)重写绘图函数:         draw(Ren ...

  8. 使用Dockerfile制作镜像

    组成部分 基础镜像信息       FROM 维护者信息    MAINTAINER.LABEL 镜像操作指令       RUN.COPY.ADD.EXPOSE.WORKDIR.ONBUILD.US ...

  9. 磁盘管理|df、du|分区 fdisk |格式化

    3.磁盘管理 3.1命令df ·用于查看已挂载磁盘的总容量,使用容量,剩余容量等. -i:查看inodes的使用情况 -h:使用合适的单位显示 -k:以KB为单位显示 -m:以MB为单位显示 3.1. ...

  10. kafka 安装教程

    安装详述: https://www.jianshu.com/p/596f107e901a 3.0:运行:cd 到: D:\Installed_software\Professional\kafka_2 ...