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