getObjList<T> static method
Converts JSON string list source
to object list.
Implementation
static List<T>? getObjList<T>(String? source, T Function(Map v) f) {
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) {
debugPrint('JsonUtil convert error, Exception:${e.toString()}');
}
return null;
}