测试时LateInitializationError
我的变量已初始化,但我仍然收到 LateInitializationError
。我只在测试时得到这个,正常工作正常。 日志:
Closure: () => void from Function 'updateLight':. // This is the value of variable being printed
══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following LateError was thrown while handling a gesture:
LateInitializationError: Field 'updateMethod' has not been initialized.
我可以打印要使用的变量,这意味着它已被初始化。
My variable has been initialized but I still get LateInitializationError
. I only get this during testing, it works fine normally.
Logs:
Closure: () => void from Function 'updateLight':. // This is the value of variable being printed
══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following LateError was thrown while handling a gesture:
LateInitializationError: Field 'updateMethod' has not been initialized.
I can print the variable which is to be used, which means it has been initialized.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论