toInt function

int toInt(
  1. Object value, {
  2. int defaultValue = defaultInt,
})

Parse to int or returns defaultValue

Implementation

int toInt(
  Object value, {
  int defaultValue = defaultInt,
}) {
  int number = defaultValue;
  try {
    number = toDouble(value).toInt();
  } on Exception catch (e, s) {
    errorLogsNS("toInt", e, s);
  }
  return number;
}