Skip to main content

newConversation method

*[<Null safety>](https://dart.dev/null-safety)*

Future<Conversation> newConversation (String address, {String conversationId = "", Map<String, String> metadata = const <String, String>{}})

This creates or resumes a Conversation with address. If a conversationId is specified then that will distinguish multiple conversations with the same user. A new conversationId always creates a new conversation.

e.g. This creates 2 conversations with the same friend.

 var fooChat = await client.newConversation( friend, conversationId: 'https://example.com/foo', ); var barChat = await client.newConversation( friend, conversationId: 'https://example.com/bar', );

Implementation

Future<Conversation> newConversation(
String address, {
String conversationId = "",
Map<String, String> metadata = const <String, String>{},
}) =>
_conversations.newConversation(address, conversationId, metadata);