-
public final class ChannelAttachmentsViewControllerController responsible for managing the state and events related to channel attachments.
This controller handles the loading of attachments in a channel, supports pagination, and emits state updates and events for the UI to react to.
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<ChannelAttachmentsViewState>stateprivate final SharedFlow<ChannelAttachmentsViewEvent>events
-
Constructor Summary
Constructors Constructor Description ChannelAttachmentsViewController(String cid, List<String> attachmentTypes, Function1<Attachment, Boolean> localFilter, ChatClient chatClient, CoroutineScope scope)
-
Method Summary
Modifier and Type Method Description final StateFlow<ChannelAttachmentsViewState>getState()The current state of the channel attachments view. final SharedFlow<ChannelAttachmentsViewEvent>getEvents()One shot events triggered by the controller. final UnitonViewAction(ChannelAttachmentsViewAction action)-
-
Constructor Detail
-
ChannelAttachmentsViewController
ChannelAttachmentsViewController(String cid, List<String> attachmentTypes, Function1<Attachment, Boolean> localFilter, ChatClient chatClient, CoroutineScope scope)
- Parameters:
cid- The full channel identifier (e.g., "messaging:123").attachmentTypes- The list of attachment types to filter by.localFilter- A function to filter attachments locally after fetching.chatClient- The ChatClient instance used for interacting with the chat API.scope- The CoroutineScope used for launching coroutines.
-
-
Method Detail
-
getState
final StateFlow<ChannelAttachmentsViewState> getState()
The current state of the channel attachments view.
-
getEvents
final SharedFlow<ChannelAttachmentsViewEvent> getEvents()
One shot events triggered by the controller.
-
onViewAction
final Unit onViewAction(ChannelAttachmentsViewAction action)
-
-
-
-