Flutter教学

Flutter(67):Layout组件之ListBody

2020-10-24  本文已影响0人  starryxp

Flutter教学目录持续更新中

Github源代码持续更新中

1.ListBody介绍

一个widget,它沿着一个给定的轴,顺序排列它的子元素

2.ListBody属性

3.使用

      body: SingleChildScrollView(
        child: ListBody(
          mainAxis: Axis.vertical,
          reverse: false,
          children: [
            Container(
              height: 100,
              color: Colors.blue[50],
            ),
            Container(
              height: 100,
              color: Colors.blue[100],
            ),
            Container(
              height: 100,
              color: Colors.blue[200],
            ),
            Container(
              height: 100,
              color: Colors.blue[300],
            ),
            Container(
              height: 100,
              color: Colors.blue[400],
            ),
            Container(
              height: 100,
              color: Colors.blue[500],
            ),
            Container(
              height: 100,
              color: Colors.blue[600],
            ),
          ],
        ),
image.png

注意点:

最后这几个组件怎么使用看需求选择最适合的就行。
Flutter(5):基础组件之Row/Column
Flutter(33):Material组件之ListTile、RefreshIndicator、ListView、Divider

下一节:Layout组件之CustomMultiChildLayout

Flutter(68):Layout组件之CustomMultiChildLayout

Flutter教学目录持续更新中

Github源代码持续更新中

上一篇 下一篇

猜你喜欢

热点阅读