getAllMetaData method

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

Retrieves all metaData from this channel.

Implementation

Future<Map<String, String>> getAllMetaData() async {
  final result = await _sdk.api.send<MetaDataResponse>(
    ChannelMetaDataGetRequest(
      channelType: channelType,
      channelUrl: channelUrl,
    ),
  );

  final cached = _sdk.cache.find<CachedDataMap>(channelKey: channelUrl) ??
      CachedDataMap<String>(
        channelType: channelType,
        channelUrl: channelUrl,
        timestamp: result.ts,
      );
  cached.addMap(result.metadata, result.ts);
  cached.saveToCache();

  return result.metadata;
}