onChannelDeleted method
Function which gets called for the event EventType.channelDeleted.
This event is fired when a channel is deleted.
By default, this removes the channel from the list of channels.
Implementation
void onChannelDeleted(Event event, StreamChannelListController controller) {
final channels = [...controller.currentItems];
final updatedChannels = channels
..removeWhere(
(it) => it.cid == (event.cid ?? event.channel?.cid),
);
controller.channels = updatedChannels;
}