ChannelInfoViewController

class ChannelInfoViewController(cid: String, scope: CoroutineScope, copyToClipboardHandler: CopyToClipboardHandler, optionFilter: (option: ChannelInfoViewState.Content.Option) -> Boolean = { true }, chatClient: ChatClient = ChatClient.instance(), channelState: Flow<ChannelState> = chatClient .watchChannelAsState(cid = cid, messageLimit = 0, coroutineScope = scope) .filterNotNull(), channelClient: ChannelClient = chatClient.channel(cid))

Controller responsible for managing the state and events related to channel information.

It provides functionality to observe channel data, members, and perform various channel-related actions such as renaming, muting, hiding, leaving, and deleting the channel. It also handles state updates and emits events for UI consumption.

Parameters

cid

The unique identifier of the channel.

scope

The CoroutineScope used for launching coroutines.

copyToClipboardHandler

The CopyToClipboardHandler used for copying text to the clipboard.

optionFilter

A filter function for channel options, allowing customization of which options are displayed. Defaults to a function that returns true for all options.

chatClient

The ChatClient instance used for interacting with the chat API.

channelState

A Flow representing the state of the channel.

channelClient

The ChannelClient instance for performing channel-specific operations.

Constructors

Link copied to clipboard
constructor(cid: String, scope: CoroutineScope, copyToClipboardHandler: CopyToClipboardHandler, optionFilter: (option: ChannelInfoViewState.Content.Option) -> Boolean = { true }, chatClient: ChatClient = ChatClient.instance(), channelState: Flow<ChannelState> = chatClient .watchChannelAsState(cid = cid, messageLimit = 0, coroutineScope = scope) .filterNotNull(), channelClient: ChannelClient = chatClient.channel(cid))

Properties

Link copied to clipboard
val events: SharedFlow<ChannelInfoViewEvent>

A SharedFlow that emits one-shot events related to channel info, such as errors or success events.

Link copied to clipboard
val state: StateFlow<ChannelInfoViewState>

A StateFlow representing the current state of the channel info.

Functions

Link copied to clipboard
Link copied to clipboard

Handles actions related to channel information view.