chat_ui/src/conversations/bloc/bloc library

BLoC for conversations list

Classes

ClearConversationSelection
Clear all conversation selections
ConversationsBloc
BLoC for managing conversations list
ConversationsEmpty
Empty state when no conversations exist
ConversationsError
Error state with error message and optional previous data
ConversationsEvent
Base class for all conversations events Uses Equatable for proper event comparison in BLoC
ConversationsInitial
Initial state before any data is loaded
ConversationsLoaded
Loaded state with conversation data
ConversationsLoading
Loading state when fetching initial conversations
ConversationsLocalDataSource
Abstract interface for conversations local data source Handles local caching of conversation data
ConversationsLocalDataSourceImpl
Implementation of ConversationsLocalDataSource using in-memory cache In a production app, this could use SharedPreferences, Hive, or SQLite
ConversationsRemoteDataSource
Abstract interface for conversations remote data source Handles all interactions with CometChat SDK
ConversationsRemoteDataSourceImpl
Implementation of ConversationsRemoteDataSource using CometChat SDK
ConversationsRepository
Repository interface for conversations data operations Defines the contract for conversation data access
ConversationsRepositoryImpl
Implementation of ConversationsRepository Coordinates between remote and local data sources
ConversationsServiceLocator
Service Locator for Conversations module Provides dependency injection for conversations clean architecture Follows singleton pattern for consistent dependency resolution
ConversationsState
Base class for conversations states Uses Equatable for proper state comparison in BLoC
DeleteConversation
Delete conversation action (calls SDK to delete)
DeleteConversationUseCase
Use case for deleting a conversation Handles business logic for conversation deletion
GetConversationsUseCase
Use case for getting conversations with pagination support Handles business logic for fetching conversation lists
GetConversationUseCase
Use case for getting a single conversation Handles business logic for fetching conversation details
GetLoggedInUserUseCase
Use case for getting the currently logged-in user Handles business logic for user retrieval
LoadConversations
Load initial conversations
LoadMoreConversations
Load more conversations (pagination)
LoadMoreConversationsUseCase
Use case for loading more conversations with pagination support Handles business logic for fetching additional conversation pages
MarkAsDeliveredUseCase
Use case for marking a message as delivered Handles business logic for delivery receipts
RefreshConversations
Refresh conversations list
RemoveConversation
Remove conversation from list without calling SDK Use this for events like group left/kicked where SDK already removed the user
ResetUnreadCount
Reset unread count for a conversation Use this when the user reads messages in a conversation
SetActiveConversation
Set active conversation (when user opens a chat)
ToggleConversationSelection
Toggle conversation selection
UpdateConversation
Update a specific conversation with modified data Use this when the SDK or list item callback provides an updated conversation object with changed properties (including custom properties not tracked by the BLoC)

Exceptions / Errors

LocalDataSourceException
Exception thrown when local data source operations fail
RemoteDataSourceException
Exception thrown when remote data source operations fail