页面布局 Wrap 组件 和 RaisedButton按钮
**
Wrap({
Key key,
this.direction = Axis.horizontal,//主轴(mainAxis)的方向,默认为水平。
this.alignment = WrapAlignment.start,//主轴方向上的对齐方式,默认为start。
this.spacing = 0.0,//主轴方向上的间距。
this.runAlignment = WrapAlignment.start,//run的对齐方式。run可以理解为新的行或者列,如果是水平方向布局的话,run可以理解为新的一行。
this.runSpacing = 0.0,//run的间距。
this.crossAxisAlignment = WrapCrossAlignment.start,//交叉轴(crossAxis)方向上的对齐方式。
this.textDirection,//文本方向。
this.verticalDirection = VerticalDirection.down,//定义了children摆放顺序,默认是down,见Flex相关属性介绍。
List<Widget> children = const <Widget>[],//
})
*/
案例代码一
return Container(
child: Wrap(
children: <Widget>[
Container(margin: EdgeInsets.all(5), width: 100, height: 30, decoration: BoxDecoration(color: Colors.red),),
Container(margin: EdgeInsets.all(5), width: 100, height: 30, decoration: BoxDecoration(color: Colors.red),),
Container(margin: EdgeInsets.all(5), width: 100, height: 30, decoration: BoxDecoration(color: Colors.red),),
Container(margin: EdgeInsets.all(5), width: 100, height: 30, decoration: BoxDecoration(color: Colors.red),),
Container(margin: EdgeInsets.all(5), width: 100, height: 30, decoration: BoxDecoration(color: Colors.red),),
Container(margin: EdgeInsets.all(5), width: 100, height: 30, decoration: BoxDecoration(color: Colors.red),)
],
),
);
案例代码 二
class HomenCenter extends StatelessWidget {
Widget build(BuildContext context) {
// TODO: implement build
return Wrap(
spacing: 5,
children: <Widget>[
MyButton('按钮1'),
MyButton('按钮1'),
MyButton('按钮1'),
MyButton('按钮1'),
MyButton('按钮1'),
MyButton('按钮1'),
MyButton('按钮1'),
],
);
}
}
class MyButton extends StatelessWidget {
final text;
MyButton(this.text);
@override
Widget build(BuildContext context) {
// TODO: implement build
return RaisedButton (
child: Text(this.text),
color: Colors.red,
textColor: Colors.white,
onPressed: () {},
);
}
}
页面布局 Wrap 组件 和 RaisedButton按钮的更多相关文章
- 13Flutter页面布局 Wrap组件
/* Flutter页面布局Wrap组件: Wrap可以实现流布局,单行的Wrap跟Row表现几乎一致,单列的Wrap则跟Row表现几乎一致. 但Row与Column都是单行单列的.Wrap则突破了这 ...
- 常用到的html页面布局和组件: 自己用
1. 用div当作圆 <div style="border: 1px solid blue;height: 100px; width: 100px; border-radius: 20 ...
- 【Flutter学习】页面布局之基础布局组件
一,概述 Flutter中拥有30多种预定义的布局widget,常用的有Container.Padding.Center.Flex.Row.Colum.ListView.GridView.按照< ...
- Flutter——Wrap组件(流式布局)
Wrap 可以实现流布局,单行的 Wrap 跟 Row 表现几乎一致,单列的 Wrap 则跟 Row 表现几乎一致.但 Row 与 Column 都是单行单列的,Wrap 则突破了这个限制,mainA ...
- 046——VUE中组件之使用动态组件灵活设置页面布局
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 11Flutter页面布局 Stack层叠组件 Stack与Align Stack与Positioned实现定位布局
/* Flutter 页面布局 Stack层叠组件: Stack与Align Stack与Positioned实现定位布局: Flutter Stack组件: Stack表示堆得意思,我们可以用Sta ...
- 10Flutter页面布局 Padding Row Column Expanded组件详解:
Padding组件: main.dart import 'package:flutter/material.dart'; import 'res/listData.dart'; /* flutter页 ...
- 《React后台管理系统实战 :二》antd左导航:cmd批量创建子/目录、用antd进行页面布局、分离左导航为单独组件、子路由、动态写左导航、css样式相对陷阱
一.admin页面布局及路由创建 0)cmd批量创建目录及子目录 //创建各个目录,及charts和子目录bar md home category product role user charts\b ...
- Flutter 布局类组件:流式布局(Wrap和Flow)
前言 把超出屏幕显示范围会自动折行的布局称为流式布局.Flutter中通过Wrap和Flow来支持流式布局,将Row换成Wrap后溢出部分则会自动折行. Wrap 接口描述 Wrap({ Key ke ...
随机推荐
- docker-machine之升级linux内核
虚拟机版本及内核信息 uname -a 或者 uname -r 开始升级内核 1.更新yum源 yum -y update 2,获取内核信息 rpm --import https://www.elre ...
- input设置为disabled,表单无法提交后台解决方法
<input name="country" id="country" size=12 value="disabled提交时得不到该值 " ...
- C语言注释符号
同学们认为注释很简单,那我来看看下面的代码是否正确? 1.似是而非的问题 int main() { int/*...*/i; char* s = "abcdefgh //hijklmn&qu ...
- Oracle查询当前用户和当前用户下的所有表
转载自:http://blog.itpub.net/29485627/viewspace-1246317/ Oracle查询当前用户和当前用户下的所有表 (1)查询当前用户 SQL> show ...
- jQuery的主要使用方法
一.在html中添加jquery,可以使用cdn加载jquery 1.网址:https://www.bootcdn.cn/jquery/ 2.推荐使用3.4左右版本的,建议使用min.js后缀的,mi ...
- centOS7中启动MySQL数据库提示: Failed to start mysqld.service: Unit not foundc
现象: 在centOS7中启动MySQL数据库提示: Failed to start mysqld.service: Unit not found [明明已经安装了,为什么提示不存在呢?] 原因: 在 ...
- 【Unity|C#】基础篇(0)——C#与.NET框架
[学习资料] <C#图解教程>(第1章):https://www.cnblogs.com/moonache/p/7687551.html 电子书下载:https://pan.baidu.c ...
- 安装Docker:解决container-selinux >= 2.9问题
1.安装Docker要求Centos内核版本高于3.10:通过uname -r查看当前系统的内核版本 uname -r 2.使用root登陆系统,确保yum包保持更新到最新: sudo yum ...
- 13.56Mhz下50欧姆阻抗匹配简易教程
阻抗匹配(impedance matching) 主要用于传输线上,以此来达到所有高频的微波信号均能传递至负载点的目的,而且几乎不会有信号反射回来源点,从而提升能源效益.信号源内阻与所接传输线的特性阻 ...
- CefApp和CefClient的作用
CefApp 在cefsimple中,提到了一个cefapp的类型,这个类型是一个接口类,主要目的是提供获取三种handler的接口 /// // Implement this interface t ...