Skip to main content

addNewPost method

void addNewPost (Post newPost)

This function adds new Post.

params:

  • newPost

Implementation

void addNewPost(Post newPost) {
_posts.insert(0, newPost);
notifyListeners();
}