简体   繁体   English

转换后,Hero 小部件是否重建其子部件

[英]Does a Hero widget rebuild its child after transition

The flutter docs do not mention whether the Hero widget rebuild its child after the widget is placed onto the destination screen from the overlay. flutter 文档没有提到在将小部件从叠加层放置到目标屏幕后, Hero小部件是否重建其子部件。

Also is the state retained?还保留状态吗?

Hero animations work with having two separate widgets wrapped in hero widgets having a same tag.英雄动画使用两个单独的小部件包裹在具有相同标签的英雄小部件中。 Tag helps to identify the widgets to be animated but they are two separate widgets and hence created separately.标签有助于识别要动画的小部件,但它们是两个独立的小部件,因此是分开创建的。

So, yes destination widget is created separately during the animation process and so the state is not retained.因此,是的,目标小部件是在动画过程中单独创建的,因此不会保留状态。

I hope it clarifies it.我希望它澄清它。

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

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