getAllMetaData method

Future<Map<String, String>> getAllMetaData()

Gets all meta data.

Implementation

Future<Map<String, String>> getAllMetaData() async {
  sbLog.i(StackTrace.current);
  checkUnsupportedAction();

  final result = await chat.apiClient.send<MetaDataResponse>(
    ChannelMetaDataGetRequest(
      chat,
      channelType: channelType,
      channelUrl: channelUrl,
    ),
  );

  final cached =
      chat.channelCache.find<MetaDataCache>(channelKey: channelUrl) ??
          MetaDataCache<String>(
            channelType: channelType,
            channelUrl: channelUrl,
            timestamp: result.ts,
          );
  cached.addMap(result.metadata, result.ts);
  cached.saveToCache(chat);

  return result.metadata;
}