Flutter基础—布局模型之滚动块

Flutter基础—布局模型之滚动块,第1张

概述ListView即滚动列表控件,能将子控件组成可滚动的列表。当你需要排列的子控件超出容器大小,就需要用到滚动块。 import 'package:flutter/material.dart';class LayoutDemo extends StatelessWidget { @override Widget build(BuildContext context) { return n

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

import 'package:Flutter/material.dart';class LayoutDemo extends StatelessWidget {  @overrIDe  Widget 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',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 ornamentAnd only herald to the gaudy spring,Within thine own bud burIEst thy contentAnd,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 browAnd 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 eyesWere an all-eating shame and thriftless praise.How much more prasIE deserved thy beauty's useIf thou Couldst answer,'This fair child of mineShall sum my count and make my old excuse,'Proving his beauty by succession thine.This were to be new made when thou art oldAnd see thy blood warm when thou feel'st cold.LOOK in thy glass,and tell the face thou vIEwestNow 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 wombdisdains the tillage of thy husbandry?Or who is he so fond will be the tombOf his self-love,to stop posterity?Thou art thy mother's glass,and she in theeCalls 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.             ''',FontSize: 14.0,]     ),);  }}voID main() {  runApp(    new MaterialApp(      Title: 'Flutter教程',home: new LayoutDemo(),);}

总结

以上是内存溢出为你收集整理的Flutter基础—布局模型之滚动块全部内容,希望文章能够帮你解决Flutter基础—布局模型之滚动块所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1002705.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-22
下一篇2022-05-22

发表评论

登录后才能评论

评论列表(0条)

    保存