list<T extends DataModel> method
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;
});
}