flutter-ListView

比你优秀的人比你还努力,感谢提醒和砥砺!

flutter列表组件

在这里插入图片描述

body: new ListView(
   children: [
     new ListTile(
       leading: new Icon(Icons.perm_contact_cal_rounded),
       title:new Text('heihei')
     ),new ListTile(
       leading: new Icon(Icons.perm_camera_mic),
       title:new Text('haha')
     ),new ListTile(
       leading: new Icon(Icons.perm_identity),
       title:new Text('xixi')
     ),
     new Image.network('https://img-blog.csdnimg.cn/dc76c5925c1e4bf9b37ed98575aee89d.png'),
     new Image.network('https://img-blog.csdnimg.cn/be49464b249d467d90bb80ac58e2c065.png'),
     new Image.network('https://img-blog.csdnimg.cn/dc76c5925c1e4bf9b37ed98575aee89d.png'),
     new Image.network('https://img-blog.csdnimg.cn/be49464b249d467d90bb80ac58e2c065.png'),
   ],
 ),

横向列表的使用

在这里插入图片描述

class MyList extends StatelessWidget{
  @override
  Widget build(BuildContext context){
    return ListView(
      scrollDirection: Axis.horizontal,
      children: [
        new Container(
          width: 300.0,
          height: 300.0,
          color:Colors.lightBlue,
        ),
        new Container(
          width: 100.0,
          height: 300.0,
          color:Colors.red,
        ),
        new Container(
          width: 100.0,
          height: 300.0,
          color:Colors.purpleAccent,
        ),
        new Container(
          height: 300.0,
          width: 100.0,
          color:Colors.lightBlue,
        ),
      ],
    );
  }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值