CometChatMessageHeader
is a Widget that showcases the User or Group details in the toolbar. Furthermore, it also presents a typing indicator and a back navigation button for ease of use.
CometChatMessageHeader
is comprised of the following components:
Components | Description |
---|---|
ListItem Widget | This component’s widget consists of avatar, status indicator , title, and subtitle. The fields are then mapped with the SDK’s user, group class. |
Back Button | BackButton that allows users to navigate back from the current activity or screen to the previous one |
CometChatMessageHeader
directly using Navigator.push
, or you can define it as a widget within the build
method of your State
class.
CometChatMessageHeader
CometChatMessageHeader
as a Widget in the build MethodonBack
feature. This capability allows you to customize the behavior associated with navigating back within your app. Utilize the provided code snippet to override default behaviors and tailor the user experience according to your specific requirements.
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.
The CometChatMessageHeader
widget does not have any exposed filters.
CometChatMessageHeaderStyle
object to the CometChatMessageHeader
widget.
Property | Data Type | Description |
---|---|---|
backButton | WidgetBuilder? | Used to set the back button widget. |
subtitleView | Widget? Function(Group? group, User? user, BuildContext context)? | To set subtitle view for the group or user. |
user | User? | Set User object, one is mandatory either user or group . |
group | Group? | Set Group object, one is mandatory either user or group . |
listItemView | Widget Function(Group? group, User? user, BuildContext context)? | Set custom view for list item. |
messageHeaderStyle | CometChatMessageHeaderStyle? | Set styling props for message header. |
listItemStyle | ListItemStyle? | Style for every list item. |
trailingView | List<Widget>? Function(User? user, Group? group, BuildContext context)? | Set appbar options for the trailing view. |
onBack | VoidCallback? | Callback triggered on closing the screen. |
avatarHeight | double? | Set height for avatar. |
avatarWidth | double? | Set width for avatar. |
height | double? | Set height for message header. |
padding | EdgeInsetsGeometry? | Set padding for message header. |
showVideoCallButton | bool? | Used to hide/display video call button. |
showVoiceCallButton | bool? | Used to hide/display voice call button. |
leadingStateView | Widget? Function(Group? group, User? user, BuildContext context)? | To set leading view for the message header. |
titleView | Widget? Function(Group? group, User? user, BuildContext context)? | To set the title view for the message header. |
auxiliaryButtonView | Widget? Function(Group? group, User? user, BuildContext context)? | To set auxiliary view for the message header. |
CometChatMessageHeader
widget consists of a ListItemView
. You can customize the ListItem according to your requirements by using the .setListItemView
method.
trailingView
to the CometChatMessageHeader
widget.
.backButton
method.