[Flutter] Flexible the Widget height to available space

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.

posted @ 2019-11-16 02:21  Zhentiw  阅读(156)  评论(0编辑  收藏  举报