createMetaCounters method Null safety

Future<Map<String, int>> createMetaCounters(
  1. Map<String, int> metaCounters
)

Creates meta counters on this channel with metaCounters.

It returns Map<String, String> that newly created. Once it completes successfully, channel event ChannelEventHandler.onMetaCountersCreated will be invoked.

Implementation

Future<Map<String, int>> createMetaCounters(
    Map<String, int> metaCounters) async {
  if (metaCounters.isEmpty) {
    throw InvalidParameterError();
  }

  return _sdk.api.send(
    ChannelMetaCounterCreateRequest(
      channelType: channelType,
      channelUrl: channelUrl,
      metaCounter: metaCounters,
    ),
  );
}