Skip to content

How do I deserialize a JSONArray? #135

Closed
@FaisalAbid

Description

@FaisalAbid

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions