list<T extends DataModel> method

List<T> list<T extends DataModel>(
  1. Type type
)

Convert response body to a list of DataModel

Implementation

List<T> list<T extends DataModel>(Type type) {
  return data.map((element) {
    T model = DataModel.create<T>(type);
    model.fromJSON(element);
    return model;
  });
}