Sonnat Project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
615 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. class Post {
  2. int id;
  3. String name;
  4. String description;
  5. String image;
  6. int date;
  7. Post({
  8. required this.description,
  9. required this.name,
  10. required this.image,
  11. required this.id,
  12. required this.date,
  13. });
  14. factory Post.fromJson(Map<String, dynamic> json) {
  15. return Post(
  16. name: json['name'],
  17. image: json['image'],
  18. description: json['description'],
  19. id: json['id'],
  20. date: json['date'],
  21. );
  22. }
  23. Post copyWith(int date) {
  24. return Post(
  25. description: description,
  26. name: name,
  27. image: image,
  28. id: id,
  29. date: date,
  30. );
  31. }
  32. }