toInt function
convert the input to an integer, or NAN if the input is not an integer
Implementation
num toInt(String str, {int radix = 10}) {
try {
return int.parse(str, radix: radix);
} on FormatException {
try {
return double.parse(str).toInt();
} on FormatException {
return double.nan;
}
}
}