Event class

Immutable domain entity representing an analytics event.

Constructors

Event({required String id, required String name, required DateTime timestamp, String? screenName, Map<String, dynamic> properties = const {}, String? userId, String? sessionId})
const
Event.create({required String name, String? screenName, Map<String, dynamic>? properties, String? userId, String? sessionId})
Create an event with auto-generated ID and current timestamp.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for this event.
final
name String
Name of the event (e.g., 'button_click', 'page_view').
final
properties Map<String, dynamic>
Additional event properties.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenName String?
Screen or page where the event occurred.
final
sessionId String?
Session identifier (optional).
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
timestamp DateTime
Timestamp when the event occurred.
final
userId String?
User identifier (optional).
final

Methods

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

Operators

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