fromJsonList method

List<T> fromJsonList (
  1. List jsonList
)

Implementation

List<T> fromJsonList(List<dynamic> jsonList){
  if(jsonList == null) return null;
  if(jsonList.isEmpty) return [];
  List<T> list = jsonList.map((dynamic json) {
    if(json is! Map<String, dynamic>)
      throw new Exception("fromJsonList(List<dynamic> jsonList) expects a Json Map<String, dynamic> but other object was found instead");
    return fromJsonMap(json as Map<String, dynamic>);
  }).toList();
  return list;
}