getChat method

Future<SjChatDto> getChat()

Получение данных чата.

См: urls.apiChatsGet, SjChatDto.

Implementation

Future<SjChatDto> getChat() async {
  final result = await $httpPost(urls.apiChatsGet, {});
  if (!result.containsKey('chats')) {
    throw const FormatException('invalid response');
  }
  final res = result['chats'] as List;
  return res.cast<Map>().map(SjChatDto.fromJson).first;
}