栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Flutter中的水平列表列表

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Flutter中的水平列表列表

我想您想要的是另一个列表中的列表。这是您遵循的示例程序的改编。build方法如下:

 Widget build(BuildContext context) {    Widget horizontalList1 = new Container(      margin: EdgeInsets.symmetric(vertical: 20.0),      height: 200.0,      child: new ListView(      scrollDirection: Axis.horizontal,      children: <Widget>[        Container(width: 160.0, color: Colors.red,),        Container(width: 160.0, color: Colors.orange,),        Container(width: 160.0, color: Colors.pink,),        Container(width: 160.0, color: Colors.yellow,),      ],    )    );    Widget horizontalList2 = new Container(        margin: EdgeInsets.symmetric(vertical: 20.0),        height: 200.0,        child: new ListView(      scrollDirection: Axis.horizontal,      children: <Widget>[        Container(width: 160.0, color: Colors.blue,),        Container(width: 160.0, color: Colors.green,),        Container(width: 160.0, color: Colors.cyan,),        Container(width: 160.0, color: Colors.black,),      ],    )    );    return new Scaffold(      appBar: new AppBar(        title: new Text(widget.title),      ),      body: new Center(        child: new Container(          child: ListView( scrollDirection: Axis.vertical, children: <Widget>[   horizontalList1,   horizontalList2, ],          ),        ),      ), // This trailing comma makes auto-formatting nicer for build methods.    );

结果是这样的:

希望能帮助到你



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/372602.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号