toListOfInt static method
Converts a dynamic value to a non-nullable list of integers.
d
- The dynamic value to be converted.
Returns a list of integers.
Implementation
static List<int> toListOfInt(dynamic d) {
final jsonList = Convert.toListN(d);
final List<int> result = [];
if (jsonList != null) {
jsonList.forEach((e) {
final i = Convert.toIntN(e);
if (i != null) {
result.add(i);
}
});
}
return result;
}