parseList<T> static method
Tries to parse a List.
Implementation
static List<T>? parseList<T>(Object? value,
{List<T>? def, TypeElementParser<T>? elementParser}) {
if (value == null) return def;
var l = _parseListImpl(value);
if (l == null) return def;
if (elementParser != null) {
l = l.map(elementParser).toList();
}
if (l is List<T>) {
return l;
} else if (elementParser != null) {
l = l.whereType<T>().toList();
} else {
var parser = parserFor<T>();
if (parser != null) {
l = l.map(parser).toList();
}
}
if (l is List<T>) {
return l;
} else {
return l.whereType<T>().toList();
}
}