Message class Null safety

Class that encapsulate a message being sent or received on a PhoenixSocket.

Inheritance

Constructors

Message({String? joinRef, String? ref, String? topic, required PhoenixChannelEvent event, Map<String, dynamic>? payload})
Build a Message from its constituents.
Message.fromJson(List parts)
Given a parsed JSON coming from the backend, yield a Message instance.
factory
Message.heartbeat(String ref)
Given a unique reference, generate a heartbeat message.
factory
Message.timeoutFor(String ref)
Given a unique reference, generate a timeout message that will be used to error out a push.
factory

Properties

event PhoenixChannelEvent
The event name of this message.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
isReply bool
Whether the message is a reply message.
read-only
joinRef String?
Reference of the channel on which the message is received. [...]
final
payload Map<String, dynamic>?
The payload of this message. [...]
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
read-only, override
ref String?
The unique identifier for this message. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stringify bool
If set to true, the toString method will be overridden to output this instance's props. [...]
read-only, override
topic String?
The topic of the channel on which this message is sent.
final

Methods

asReplyEvent() Message
Return a new Message with the event name being that of a proper reply message.
encode() Object
Encode a message to a JSON-encodable list of values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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