Whats the best way to do this? The solution I found right now is pretty crappy?
http.Response resp = await http.get('$endpoint');
List l = json.decode(resp.body);
List<Message> c = new List();
l.forEach((i){
c.add(new Message.fromJson(i));
return i;
});
return c;