Event class abstract

An event to be published to the server.

Available extensions
Annotations
  • @freezed

Constructors

Event({String? name, DateTime? timestamp, String? value, Map<String, dynamic>? metadata, String? id})
const
factory
Event.fromDto(ApiEvent dto)
factory
Event.fromJson(Map<String, dynamic> json)
factory

Properties

copyWith → $EventCopyWith<Event>
Create a copy of Event with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String?
Optional event ID assigned by the client, used to de-duplicate in retransmission scenarios. If not supplied the server will assign a randomly generated unique event identifier.
no setterinherited
metadata Map<String, dynamic>?
Event metadata, if any.
no setterinherited
name String?
The name of the event.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime?
The time when the event was triggered.
no setterinherited
value String?
Optional value.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Event value)) → TResult

Available on Event, provided by the EventPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Event value)?) → TResult?

Available on Event, provided by the EventPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Event value)?, {required TResult orElse()}) → TResult

Available on Event, provided by the EventPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String? name, DateTime? timestamp, String? value, Map<String, dynamic>? metadata, String? id)?, {required TResult orElse()}) → TResult

Available on Event, provided by the EventPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toApiEvent() → ApiEvent
toJson() Map<String, dynamic>
Serializes this Event to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String? name, DateTime? timestamp, String? value, Map<String, dynamic>? metadata, String? id)) → TResult

Available on Event, provided by the EventPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String? name, DateTime? timestamp, String? value, Map<String, dynamic>? metadata, String? id)?) → TResult?

Available on Event, provided by the EventPatterns extension

A variant of when that fallback to returning null

Operators

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