简体   繁体   English

使用 go_router 和 bloc 在 context.pop() 之后刷新视图

[英]Refreshing a view after context.pop() with go_router and bloc

I have 2 different views with two different blocs.我对两个不同的集团有两种不同的看法。 One page displays data that is edited on the second page.一页显示在第二页上编辑的数据。 When I upload values from my bloc on the second page and execute a context.pop to return to the first page, the first page doesn't reaload and since they're separate bloc, it's not noticing any change当我在第二页上从我的 bloc 上传值并执行 context.pop 返回到第一页时,第一页不会重新加载,因为它们是单独的 bloc,所以没有注意到任何变化

I am using go_router (i can't use navigator for navigation) I tried to make an async call to execute after it comes back but i couldn't我正在使用 go_router(我不能使用导航器进行导航)我试图在它返回后执行异步调用,但我做不到

I was able to solve this issue by adding unique keys to my pages in go router!我能够通过在 go 路由器中向我的页面添加唯一键来解决这个问题!

see more here: https://github.com/flutter/flutter/issues/100969#issuecomment-1289944809在这里查看更多信息: https://github.com/flutter/flutter/issues/100969#issuecomment-1289944809

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

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