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
- ChangeNotifier
- BaseModel
- OrganizationFeedViewModel
Constructors
Properties
currentOrgName → String
read-only
hashCode → int
The hash code for this object.
read-onlyinherited
hasListeners → bool
Whether any listeners are currently registered.
read-onlyinherited
isBusy → bool
read-onlyinherited
istest ↔ bool
read / write
pinnedPosts → List<Post>
read-only
posts → List<Post>
read-only
runtimeType → Type
A representation of the runtime type of the object.
read-onlyinherited
state → ViewState
read-onlyinherited
Methods
addListener(VoidCallback listener) void
Register a closure to be called when the object changes.
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).
override
fetchNewPosts() void
This function fetches new posts in the organization.
initialise({bool isTest = false}) void
initializeWithDemoData() void
navigateToIndividualPage(Post post) void
This function navigate to individual post page.
navigateToPinnedPostPage() void
This function navigate to pinned post page.
noSuchMethod(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed.
inherited
notifyListeners() void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) void
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
setCurrentOrganizationName(String updatedOrganization) void
This function sets the organization name after update.
setState(ViewState viewState) void
inherited
toString() String
A string representation of this object.
inherited
updatedPost(Post post) void
This function updates the post.
Operators
operator ==(Object other) bool
The equality operator.
inherited