简体   繁体   English

Hero Widget 在自定义页面路由的情况下不起作用

[英]Hero Widget does not work in case of a custom page route

I have created a custom Page Route to act as a bottom dialog inspired by the IOS action sheet popup, I have the Page route working perfectly, now what i want is a hero Transition between the my first route and the next Popup route.我创建了一个自定义页面路由来充当受 IOS 操作表弹出窗口启发的底部对话框,我让页面路由完美运行,现在我想要的是我的第一个路由和下一个弹出路由之间的英雄过渡。

I have created a dartPad demonstartion showing the problem => https://dartpad.dev/e79bd9adf6845857e0829ec6fe5a4a55我创建了一个显示问题的 dartPad Demonstartion => https://dartpad.dev/e79bd9adf6845857e0829ec6fe5a4a55

Let me know if there is anything else that you need from my end.让我知道您是否还需要从我这里得到的任何信息。

Thanks in advance.提前致谢。

From https://flutter.dev/docs/development/ui/animations/hero-animations来自https://flutter.dev/docs/development/ui/animations/hero-animations
Use PopupRoutes is not support right now目前不支持使用PopupRoutes

Heroes fly from one PageRoute to another.英雄从一个PageRoute飞到另一个PageRoute Dialogs (displayed with showDialog(), for example), use PopupRoutes , which are not PageRoutes .对话框(例如用 showDialog() 显示)使用PopupRoutes ,而不是PageRoutes At least for now, you can't animate a hero to a Dialog.至少就目前而言,您无法为 Dialog 设置英雄动画。 For further developments (and a possible workaround), watch this issue https://github.com/flutter/flutter/issues/10667 .有关进一步的发展(以及可能的解决方法),请观看此问题https://github.com/flutter/flutter/issues/10667

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

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