diff options
Diffstat (limited to 'lib/models/post.dart')
-rw-r--r-- | lib/models/post.dart | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/models/post.dart b/lib/models/post.dart new file mode 100644 index 0000000..28231f1 --- /dev/null +++ b/lib/models/post.dart @@ -0,0 +1,19 @@ +class Post { + final int id; + final String description; + final String date; + + const Post({ + required this.id, + required this.description, + required this.date, + }); + + factory Post.fromMap(Map<String, dynamic> map) { + return Post( + id: map["id"], + description: map["description"], + date: map["description"], + ); + } +} |