createChat method

Future<SjChatDto> createChat(
  1. SjChatSendsDto chat
)

Создание нового чата.

См: urls.apiChatSend, SjChatSendsDto.

Implementation

Future<SjChatDto> createChat(SjChatSendsDto chat) async {
  final result = await $httpPost(urls.apiMsgsGet, {
    'chat': chat.toJson(),
  });
  if (!result.containsKey('chat')) {
    throw const FormatException('invalid response');
  }
  final res = result['chat'] as Map;
  return SjChatDto.fromJson(res);
}