SSEEvent class

Server-Sent Events 事件类

Constructors

SSEEvent({String? id, String? event, required String data, int? retry, required DateTime timestamp})
const
SSEEvent.now({String? id, String? event, required String data, int? retry})
factory

Properties

data String
事件数据
final
event String?
事件类型
final
hashCode int
The hash code for this object.
no setterinherited
id String?
事件 ID
final
retry int?
重试间隔(毫秒)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
时间戳
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>?
将事件转换为 JSON 格式(如果数据是 JSON)
toString() String
A string representation of this object.
override

Operators

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