Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mulFromInteger was called on null

Tags:

flutter

dart

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

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)

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

like image 302
M. Plant Avatar asked Jan 26 '26 16:01

M. Plant


1 Answers

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);

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

like image 137
Alexandre Ardhuin Avatar answered Jan 29 '26 07:01

Alexandre Ardhuin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!