Overview
TheCometChatIncomingCall
is a Widget that serves as a visual representation when the user receives an incoming call, such as a voice call or video call, providing options to answer or decline the call.
- Android
- iOS

Usage
Integration
CometChatIncomingCall
being a custom widget, offers versatility in its integration. It can be seamlessly launched via button clicks or any user-triggered action, enhancing the overall user experience and facilitating smoother interactions within the application.
You can launch CometChatIncomingCall
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 CometChatIncomingCall
- Dart
2. Embedding CometChatIncomingCall
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. onAccept
TheonAccept
action is typically triggered when the user clicks on the accept button, initiating a predefined action. However, by implementing the following code snippet, you can easily customize or override this default behavior to suit your specific requirements.
- Dart
2. onDecline
TheonDecline
action is typically triggered when the user clicks on the reject button, initiating a predefined action. However, by implementing the following code snippet, you can easily customize or override this default behavior to suit your specific requirements.
- Dart
3. onError
You can customize this behavior by using the provided code snippet to override theonError
and improve error handling.
- Dart
Filters
Filters allow you to customize the data displayed in a list within a Widget. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders of Chat SDK. TheCometChatIncomingCall
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 CometChatIncomingCall
widget does not have any exposed events.
Customization
To fit your app’s design requirements, you can customize the appearance of the conversation 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.1. IncomingCall Style
You can customize the appearance of theCometChatIncomingCall
Widget by applying the IncomingCallStyle
to it using the following code snippet.
Here is the complete example for reference:
- Dart
- Android
- iOS

Property | Description | Code |
---|---|---|
Accept Button Text Style | Sets the text style for the accept button. | acceptButtonTextStyle: TextStyle? |
Background | Sets the background color of the incoming call style. | background: Color? |
Border | Sets the border properties of the incoming call style. | border: BoxBorder? |
Border Radius | Sets the border radius of the incoming call style. | borderRadius: double? |
Decline Button Text Style | Sets the text style for the decline button. | declineButtonTextStyle: TextStyle? |
Gradient | Sets the gradient applied to the incoming call style. | gradient: Gradient? |
Height | Sets the height of the incoming call style. | height: double? |
Width | Sets the width of the incoming call style. | width: double? |
2. Avatar Styles
To apply customized styles to theAvatar
widget in the CometChatIncomingCall
Widget, you can use the following code snippet. For further insights on Avatar
Styles refer
Example
Here is the complete example for reference:
- Dart
3. DeclineButton Style
You can customize the appearance of the Decline Button Widget by applying thedeclineButtonStyle
to it using the following code snippet.
Example
Here is the complete example for reference:
- Dart
4. AcceptButton Style
You can customize the appearance of the Accept Button Widget by applying theacceptButtonStyle
to it using the following code snippet.
Example
Here is the complete example for reference:
- Dart
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. Example In this example, we’re enhancing the interface by customizing the accept and decline button icons. By setting custom icons for both the accept and decline buttons, users can enjoy a more visually appealing and personalized experience. This level of customization allows developers to tailor the user interface to match the overall theme and branding of their application. Here is the complete example for reference:- Dart
- Android
- iOS

Property | Description | Code |
---|---|---|
Accept Button Icon Url | Sets the URL for the accept button icon. | acceptButtonIconUrl: String? |
Accept Button Text | Sets the text for the accept button. | acceptButtonText: String? |
Custom Sound For Calls | Sets the custom sound for incoming calls. | customSoundForCalls: String? |
Decline Button Icon Url | Sets the URL for the decline button icon. | declineButtonIconUrl: String? |
Decline Button Icon Url Package | Sets the package for the decline button icon URL. | declineButtonIconUrlPackage: String? |
Decline Button Text | Sets the text for the decline button. | declineButtonText: String? |
Disable Sound For Calls | Disables sound for incoming calls. | disableSoundForCalls: bool? |
Subtitle | Sets the subtitle for the incoming call screen. | subtitle: String? |
Advanced
For advanced-level customization, you can set custom widget to the widget. This lets you tailor each aspect of the widget to fit your exact needs and application aesthetics. You can create and define your widget, layouts, and UI elements and then incorporate those into the widget. TheCometChatIncomingCall
widget does not provide additional functionalities beyond this level of customization.