toInt method

int toInt()

A parte inteira (truncada). Lança UnsupportedError para valores não finitos ou fora da faixa de int.

Implementation

int toInt() {
  final value = toBigInt();
  if (!value.isValidInt) {
    throw UnsupportedError('$value does not fit in an int');
  }
  return value.toInt();
}