zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

[Flutter] Flexible the Widget height to available space

flutter to The available space Widget height flexible
2023-09-14 09:00:48 时间

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.