简体   繁体   English

如何在颤振中转换子小部件?

[英]How to transform child widgets in flutter?

I want animate widgets like the below gif我想要像下面的 gif 动画小部件gif

But whats happening is like the below gif但是发生的事情就像下面的gif

在此处输入图片说明

I just added a color to the container to get a sense of the frame of parent container我只是在容器中添加了一种颜色,以了解父容器的框架

How can we make the inner widgets to clip when moving out of parent widget?移出父小部件时,我们如何使内部小部件剪切?

I am using Transform to animate like projects.我正在使用 Transform 来制作类似项目的动画。

Please let me know if any more info is required.如果需要更多信息,请告诉我。

If you want your red container to clip overflow, you have to wrap it into a ClipRect .如果你想让你的红色容器剪辑溢出,你必须把它包装成一个ClipRect

new ClipRect(
   child: new Container(color: Colors.red, child: myAnimationThing),
),

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

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