简体   繁体   English

Flutter 包装小部件问题 - 间距在容器小部件中不起作用

[英]Flutter Wrap widget problem - spacing not working in the container widget

My Flutter App is laggy right now so here's the drawing:我的 Flutter 应用程序现在很慢,所以这是绘图:

My current three container is like this: Current Container我当前的三个容器是这样的: Current Container

I wanted to spacing the containers like this: Desired Container我想像这样间隔容器: Desired Container

I tried to use Wrap like this in the body.我尝试在身体中使用这样的 Wrap。

body:Wrap(Spacing:32, ...

but it's not working.但它不工作。 any solution may help任何解决方案都可能有所帮助

Wrap(spacing: 32, ... should work, if it doesn't, something else might be incorrect. Although you could just use margin property in your Container , like this: Wrap(spacing: 32, ...应该有效,如果无效,则可能是其他问题不正确。尽管您可以在Container中使用margin属性,如下所示:

Container(
    margin: EdgeInsets.symmetric(vertical: 16, horizontal: 32),
    ....

This should create some blank space around each container.这应该在每个容器周围创建一些空白空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM