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

前端之家收集整理的这篇文章主要介绍了Flutter基础—布局模型之滚动块前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

这里写图片描述

这里写图片描述

猜你在找的Flutter相关文章