Skip to main content

OrganizationFeedViewModel class

OrganizationFeedViewModel class helps to interact with model to serve data to view for organization feed section.

Methods include:

  • setCurrentOrganizationName : to set current organization name.
  • fetchNewPosts : to fetch new posts in the organization.
  • navigateToIndividualPage : to navigate to individual page.
  • navigateToPinnedPostPage : to navigate to pinned post page.
  • addNewPost : to add new post in the organization.
  • updatedPost : to update a post in the organization.

Inheritance

: - Object

Constructors

OrganizationFeedViewModel

:

Properties

[currentOrgName] [→ String] : getter for the currentOrgName. ::: features no setter :::

[hashCode] [→ int] : The hash code for this object. ::: features no setterinherited :::

[hasListeners] [→ bool] : Whether any listeners are currently registered. ::: features no setterinherited :::

[isBusy] [→ bool]

: ::: features no setterinherited :::

[isFetchingPosts] [→ bool] : getter for isFetchingPosts to show loading indicator. ::: features no setter :::

[istest] [↔ bool] : flag for the test. ::: features getter/setter pair :::

[pinnedPosts] [→ List[<[Post]>]] : getter for the pinned post. ::: features no setter :::

[posts] [→ List[<[Post]>]] : getter for the posts. ::: features no setter :::

[runtimeType] [→ Type] : A representation of the runtime type of the object. ::: features no setterinherited :::

[state] [→ ViewState]

: ::: features no setterinherited :::

[userPosts] [→ List[<[Post]>]] : Getter for User Posts. ::: features no setter :::

Methods

[addListener][([[VoidCallback] listener]) → void ] : Register a closure to be called when the object changes. ::: features inherited :::

[addNewPost][([[Post] newPost]) → void ] : This function adds new Post.

[buildNewPosts][([[List[<[Post]>]] newPosts]) → void ] : This function initialise _posts with newPosts.

dispose [→ void ] : Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed). ::: features override :::

fetchNewPosts [→ void ] : This function fetches new posts in the organization.

[initialise][ → void ] : To initialize the view model.

[navigateToIndividualPage][([[Post] post]) → void ] : This function navigate to individual post page..

navigateToPinnedPostPage [→ void ] : This function navigate to pinned post page.

nextPage [→ void ] : Method to fetch next posts.

[noSuchMethod][([[Invocation] invocation]) → dynamic ] : Invoked when a nonexistent method or property is accessed. ::: features inherited :::

notifyListeners [→ void ] : Call all the registered listeners. ::: features inherited :::

previousPage [→ void ] : Method to fetch previous posts.

[removeListener][([[VoidCallback] listener]) → void ] : Remove a previously registered closure from the list of closures that are notified when the object changes. ::: features inherited :::

[removePost][([[Post] post]) [→ Future<[void>]] ] : function to remove the post.

[setCurrentOrganizationName][([[String] updatedOrganization]) → void ] : This function sets the organization name after update.

[setState][([[ViewState] viewState]) → void ]

: ::: features inherited :::

[toString][ [→ String] ] : A string representation of this object. ::: features inherited :::

[updatedPost][([[Post] post]) → void ] : This function updates the post.

Operators

[operator ==][([[Object] other]) [→ bool] ] : The equality operator. ::: features inherited :::

  1. talawa
  2. organization_feed_view_model
  3. OrganizationFeedViewModel class
organization_feed_view_model library