Room class
A room is where chat messages are exchanged between an end user on one side and your care team (hub users) on the other side.
List of events
error
→ Fired when there is a problem establishing connection to the server. The attached event listeners are called with an ErrorEvent instance.ready
→ Fired at most once, when the connection to the server is first established. The attached event listeners are called with a RoomReadyEvent instance.message_posted
→ Fired when there is a new message posted in the room (by any user). The attached event listeners are called with a MessagePostedEvent instance.message_deleted
→ Fired when a message is deleted from the room (by any user). The attached event listeners are called with a MessageDeletedEvent instance.marker_moved
→ Fired when a marker in the room is updated or created (by any user). The attached event listeners are called with a MarkerMovedEvent instance.
Constructors
- Room(Connector _connector, int _roomId)
- Do not create instances directly — use Kabelwerk.openRoom instead.
Properties
-
attributes
→ Map<
String, dynamic> -
The room's custom attributes.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- ownMarker → Marker?
-
The connected user's marker — or null if this does not exist yet.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- theirMarker → Marker?
-
The latest hub-side marker — or null if this does not exist yet.
no setter
- user → User
-
The room's end user.
no setter
Methods
-
connect(
) → Future< PushResponse> - Establishes connection to the server.
-
deleteMessage(
int messageId) → Future< Message> - Deletes a message from the room.
-
disconnect(
) → void - Closes the connection to the server.
-
loadEarlier(
) → Future< List< Message> > - Loads more messages from earlier in the chat history.
-
moveMarker(
[int? messageId]) → Future< Marker> - Moves the connected user's marker in the room, creating it if it does not exist yet.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
off(
[String? event, String? reference]) → void - Removes one or more previously attached event listeners.
-
on(
String event, Function function) → String - Attaches an event listener.
-
once(
String event, Function function) → String - Attaches a one-time event listener.
-
postMessage(
{required String text}) → Future< Message> - Posts a new message in the chat room.
-
postUpload(
XFile file) → Future< Upload> - Uploads a file in the chat room.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateAttributes(
Map newAttributes) → Future< Map> - Sets the room's custom attributes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited