WebSocketMessage class

Represents a WebSocket message with metadata

Constructors

WebSocketMessage.new({required dynamic data, required DateTime timestamp, String? type, Map<String, dynamic>? metadata})
const
WebSocketMessage.binary(List<int> bytes)
Creates a binary message
factory
WebSocketMessage.json(Map<String, dynamic> json)
Creates a JSON message
factory
WebSocketMessage.now({required dynamic data, String? type, Map<String, dynamic>? metadata})
Creates a message with current timestamp
factory
WebSocketMessage.text(String text)
Creates a text message
factory

Properties

data → dynamic
final
hashCode int
The hash code for this object.
no setteroverride
metadata Map<String, dynamic>?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
final
type String?
final

Methods

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

Operators

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