asIntOr method Null safety

int asIntOr(
  1. int defaultValue

Asserts that value is an integer and returns it.

If value doesn't exist, this returns defaultValue.

Note that which values count as integers varies between the Dart VM and dart2js. The value 1.0 will be considered an integer under dart2js but not under the VM.


int asIntOr(int defaultValue) => asInt;