Skip to main content

initializeWithDemoData method

void initializeWithDemoData ()

Implementation

void initializeWithDemoData() \{
final postJsonResult = postsDemoData;
------
Calling function to ge the post for the only 1st time.
_postService.getPosts();
fetching pinnedPosts
final pinnedPostJsonResult = pinnedPostsDemoData;
pinnedPostJsonResult.forEach((pinnedPostJsonData) \{
_pinnedPosts.add(Post.fromJson(pinnedPostJsonData));
\});
\}