Guest User

Untitled

a guest
May 27th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. class PaintingResponse {
  2. List<Painting> paintings;
  3.  
  4. PaintingResponse(this.paintings);
  5.  
  6. PaintingResponse.fromJson(Map<String, dynamic> json) {
  7. if (json['Paintings'] != null) {
  8. paintings = new List<Painting>();
  9. json['Paintings'].forEach((v) {
  10. paintings.add(new Painting.fromJson(v));
  11. });
  12. }
  13. }
  14.  
  15. Map<String, dynamic> toJson() {
  16. final Map<String, dynamic> data = new Map<String, dynamic>();
  17. if (this.paintings != null) {
  18. data['Paintings'] = this.paintings.map((v) => v.toJson()).toList();
  19. }
  20. return data;
  21. }
  22. }
Add Comment
Please, Sign In to add comment