Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

复杂控件刷新问题 #23

Closed
wayu002 opened this issue Mar 3, 2020 · 2 comments
Closed

复杂控件刷新问题 #23

wayu002 opened this issue Mar 3, 2020 · 2 comments

Comments

@wayu002
Copy link

wayu002 commented Mar 3, 2020

问题场景:

  1. 自定义控件A,A内部包含自定义控件B。
  2. B由于某些触发因素(如:动画、点击等)通过js 通知 flutter端rebuild。
  3. A由于某些因素(如:ListView滚动)导致从Flutter端发起build流程。

问题现象:
此时B控件的状态没有保存住,被重置了,比如B控件显示动画之前的UI状态。

原因分析:
从源码中,感觉是因为当A build时,保存了整个控件的widgetData,当B被build时,只有B控件自身进行了更新,A中保存的widgetDdata没有更新,所以当A由于flutter端触发的build操作,使用的还是旧的widgetData,显示出来的B控件就变成旧的UI样式了。

希望状态管理这块内容在新版本能有更好的更直观的使用方式。

@mxflutter
Copy link
Owner

感谢反馈,我们已经注意到了这个问题,将使用类似KeepAlives的设计来解决这个问题。

@mxflutter
Copy link
Owner

v0.8.0已支持嵌套widget的状态保持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants