ListView即滚动列表控件,能将子控件组成可滚动的列表。当你需要排列的子控件超出容器大小,就需要用到滚动块。

import 'package:flutter/material.dart';
class LayoutDemo extends StatelessWidget {@overrideWidget build(BuildContext context) {
    return new Scaffold(appBar: new AppBar(title: new Text('滚动布局'),),body:new ListView(children: <Widget>[new Center(child: new Text('\nSonnet',style: new TextStyle(fontFamily: 'serif',fontSize: 26.0,),),),new Center(child: new Text('William Shakespeare\n\n',style: new TextStyle(fontFamily: 'serif',fontSize: 12.0,),),),new Center(child: new Text('''
From fairest creatures we desire increase,
That thereby beauty's rose might never die,
But as the riper should by time decease,
His tender heir might bear his memory;
But thou, contracted to thine own bright eyes,
Feed'st thy light's flame with self-substantial fuel,
Making a famine where abundance lies,
Thyself thy foe, to thy sweet self too cruel.
Thout that are now the world's fresh ornament
And only herald to the gaudy spring,
Within thine own bud buriest thy content
And, tender churl, mak'st waste in niggarding.
Pity the world, or else this glutton be,
To eat the world's due, by the grave and thee.
WHEN forty winters shall besiege thy brow
And dig deep trenches in thy beauty's field,
Thy youth's proud livery, so gazed on now,
Will be a tottered weed of small worth held:
Then being asked where all thy beauty lies,
Where all the treasure of thy lusty days,
To say within thine own deep-sunken eyes
Were an all-eating shame and thriftless praise.
How much more prasie deserved thy beauty's use
If thou couldst answer, 'This fair child of mine
Shall sum my count and make my old excuse,'
Proving his beauty by succession thine.
This were to be new made when thou art old
And see thy blood warm when thou feel'st cold.
LOOK in thy glass, and tell the face thou viewest
Now is the time that face should form another,
Whose fresh repair if now thou renewest,
Thou dost beguile the world, unbless some mother.
For where is she so fair whose uneared womb
Disdains the tillage of thy husbandry?
Or who is he so fond will be the tomb
Of his self-love, to stop posterity?
Thou art thy mother's glass, and she in thee
Calls back the lovely April of her prime;
So thou through windows of thine age shalt see,
Despite of wrinkles, this thy golden time.
But if thou live rememb'red not to be,
Die single, and thine image dies with thee.''',style: new TextStyle(fontFamily: 'serif',fontSize: 14.0,),),),]),);}
}
void main() {runApp(new MaterialApp(title: 'Flutter教程',home: new LayoutDemo(),),);
}

Flutter基础—布局模型之滚动块相关推荐

  1. Flutter基础—布局模型之层叠定位

    Stack即层叠布局控件,能够将子控件层叠排列. Stack控件的每一个子控件都是定位或不定位,定位的子控件是被Positioned控件包裹的.Stack控件本身包含所有不定位的子控件,其根据alig ...

  2. Flutter基础—布局模型之水平垂直

    水平布局 Row控件即水平布局控件,能够将子控件水平排列. Row子控件有灵活与不灵活的两种,Row首先列出不灵活的子控件,减去它们的总宽度,计算还有多少可用的空间.然后Row按照Flexible.f ...

  3. Flutter基础布局组件及实现

    https://www.cnblogs.com/lxlx1798/p/11084904.html 一,概述 Flutter中拥有30多种预定义的布局widget,常用的有Container.Paddi ...

  4. Flutter 基础布局Widgets之Baseline、AspectRatio详解

    Baseline概述 Baseline即根据child的baseline定位child的小部件,即使得不同的child都处在规定的基线位置,尤其是多用在文字排版中,比如使得不同大小的文字处于同一水平线 ...

  5. Flutter 基础布局之Row

    Row意为水平布局,可以使其包含的子控件按照水平方向排列 代码如下: class _TestState extends State<Test> {@overrideWidget build ...

  6. Flutter 基础布局Widgets之Expanded详解

    Expanded概述 Expanded是用于展开Row,Column或Flex的子child的Widget. 使用Expanded可以使[Row],[Column]或[Flex]的子项扩展以填充主轴中 ...

  7. Flutter 基础布局之Column

    Column意为垂直布局,可以使其包含的子控件按照垂直方向排列 代码如下: class _TestState extends State<DemoPage2> {@overrideWidg ...

  8. flutter基础布局之 Drawer

    Drawer 一般放在标题栏上,通过ListView和ListTile的配合,用于显示隐藏的标题. Scaffold(appBar: AppBar(title: const Text('Drawer ...

  9. web前端——html基础笔记 NO.12{css布局模型(流动,浮动,层模型)}

    css布局模型 清楚了CSS 盒模型的基本概念. 盒模型类型, 我们就可以深入探讨网页布局的基本模型了.布局模型与盒模型一样都是 CSS 最基本. 最核心的概念. 但布局模型是建立在盒模型基础之上,又 ...

最新文章

  1. 学python比较好的书-学习Python比较好的书籍推荐
  2. 百度危矣:乱评程苓峰《360的章鱼手要抢谁家饭碗?》
  3. Oracle Buffer-cache (数据高速缓存)作用概述
  4. jzoj4743-积木【状压dp】
  5. Qt 设置textEdit插入文本的字体、大小和颜色
  6. Trie 树是什么样的数据结构?有哪些应用场景?
  7. C#操作Cookie
  8. MyBatis复习(五):获取多表关联查询结果
  9. FFmpeg(六) 播放视频之GLSurfaceView显示RGB数据
  10. HDLBITS 练习 卡诺图化简部分
  11. ai人工智能让女神_人工智能可能只会让你兴奋不已
  12. python中将字符变为大写_python3.4.3将汉字转换为大写拼音首字母
  13. 沙雕动画资源素材大全/小白零基础快速入门沙雕动画/三天快速上手开始制作沙雕动画/
  14. C#的get和set用法
  15. php编程基础与实例教程第二版课后,PHP编程基础与实例教程(第2版)
  16. java hl7v3_HL7标准V3开发框架中个模型的关系
  17. 第二人生的源码分析(八十四)保存UI的界面布局
  18. matlab plotyy 坐标轴设置,[转载]Matlab plotyy画双纵坐标图实例
  19. 计算机桌面出现临时文件,如何删除电脑中的临时文件 电脑屏幕一键放大方法分享...
  20. win7 无法给系统保留的100M空间分配盘符时,用下面的方法就好

热门文章

  1. 洛谷 | P1605 迷宫(DFS) C++
  2. keras中的模型保存和加载
  3. hihocoder216周:贪心或二分
  4. 红皮书--SQL语句
  5. 优先级队列——实现二维数组排序
  6. CentOS 5.5 安装配置全攻略 (无线上网 更新源 显卡驱动 firefox3.6 flash插件 编译boost1.43.0 雅黑字体...
  7. Django之--POST方法处理表单请求
  8. 【洛谷】P1052 过河(状压dp)
  9. 重温WCF之数据契约和序列化(四)
  10. 好消息,MaxtoCode 1.10 已经封包,待2005.5.5日发布(如果有Bug将在1.20改正)