扑动本地平台视图
请我想知道本地平台视图的确切颤动。每当调用构建方法时,是否会重新创建平台视图,以及我如何杀死或删除平台视图或取消注册以发布资源
please I want to know how exactly flutter native platform view works. does the platform view get recreated every time the build method is called and how do I kill or remove a platform view or unregister it to release resources
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您想知道的真正取决于颤音在内部的作用。
当您在显示本机视图的小部件中调用SetState时,应再次调用构建方法。这是否意味着重建本地观点?可能不是。 在使用的renderobjects。
flutter尝试重复使用已 您阅读文档
我窥视了示例,我认为您不必明确称呼本地视图,但我认为您可能必须处置任何可能需要与之互动的控制器(就像您必须以相同的方式处置WebViewController如果使用WebView)。
I think what you want to know really depends upon what Flutter does internally.
When you call setState in the Widget which displays a native view, it should cause the build method to be called again. Does that mean the native view is rebuilt? Probably not. Flutter attempts to reuse the RenderObjects which are already in use.
Regarding native view lifecycles, have you read the documentation from Flutter?
I peeked through the examples and I don't think you have to explicitly call dispose on native views, but I think you'll likely have to dispose any controllers you might need to interact with them (in the same manner you have to dispose of WebViewController if you use WebView).