asInt property

int asInt

Asserts that value exists and is an integer and returns it.

asIntOr may be used to provide a default value instead of rejecting the request if value doesn't exist.

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.

Implementation

int get asInt => _getTyped('an integer', (value) => value is int);