Message class
Class that encapsulate a message being sent or received on a PhoenixSocket.
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.
no setteroverride
- isReply → bool
-
Whether the message is a reply message.
no setter
- joinRef → String?
-
Reference of the channel on which the message is received.
final
-
payload
→ Map<
String, dynamic> ? -
The payload of this message.
final
- ref → String?
-
The unique identifier for this message.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- 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 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