isValidInt property
bool?
get
isValidInt
Whether this big integer can be represented as an int
without losing
precision.
Warning: this function may give a different result on dart2js, dev compiler, and the VM, due to the differences in integer precision.
Example:
var bigNumber = BigInt.parse('100000000000000000000000');
print(bigNumber.isValidInt); // false
var value = BigInt.parse('0xFF'); // 255
print(value.isValidInt); // true
Implementation
bool? get isValidInt => value?.isValidInt;