EventQueue<T> class abstract

An abstraction to communicate events to UI from ViewModel or the likes.

Depends on LiveData internally.

Most of the events originate in the UI, so wouldn't need communication of the same to the UI layer.

In the rest of the cases, there will be changes to the "state" of the UI exposed via LiveData / Stream etc.

But there are cases where the UI needs to be notified of events after an asynchronous work etc for things like toasts, dialogs etc. These are essentially "ephemeral state" and should be cleared after being handled. Just as described in the Official Android Guidelines for UI Events

If you are in doubt of whether to put something inside the state or fire an event, prefer the state.

Implementers

Constructors

EventQueue()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited