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

fix: fix page reload. #1109

Merged
merged 3 commits into from
Jan 17, 2022
Merged

fix: fix page reload. #1109

merged 3 commits into from
Jan 17, 2022

Conversation

andycall
Copy link
Member

@andycall andycall commented Jan 17, 2022

修复页面刷新,RenderViewport 的挂载问题。

Kraken 刷新页面,不会触发 Kraken 外层 Flutter Widget 树的更新。因此需要保留上一个页面 RenderViewportBox,把内部的 RenderObject 都删除,待页面刷新完成,再将新的页面内容,挂载到原先的 RenderViewportBox 下面。

缺乏测试基建,暂时无法写测试,测试基建搭建 @andycall

@@ -111,6 +111,8 @@ class KrakenViewController
this.navigationDelegate,
this.gestureListener,
this.widgetDelegate,
// Viewport won't change when kraken page reload, should reuse previous page's viewportBox.
RenderViewportBox? originalViewport
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

viewport?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能用 this.viewport,已经有这个变量了

answershuto
answershuto previously approved these changes Jan 17, 2022
@wssgcg1213 wssgcg1213 merged commit d76f329 into main Jan 17, 2022
@wssgcg1213 wssgcg1213 deleted the fix/page_reload branch January 17, 2022 09:17
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

Successfully merging this pull request may close these issues.

3 participants