ExploreEventsViewModel class
ExploreEventsViewModel class helps to interact with model to serve data to view for event explore section.
Methods include:
fetchNewEvents
: to fetch new events in the organization.refreshEvents
: to refersh the event.checkIfExistsAndAddNewEvent
: to check if the event exists or not, if now add a new event.deleteEvent
: to delete the event.choseValueFromDropdown
: to return the relevant message in the dropdown after any action.
Inheritance
- Object
- ChangeNotifier
- BaseModel
- ExploreEventsViewModel
Constructors
Properties
chosenValue → String
read-only
emptyListMessage → String
read-only
events → List<Event>
read-only
eventService → EventService
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
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
checkIfExistsAndAddNewEvent(Event newEvent) Future<void>
This function add a new event if the event not exist.
choseValueFromDropdown(String value) Future<void>
This function takes the choosen value from dropdown and return the filter events, if empty list then return relevant message.
deleteEvent({required String eventId}) Future<void>
This function deletes the event.
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
fetchNewEvents() Future<void>
This function is used to fetch new events in the organization.
The function uses getEvents
method from EventService
.
initialise() Future<void>
noSuchMethod(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed.
inherited
notifyListeners() void
Call all the registered listeners.
inherited
refreshEvents() Future<void>
This function is used to refresh the events in the organization.
The function uses getEvents
method from EventService
.
removeListener(VoidCallback listener) void
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
setState(ViewState viewState) void
inherited
toString() String
A string representation of this object.
inherited
Operators
operator ==(Object other) bool
The equality operator.
inherited