chat_ui/src/users/users library

Barrel export for users module with Clean Architecture

This file provides a single import point for all users module components. Import this file to access all users-related functionality.

Architecture

The users module uses Clean Architecture with BLoC pattern:

Example usage:

CometChatUsers(
  usersBloc: UsersBloc(),
  onItemTap: (context, user) => print('Tapped: ${user.name}'),
);

Classes

BlockUserUseCase
Use case for blocking a user
ClearUserSelection
Clear all user selections
CometChatUsers
CometChatUsers is a component that displays a list of users using Clean Architecture with BLoC pattern.
CometChatUsersStyle
CometChatUsersStyle is a data class that has styling-related properties to customize the appearance of CometChatUsers
GetLoggedInUserUseCase
Use case for getting the currently logged-in user
GetUsersUseCase
Use case for getting users with pagination and search support
GetUserUseCase
Use case for getting a specific user by UID
LoadMoreUsers
Load more users (pagination)
LoadUsers
Load initial users
RefreshUsers
Refresh users list
SearchUsers
Search users
ToggleUserSelection
Toggle user selection
UIUsersBuilder
UIUsersBuilder is the default UsersBuilderProtocol used when a custom builder protocol is not passed
UnblockUserUseCase
Use case for unblocking a user
UpdateUser
Update a specific user
UsersBloc
BLoC for managing users list
UsersBuilderProtocol
UsersBuilderProtocol is an interface that defines the structure for fetching the users. It provides a generic requestBuilder property and methods getRequest and getSearchRequest that needs to be overridden.
UsersEmpty
Empty state when no users exist
UsersError
Error state with error message and optional previous data
UsersEvent
Base class for all users events Uses Equatable for proper event comparison in BLoC
UsersInitial
Initial state before any data is loaded
UsersList
Internal widget for rendering the users list
UsersLoaded
Loaded state with user data
UsersLoading
Loading state when fetching initial users
UsersLocalDataSource
Abstract interface for users local data source Handles local caching of users
UsersLocalDataSourceImpl
In-memory implementation of UsersLocalDataSource
UsersRemoteDataSource
Abstract interface for users remote data source Handles all interactions with CometChat SDK
UsersRemoteDataSourceImpl
Implementation of UsersRemoteDataSource using CometChat SDK
UsersRepository
Repository interface for users data operations Defines the contract for user data access
UsersRepositoryImpl
Implementation of UsersRepository Coordinates between remote and local data sources
UsersServiceLocator
UsersState
Base class for users states Uses Equatable for proper state comparison in BLoC

Exceptions / Errors

UsersLocalDataSourceException
Exception thrown when local data source operations fail
UsersRemoteDataSourceException
Exception thrown when remote data source operations fail