channelMetadata method

Future<ChannelMetadata> channelMetadata(
  1. String channelId, {
  2. String? name,
  3. String? description,
  4. Map<String, dynamic>? custom,
  5. Keyset? keyset,
  6. String? using,
})

Creates ChannelMetadata and sets metadata for given channel in the database.

Implementation

Future<ChannelMetadata> channelMetadata(String channelId,
    {String? name,
    String? description,
    Map<String, dynamic>? custom,
    Keyset? keyset,
    String? using}) async {
  keyset ??= keysets[using];

  var result = await objects.setChannelMetadata(
      channelId,
      ChannelMetadataInput(
          name: name, description: description, custom: custom),
      keyset: keyset);

  return ChannelMetadata(objects, keyset, result.metadata.id);
}