class Post { int id; String name; String description; String image; int date; Post({ required this.description, required this.name, required this.image, required this.id, required this.date, }); factory Post.fromJson(Map json) { return Post( name: json['name'], image: json['image'], description: json['description'], id: json['id'], date: json['date'], ); } Post copyWith(int date) { return Post( description: description, name: name, image: image, id: id, date: date, ); } }