如何避免动画时底部溢出 - Flutter

how to avoid bottom overflowed while animation - Flutter

我有一个 AnimatedContainer,当我点击容器时该容器有一个 open/close 动画,但底部溢出 38 像素错误。

此视频中显示:

https://photos.google.com/share/AF1QipPsio8RS5BD0D1OzMbMA6sNCBamLF8nYEyml_-pPqKVe-tzza-PyvB3MQehdHKeNQ/photo/AF1QipPYOoZ6pOXARbd3SdpxY8OWegQxvFHtv2QNh7NQ?key=V0lhQnpPOWtCRm1RZ21yUnp6TkFZdmtKdWFuVk13

这是我的代码:

Column(
  children: <Widget> [
    GestureDetector(
      child: Container(
      duration: duration,
      child: all the content
    ),
    onTap: () {
      is_opened = !is_opened;  
    }
)
AniamtedOpacity(
  duration: duration,
  opacity: is_opened ? 1 : 0
      child: Container(
          child: Row(
            children: <Widget>[
              //Icons and texts
            ],
          ),
        ),
      ),
    ],
  )

感谢帮助

expanded 小部件包裹您的 AnimatedContainer 小部件,以便它可以展开并在点击时获取所需的 space。