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

ExceptionBinding是如何使ViewModel对内部api进行异常捕获和监听调用的? #18

Closed
Chaos-woo opened this issue Feb 20, 2022 · 5 comments

Comments

@Chaos-woo
Copy link

看到这个功能的更新:ExceptionBinding,使viewModel可以对内部的所有api接口的异常捕获

目前我的view model实现了ExceptionBinding的notifyException方法以及监听者注册,但是看了框架代码之后,没发现在什么地方来调用注册的监听。麻烦能不能解释一下?谢谢了大佬!!

注:
1.只在exception_pitcher.dart中看到view model InitData()的异常状态捕获
2.未看到其他地方对非initData()的api异常监听回调使用

@Chaos-woo
Copy link
Author

我当前的理解是notifyException()方法可以处理判断抛出何种异常,以及api请求的数据responseData,但是不知框架何处来处理这些注册监听者回调。 有看到demo中的示例,但未能理解,看到问题麻烦描述一下,谢谢了

@Chaos-woo
Copy link
Author

@bladeofgod

@bladeofgod
Copy link
Owner

你好,刚才我查看了这里的代码,发现对应没有实现,因为时间太久远,所以具体啥原因也忘了
01D2185F

@bladeofgod
Copy link
Owner

目前已经补全对应功能,并且适配了flutter 2.10 , 最新版本号: 2.2.0

@Chaos-woo
Copy link
Author

好的,谢谢大佬啦。后续我根据更新内容补全一下我的代码。 @bladeofgod

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