deleteAllMetaData method

Future<void> deleteAllMetaData()

Deletes a meta data on this channel with key.

After this method completes successfully, channel event ChannelEventHandler.onMetaDataDeleted will be invoked.

Implementation

Future<void> deleteAllMetaData() async {
  final ts = await _sdk.api.send<int>(
    ChannelMetaDataDeleteAllRequest(
      channelType: channelType,
      channelUrl: channelUrl,
    ),
  );

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