toInt static method
Implementation
static int? toInt(value) {
if (value is double) {
return value.toInt();
} else if (value is int) {
return value;
} else if (value is String) {
return int.tryParse(value);
} else {
return null;
}
}