页面布局 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 ...
随机推荐
- pytest学习2-运行方式
pytest常用运行方式 运行目录及子包下的所有用例: pytest 目录名 运行指定模块所有用例: pytest test_reg.py pytest test_reg.py::TestClass: ...
- c#中的yield词法
yield关键字的作用是将当前集合中的元素立即返回,实例: 通过断点可以看到,控制台每显示一个集合中的元素,都会到query方法中去取集合元素. 其实yield return是“语法糖”,其本质是生成 ...
- js-时间相关的转换
毫秒值 -> 时间 var date = new Date(1477386005*1000);
- script放在body和放在head的区别
放在body中:在页面加载的时候被执行 放在head中:在被调用时被执行 原因: 1.浏览器是从上到下解析HTML的. 2.放在head里的js代码,会在body解析之前被解析:放在body里的js代 ...
- Vue中import '@...'的意思
转载: https://blog.csdn.net/xiazeqiang2018/article/details/81325996 写项目的时候看到很多导入都是@开头,这是webpack的路径别名,相 ...
- javascript fp demo
function eq (y) { return function forX(x) { return x === y } } function mod (y) { return function fo ...
- centos修改静态Ip地址
centos修改静态Ip地址 待办 昨天待办 https://blog.csdn.net/johnnycode/article/details/40624403 centos修改静态ip地址
- Python | 字符串拆分和拼接及常用操作
一.字符串拆分 str = "hola ha1 ha2 china ha3 " # partition 从左侧找到第一个目标,切割成三组数据的[元组] str1 = str.par ...
- Linux - Shell - find - 进阶: 时间与大小
概述 继续 find 这次的内容, 参数稍微要 复杂那么一丢丢 背景 刚学会了 基础 的参数 现在来了解一些 时间 和 空间 的参数 一说到操控时间空间, 感觉立马起来了... 准备 OS cento ...
- python调用sqlite
参考资料:https://www.liaoxuefeng.com/wiki/1016959663602400/1017801751919456 https://www.cnblogs.com/lia ...