Message class

Contains an individual message that is sent to, or received from, Ably.

Annotations

Constructors

Message({String? clientId, String? connectionId, Object? data, String? encoding, MessageExtras? extras, String? id, String? name, DateTime? timestamp})
Construct a Message object with an event name, data payload, and a unique clientId.
Message.fromEncoded(Map<String, dynamic> jsonObject, [RestChannelOptions? channelOptions])
A static factory method to create a Message object from a deserialized Message-like object encoded using Ably's wire protocol, with a provided Message-like deserialized jsonObject and optionally a channelOptions object, which you can use to allow the library to decrypt the data if you have an encrypted channel.

Properties

clientId String?
The client ID of the publisher of this message.
final
connectionId String?
The connection ID of the publisher of this message.
final
data Object?
The message payload, if provided.
no setter
encoding String?
This is typically empty, as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute contains the remaining transformations not applied to the data payload.
final
extras MessageExtras?
An object that may contain metadata, and/or ancillary payloads.
final
hashCode int
The hash code for this object.
no setteroverride
id String?
A Unique ID assigned by Ably to this message.
final
name String?
The event name.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime?
Timestamp of when the message was received by Ably, as DateTime.
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

Static Methods

fromEncodedArray(List<Map<String, dynamic>> jsonArray, [RestChannelOptions? channelOptions]) List<Message>
A static factory method to create an array of Message objects from an jsonArray of deserialized Message-like object encoded using Ably's wire protocol, and optionally a channelOptions object, which you can use to allow the library to decrypt the data if you have an encrypted channel.