-
public final class ChannelInfoViewControllerController 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.
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<ChannelInfoViewState>stateprivate final SharedFlow<ChannelInfoViewEvent>events
-
Constructor Summary
Constructors Constructor Description ChannelInfoViewController(String cid, CoroutineScope scope, CopyToClipboardHandler copyToClipboardHandler, Function1<ChannelInfoViewState.Content.Option, Boolean> optionFilter, ChatClient chatClient, Flow<ChannelState> channelState, ChannelClient channelClient)
-
Method Summary
Modifier and Type Method Description final StateFlow<ChannelInfoViewState>getState()A StateFlow representing the current state of the channel info. final SharedFlow<ChannelInfoViewEvent>getEvents()A SharedFlow that emits one-shot events related to channel info, such as errors or success events. final UnitonViewAction(ChannelInfoViewAction action)Handles actions related to channel information view. final UnitonMemberViewEvent(ChannelInfoMemberViewEvent event)Propagates events from the ChannelInfoMemberViewEvent to the ChannelInfoViewEvent. -
-
Constructor Detail
-
ChannelInfoViewController
ChannelInfoViewController(String cid, CoroutineScope scope, CopyToClipboardHandler copyToClipboardHandler, Function1<ChannelInfoViewState.Content.Option, Boolean> optionFilter, ChatClient chatClient, Flow<ChannelState> channelState, ChannelClient channelClient)
- 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.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.
-
-
Method Detail
-
getState
final StateFlow<ChannelInfoViewState> getState()
A StateFlow representing the current state of the channel info.
-
getEvents
final SharedFlow<ChannelInfoViewEvent> getEvents()
A SharedFlow that emits one-shot events related to channel info, such as errors or success events.
-
onViewAction
final Unit onViewAction(ChannelInfoViewAction action)
Handles actions related to channel information view.
- Parameters:
action- The ChannelInfoViewAction representing the action to be handled.
-
onMemberViewEvent
final Unit onMemberViewEvent(ChannelInfoMemberViewEvent event)
Propagates events from the ChannelInfoMemberViewEvent to the ChannelInfoViewEvent.
-
-
-
-