getList<T> method

List<T> getList<T>(
  1. String key,
  2. T fromMap(
    1. Map v
    )
)

Implementation

List<T> getList<T>(String key, T fromMap(Map v)){
  String jsonResult = _get(key, "");
  if(ObjectUtil.isNotEmpty(jsonResult)){
    List list = json.decode(jsonResult);
    return list.map((e){
      if(e is String){
        return fromMap(json.decode(e));
      }
      return fromMap(e);
    }).toList();
  }
  return [];
}