[Flutter] Flexible the Widget height to available space

做~自己de王妃 提交于 2019-12-04 14:41:56

Let's say you set widget height to 200, but to different screen, there might not be enough space for the widget to display, in this case, you can use Flexible widget:

              Flexible(
                child: Hero(
                  tag: 'flash',
                  child: Container(
                    height: 200.0,
                    child: Image.asset('images/logo.png'),
                  ),
                ),
              ),

It will display enough space for Widget which it wraps. Save space for other Widgets.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!