码迷,mamicode.com
首页 > 其他好文 > 详细

flutter控件之ListView滚动布局

时间:2018-12-17 14:25:50      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:ted   poster   creat   row   组成   world   glut   from   pos   

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

import package:flutter/material.dart;
class ListDemo 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(
             "Sweat",
             style: new TextStyle(
               fontFamily: "serif",
               fontSize: 26.0
             ),
           ),
         ),
         new Center(
           child: new Text(
             "huoyac honeybaby",
             style: new TextStyle(
               fontFamily: "serif",
               fontSize: 12.0
             ),
           ),
         ),
         new Center(
           child: new Text(
             ‘‘‘
From fairest creatures we desire increase,
That thereby beautys 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,
Feedst thy lights 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 worlds fresh ornament
And only herald to the gaudy spring,
Within thine own bud buriest thy content
And, tender churl, makst waste in niggarding.
Pity the world, or else this glutton be,
To eat the worlds due, by the grave and thee.
WHEN forty winters shall besiege thy brow
And dig deep trenches in thy beautys field,
Thy youths 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 beautys 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 feelst 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 mothers 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 remembred 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: "滚动布局",
    home: new ListDemo(),
  ));
}

效果:

 技术分享图片

flutter控件之ListView滚动布局

标签:ted   poster   creat   row   组成   world   glut   from   pos   

原文地址:https://www.cnblogs.com/zhujiabin/p/10130530.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!