toInt method

int toInt({
  1. int defaultValue = 0,
})

Convert to int or defaultValue

Implementation

int toInt({int defaultValue = 0}) {
  // Faz um toDouble, pq se tentar dar um parse em um decimal direto pra int resulta em erro
  return this.toDouble(defaultValue: defaultValue.toDouble()).toInt();
}