TableEvent<T> class
sealed
Base sealed class for all table change events
Provides unified access to EventContext across all event types, enabling pattern matching and type-safe event handling.
The sealed class pattern ensures exhaustive handling of all event types:
void handleTableEvent<T>(TableEvent<T> event) {
switch (event) {
case TableInsertEvent(:final row, :final context):
print('Inserted: $row');
if (context.isMyTransaction) {
print('By me!');
}
case TableUpdateEvent(:final oldRow, :final newRow):
print('Updated: $oldRow → $newRow');
case TableDeleteEvent(:final row):
print('Deleted: $row');
}
}
- Implementers
Properties
- context → EventContext
-
Context containing the Event and client access
no setter
- 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