CometChatUsers
is a Widget, showcasing an accessible list of all available users. It provides an integral search functionality, allowing you to locate any specific user swiftly and easily. For each user listed, the widget displays the user’s name by default, in conjunction with their avatar when available. Furthermore, it includes a status indicator, visually informing you whether a user is currently online or offline.
CometChatUsers
widget is composed of the following Base Widgets:
Widgets | Description |
---|---|
ListBase | a reusable container widget having title, search box, customisable background and a List View |
ListItem | a widget that renders data obtained from a User object on a Tile having a title, subtitle, leading and trailing view |
CometChatUsers
is a custom widget, it can be launched directly by user actions such as button clicks or other interactions. It’s also possible to integrate it into a tab widget. CometChatUsers
offers several parameters and methods for UI customization.
You can launch CometChatUsers
directly using Navigator.push
, or you can define it as a widget within the build
method of your State
class.
CometChatUsers
CometChatUsers
as a Widget in the build MethodonSelection
event is triggered, it furnishes the list of selected users. This event can be invoked by any button or action within the interface. You have the flexibility to implement custom actions or behaviors based on the selected users.
This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
onItemTap
method is used to override the onClick behavior in CometChatUsers
. This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
CometChatUsers
by utilizing the onBack
, providing customization options for handling the back action.
By default, this action has a predefined behavior: it simply dismisses the current widget. However, the flexibility of CometChat UI Kit allows you to override this standard behavior according to your application’s specific requirements. You can define a custom action that will be performed instead when the back button is pressed.
onError
, allows users to override error handling within CometChatUsers
, providing greater control over error responses and actions.
onItemLongPress
, empowers users to customize long-click actions within CometChatUsers
, offering enhanced functionality and interaction possibilities.
CometChatUsers
Widget. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
To handle events supported by Users you have to add corresponding listeners by using CometChatUserEvents
Events | Description |
---|---|
ccUserBlocked | This will get triggered when the logged in user blocks another user |
ccUserUnblocked | This will get triggered when the logged in user unblocks another user |
CometChatUsers
widget. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.
UsersStyle
to the CometChatUsers
widget to customize the styling.
Property | Data Type | Description |
---|---|---|
titleStyle | TextStyle? | Text style for the title within the CometChatUsers widget. |
backIconTint | Color? | Tint color for the back icon. |
searchBorderColor | Color? | Border color for the search input box. |
searchBackground | Color? | Background color for the search input box. |
searchBorderRadius | BorderRadius? | Border radius for the search input box. |
searchIconTint | Color? | Tint color for the search icon. |
searchBorderWidth | double? | Border width for the search input box. |
searchPlaceholderStyle | TextStyle? | Text style for the placeholder text in the search input box. |
searchTextStyle | TextStyle? | Text style for the search input text. |
loadingIconTint | Color? | Tint color for the loading icon. |
emptyTextStyle | TextStyle? | Text style for the empty state text. |
errorTextStyle | TextStyle? | Text style for the error state text. |
sectionHeaderTextStyle | TextStyle? | Text style for the section headers. |
onlineStatusColor | Color? | Color indicating the online status of users. |
separatorColor | Color? | Color of the separators between list items. |
selectionIconTint | Color? | Tint color for the selection icon. |
submitIconTint | Color? | Tint color for the submit icon. |
width | double? | Width of the CometChatUsers widget. |
height | double? | Height of the CometChatUsers widget. |
background | Color? or Gradient? | Background color or gradient of the CometChatUsers widget. |
border | Border? | Border of the CometChatUsers widget. |
borderRadius | BorderRadius? | Border radius of the CometChatUsers widget. |
gradient | Gradient? | Gradient background of the CometChatUsers widget. |
Avatar
widget in the CometChatUsers
widget, you can use the following code snippet. For further insights on Avatar
Styles refer
CometChatUsers
widget, You can use the following code snippet. For further insights on Status Indicator Styles refer
CometChatUsers
Property | Data Type | Description |
---|---|---|
hideSeparator | bool | Flag indicating whether to hide separators between list items. |
theme | Theme? | Theme object for customizing the appearance of the widget. |
searchPlaceholder | String? | Placeholder text for the search input box. |
backButton | Widget? | Widget for the back button in the app bar. |
showBackButton | bool | Flag indicating whether to show the back button in the app bar. |
searchBoxIcon | Widget? | Widget for the search box icon. |
hideSearch | bool | Flag indicating whether to hide the search input box. |
title | String? | Title of the widget or widget. |
errorStateText | String? | Text to display in the error state view. |
emptyStateText | String? | Text to display in the empty state view. |
hideError | bool | Flag indicating whether to hide the error state view. |
hideSectionSeparator | bool | Flag indicating whether to hide separators between sections in the list. |
disableUsersPresence | bool | Flag indicating whether to disable users’ presence status indicators. |
selectionIcon | Widget? | Widget for displaying the selection icon in the app bar. |
submitIcon | Widget? | Widget for displaying the submit icon in the app bar. |
hideAppbar | bool | Flag indicating whether to hide the app bar. |
CometChatUsers
Widget.
EmptyStateView
using setEmptyStateView
to match the empty view of your app.
ErrorStateView
using setErrorStateView
to match the error view of your app.
loadingStateView
to match the loading UI of your app.