getObjList<T> static method
Converts JSON string list source
to object list.
Implementation
static List<T>? getObjList<T>(String? source, T f(Map v)) {
if (source == null || source.isEmpty) return null;
try {
List list = json.decode(source);
return list.map((value) {
if (value is String) {
value = json.decode(value);
}
return f(value);
}).toList();
} catch (e) {
print('JsonUtil convert error, Exception:${e.toString()}');
}
return null;
}