-
Notifications
You must be signed in to change notification settings - Fork 74
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
使用了showWeuiLoadingToast后Navigator.pop就返回不了返回值了 #8
Comments
Toast 不应该有返回值的 |
还有你这个要么在toast 完成前,要么完成后,toast 是占有pop 的 |
当然不是要返回toast的值,假设有这样的应用场景,页面B做了一些耗时的事后自动返回页面A,这时先显示一个loading toast,然后发个http请求等回应,然后根据回应传递不同参数给下个页面,这时候这样写就会有问题,从流程角度看,有两个pop应该顺序执行,但toast的pop会比页面的pop延迟一帧 |
是的,因为我里面做了个回调处理,不是即时相应,我晚点修改一下,返回一个future`` |
我昨天稍微改了下,这样用的 另外,如果你用overlay来实现的话,为什么还要push和pop? |
这里是当时做的时候没有直接使用Overlay,之后会改过的,因为也是个摸索的过程 |
嗯嗯。理论上来说toast是和页面无关的,即使页面跳转了,只要toast还活着就能显示。dialog是显示在当前页面的,页面关了dialog也关了。所以toast之类的用overlay会好一点。 |
问题已修复,你更新下版本看看 |
谢谢,已使用。 |
initState的时候context 是不是还没初始化好 |
如果可以的话我就关掉这个issue |
var hide = showWeuiLoadingToast(context: context, message: Text("请稍后"));
await Future.delayed(Duration(seconds: 2));
hide();
Navigator.pop(context, 'Yep');====>这个‘Yep'就返回不到上个页面了
The text was updated successfully, but these errors were encountered: