bodyAsList<T extends DataModel> method

List<T> bodyAsList<T extends DataModel>()

Implementation

List<T> bodyAsList<T extends DataModel>() {
  return (data as List).map((element) {
    final T model = DataModel.getType(T).constructor() as T;
    model.fromJSON(element);
    return model;
  }).toList();
}