mulFromInteger在null上被调用 [英] mulFromInteger was called on null

查看:303
本文介绍了mulFromInteger在null上被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些奇怪的错误,这些错误是从我的颤振页面中得到的,这些数学值都是空的。

i have strange errors got from my flutter pages do some math computation with null value. or i assume it was makes errors happening.

在我的情况下,我在有状态的小部件初始化部分进行了诸如(120 * null)的计算。当我在发布模式下构建时。我有调试视图,这意味着它会在我的应用程序中读取背景并显示:

in my case i do computation such as (120 * null) inside stateful widget init section. when i build in release mode. I have debug view which means it read background in my apps and shows:

NoSuchMethodError: The method '_mulFromInteger' was called on null.
Receiver: null
Tried Calling:_mulFromInteger(134)

是乘法运算(*)后面有方法吗?还是有人可以解释_mulFromInteger是什么?

is multiply operations (*) have method behind of it? or can anyone explain what is _mulFromInteger?

推荐答案

此实现 int dart中的dart由类 _IntegerImplementation 提供。在此类中,您可以看到:

This implementation of int in dart is provided by the class _IntegerImplementation. In this class you can see:

num operator *(num other) => other._mulFromInteger(this);

您可以看到执行操作符 * 对该参数调用 _mulFromInteger 。这就是为什么您会收到此错误。

You can see that the implementation of the operator * calls _mulFromInteger on the argument. That's why you get this error.

这篇关于mulFromInteger在null上被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆