getList<T> method
Implementation
Future<List<T>> getList<T>(String key, T fromMap(Map<String, dynamic> v)) async{
String jsonResult = _get(key, "");
if(ObjectUtil.isNotEmpty(jsonResult)){
List list = await Isolate.compute(_decode, jsonResult);
return list.map((e){
if(e is String){
return fromMap(json.decode(e));
}
return fromMap(e);
}).toList();
}
return [];
}