Overview
TheCometChatReactions
widget provides a visual representation of emoji reactions associated with a specific message. It enables users to quickly identify which emojis were used to react to the message and by whom.
- Android
- iOS

Usage
Integration
The following code snippet illustrates how you can directly incorporate the Reactions widget into your app. You can launchCometChatReactions
directly using Navigator.push
, or you can define it as a widget within the build
method of your State
class.
1. Using Navigator to Launch CometChatReactions
- Dart
2. Embedding CometChatReactions
as a Widget in the build Method
- Dart
Actions
Actions dictate how a widget functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the widget to fit your specific needs.1. onReactionTap
onReactionTap
is triggered when you click on each Reaction in the footer view of message bubble. You can override this action using the following code snippet.
- Dart
2. onReactionLongPress
onReactionLongPress
is triggered when you long press on Reaction in the footer view of message bubble. You can override this action using the following code snippet.
- Dart
Filters
Filters allow you to customize the data displayed in a list within aWidget
. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders
of Chat SDK.
The CometChatReactions
widget does not have any exposed filters.
Events
Events are emitted by aWidget
. 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.
The CometChatReactions
widget does not produce any events.
Customization
To fit your app’s design requirements, you can customize the appearance of the Reaction widget. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.Style
Using Style you can customize the look and feel of the widget in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the widget.reactionsStyle
To customize the appearance, you can assign areactionsStyle
object to the CometChatReactions
widget.
- Dart
- Android
- iOS

ReactionsStyle
Property | Description | Code |
---|---|---|
reactionTextStyle | The text style for the reaction text. | TextStyle? reactionTextStyle |
reactionCountTextStyle | The text style for the reaction count. | TextStyle? reactionCountTextStyle |
primaryBackgroundColor | The primary background color. | Color? primaryBackgroundColor |
primaryBorder | The primary border style. | BoxBorder? primaryBorder |
margin | The margin for the reactions. | EdgeInsetsGeometry? margin |
padding | The padding for the reactions. | EdgeInsetsGeometry? padding |
width | The width of the reactions container. | double? width |
height | The height of the reactions container. | double? height |
background | The background color of the reactions container. | Color? background |
gradient | The gradient for the background of the reactions container. | Gradient? gradient |
border | The border of the reactions container. | BoxBorder? border |
borderRadius | The border radius of the reactions container. | double? borderRadius |
Functionality
These are a set of small functional customizations that allow you to fine-tune the overall experience of the widget. With these, you can change text, set custom icons, and toggle the visibility of UI elements.- Dart
- Android
- iOS

Property | Description | Code |
---|---|---|
reactionList | The list of reactions to display. | List<Reaction> reactionList |
theme | The theme for styling the reactions. | ThemeData? theme |
alignment | The alignment of the reactions within the container. | Alignment? alignment |