Mercury class

A connection to a Mercury-backend.

Constructors

Mercury()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Static Properties

currentUser ↔ User
Gets the current user.
getter/setter pair
stream Stream
A stream of events from the server.
no setter

Static Methods

addReactionToMessage(String reaction, String messageId) Future
Add reaction reaction to message with id messageId.
createConversation(List<String> userIds, {String? image}) Future
Creates a conversation with the users specified by userIds.
deleteMessage(String id) Future<void>
Deletes message with id id.
deleteReactionFromMessage(String reactionId, String messageId) Future<void>
Delete reaction with id reactionId from message with id messageId.
editMessage(dynamic message) Future<void>
Replaces message with id message.id with message.
getConversationById(String id) Future
Retrieves a conversation by id.
getConversationByUsers(List<String> userIds) Future
Retrieves a conversation whose participant id's match exactly userIds.
initialize({String apiUrl = 'fr-par-1.nuntio.cloud', int port = 443, String? namespace, required UserAuth auth}) Future<void>
Initializes Mercury using the server https://apiUrl:port in namespace. The server must implement sdks/mercury.proto.
listContacts() Future<List<User>>
Lists all contacts of the current user.
listConversations({int from = 0, int to = 10}) Future<List>
Lists conversations [from, to) in which the current user participates.
listMessages(String conversationId, {int from = 0, int to = 20}) Future<List>
Lists messages in [from, to) in conversation with id conversationId.
ping() Future<void>
Pings the server.
send(String conversationId, dynamic message, {Uint8List? image}) Future
Send message message to conversation with id conversationId.