Channel constructor

Channel(
  1. StreamChatClient _client,
  2. String _type,
  3. String? _id, {
  4. String? name,
  5. String? image,
  6. Map<String, Object?>? extraData,
})

Class that manages a specific channel.

Optional extraData and image properties can be provided. The image is exposed to easily set a key of 'image' on extraData.

Implementation

Channel(
  this._client,
  this._type,
  this._id, {
  String? name,
  String? image,
  Map<String, Object?>? extraData,
})  : _cid = _id != null ? '$_type:$_id' : null,
      _extraData = {
        ...?extraData,
        if (name != null) 'name': name,
        if (image != null) 'image': image,
      } {
  _client.logger.info('New Channel instance created, not yet initialized');
}