CEvent class abstract

Base class for everything emitted on an AtCollection's event streams.

Not sealed — new event subtypes are expected to be added in future minor-version releases (e.g. CItemAvailable, CItemExpiringSoon). Apps that switch on event type should always include a default: branch so a new event is a non-event rather than a broken build:

collection.watch().listen((event) {
  switch (event) {
    case CItemUpdated():    onUpdate(event); break;
    case CItemDeleted():    onDelete(event); break;
    case CReadReceipt():    onReceipt(event); break;
    default:                break; // unknown / future event
  }
});

owner + id identify the subject of the event — typically a CItem, matching that item's owner + id. Individual subclasses may refine what id refers to (e.g. for CSubItemUpdated, id is the sub-item's own id and CSubItemUpdated.ancestry carries its chain).

Implementers

Constructors

CEvent({required Atsign owner, required String id})

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
final
owner Atsign
final
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