createConversation method

Future<Conversation> createConversation({
  1. bool isUnique = true,
  2. required Set<String> members,
  3. String? name,
  4. Map<String, dynamic>? attributes,
})

To create a normal Conversation.

isUnique is a special parameter, default is true, it affects the creation behavior and property Conversation.isUnique.

  • When it is true and the relevant unique Conversation not exists in the server, this method will create a new unique Conversation.
  • When it is true and the relevant unique Conversation exists in the server, this method will return that existing unique Conversation.
  • When it is false, this method always create a new non-unique Conversation.

members is the Conversation.members. name is the Conversation.name. attributes is the Conversation.attributes.

Returns an instance of Conversation.

Implementation

Future<Conversation> createConversation({
  bool isUnique = true,
  required Set<String> members,
  String? name,
  Map<String, dynamic>? attributes,
}) async {
  return await _createConversation(
    type: _ConversationType.normal,
    isUnique: isUnique,
    members: members,
    name: name,
    attributes: attributes,
  );
}