toInt method

int toInt({
  1. int radix = 10,
  2. int def = -1,
})

Implementation

int toInt({int radix = 10, int def = -1}) {
  return int.tryParse(str(), radix: radix) ?? def;
}