Monday, April 1, 2019

Json to Model with type



class ImageModel{

  String id;
  String url;
  String title;

  ImageModel(this.id, this.url, this.title);

  ImageModel.fromJson(Map<String, dynamic> parsedJson){
    id = parsedJson['id'];
    url = parsedJson['url'];
    title = parsedJson['title'];
  }
  
}

No comments:

Post a Comment