image property

String? image

Shortcut to get channel image.

If an image is provided it will be set on extraData with a key of 'image'.

For example:

final user = User(id: 'id', image: 'https://getstream.io/image.png');
print(user.image == user.extraData['image']); // true

Implementation

String? get image => extraData['image'] as String?;
void image=(String? image)

Shortcut to set channel image.

If an image is provided it will be set on extraData with a key of 'image'.

For example:

final user = User(id: 'id', image: 'https://getstream.io/image.png');
print(user.image == user.extraData['image']); // true

Implementation

set image(String? image) {
  if (_initializedCompleter.isCompleted) {
    throw StateError(
      'Once the channel is initialized you should use `channel.updateImage` '
      'to update the channel image',
    );
  }
  _extraData.addAll({'image': image});
}