首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Flutter是否支持级联网格?

Flutter是否支持级联网格?
EN

Stack Overflow用户
提问于 2017-11-14 09:51:40
回答 2查看 223关注 0票数 0

Flutter是否支持层叠栅格样式布局,例如:

EN

回答 2

Stack Overflow用户

发布于 2017-11-14 15:28:26

您可以在一行中创建4个展开的容器,并在每个展开的容器中添加列:

下面是我运行的代码,给出了你想要的确切结果:

代码语言:javascript
运行
复制
new Row(
                children: <Widget>[
                    new Expanded(
                        child: new Column(
                            children: <Widget>[
                                new Container(
                                    height: 50.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                                new Container(
                                    height: 24.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                                new Container(
                                    height: 150.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                            ],
                        ),
                    ),
                    new Expanded(
                        child: new Column(
                            children: <Widget>[
                                new Container(
                                    height: 140.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                                new Container(
                                    height: 90.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                                new Container(
                                    height: 58.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                            ],
                        ),
                    ),
                    new Expanded(
                        child: new Column(
                            children: <Widget>[
                                new Container(
                                    height: 20.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                                new Container(
                                    height: 220.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                                new Container(
                                    height: 50.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                            ],
                        ),
                    ),
                    new Expanded(
                        child: new Column(
                            children: <Widget>[
                                new Container(
                                    height: 50.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                                new Container(
                                    height: 150.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                                new Container(
                                    height: 100.0,
                                    color: Colors.grey,
                                    margin: new EdgeInsets.all(10.0),
                                ),
                            ],
                        ),
                    ),
                ],
            )

它给出了以下结果:

票数 1
EN

Stack Overflow用户

发布于 2017-11-14 21:11:34

可以将CustomScrollViewSliderGrid与自定义gridDelegate一起使用

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47276409

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档