isInteger property

  1. @useResult
bool get isInteger

Returns true if this number has no fractional part.

true for any int, and for a double whose value equals its rounded value (e.g. 2.0).

Implementation

@useResult
bool get isInteger => this is int || (this is double && this == roundToDouble());