摘要: 1、 import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; class Todo { final String title; final String description; Todo(t 阅读全文
posted @ 2020-03-17 16:57 lai1322 阅读(518) 评论(0) 推荐(0) 编辑
摘要: PushAndRemove Navigator.pushAndRemoveUtil,Navigator.pushNamedAndRemoveUntil() 本例中我们的跳转顺序是Screen1—>Screen2—>Screen3—>Screen4 当从Screen3跳转到Screen4的时候我们希望 阅读全文
posted @ 2020-03-17 15:29 lai1322 阅读(1273) 评论(0) 推荐(0) 编辑
摘要: 路由最基本的使用-页面跳转和退出 使用Navigator.push()来跳转页面 onPressed: () { Navigator.push( context, MaterialPageRoute(builder: (context) => SecondRoute()), ); } 使用Navig 阅读全文
posted @ 2020-03-17 11:38 lai1322 阅读(1891) 评论(0) 推荐(0) 编辑
摘要: 列布局,即垂直布局Widget,类似于安卓中android:orientation="vertical"的LinearLayout布局,属性和Row的基本一样,不同的是设置布局顺序时Row使用textDirection,而Column使用verticalDirection。 verticalDire 阅读全文
posted @ 2020-03-13 17:09 lai1322 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 行布局,即水平布局Widget,类似于安卓中android:orientation="horizontal"的LinearLayout布局,主要属性包括: mainAxisAlignment 主轴方向上的对齐方式,此处就是水平方向对齐方式。 crossAxisAlignment 垂直于主轴方向上的对 阅读全文
posted @ 2020-03-13 17:07 lai1322 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 指定大小的盒子布局,可指定width和height宽高两个属性,其特点是可通过设置width=double.infinity和height=double.infinity来使盒子充满父Widget宽高。 Widget getSizedBox() { return SizedBox( width: d 阅读全文
posted @ 2020-03-13 17:05 lai1322 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 指定子Widget的基线,包含两个主要属性: baseline 指定子Widget内容的基线位置,从外框也即是父控件的顶部位置开始定位基线位置。 baselineType 基线的类型,包括TextBaseline.ideographic和TextBaseline.alphabetic。 TextBa 阅读全文
posted @ 2020-03-13 17:04 lai1322 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 控制子Widget对齐方式的Widget,包含以下属性: alignment 表示子Widget的对齐方式,包括Alignment.topLeft、Alignment.topCenter、Alignment.topRight、Alignment.centerLeft、Alignment.center 阅读全文
posted @ 2020-03-13 17:02 lai1322 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 用于使子Widget居中的Widget。包含三个属性: widthFactor 宽度因子,表示为该Widget宽度比子Widget宽度的倍数。 heightFactor 高度因子,表示为该Widget高度比子Widget高度的倍数。 child 包含的子Widget。 Widget getCente 阅读全文
posted @ 2020-03-13 16:59 lai1322 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 表示内边距的Widget,可用于控制子Widget与外部Widget的边距。主要有两个属性: padding 用于边距大小设置。 child 包含的子Widget。 Widget getPadding() { return Padding( padding: EdgeInsets.all(40.0) 阅读全文
posted @ 2020-03-13 16:25 lai1322 阅读(103) 评论(0) 推荐(0) 编辑