CometChatMessageHeader class

CometChatMessageHeader is a widget which shows user/group details using CometChatListItem if its being shown for an User then the name of the user will be in the CometChatListItem.title of CometChatListItem and their online/offline status will be in the subtitleView if its being shown for an Group then the name of the group will be in the CometChatListItem.title of CometChatListItem and their member count will be in the subtitleView

CometChatMessageHeader(
  user: <user>,
  messageHeaderStyle: MessageHeaderStyle(),
);

For Group

CometChatMessageHeader(
  group: <group>,
 messageHeaderStyle: MessageHeaderStyle(),
);

Inheritance
Implemented types

Constructors

CometChatMessageHeader({Key? key, WidgetBuilder? backButton, CometChatMessageHeaderStyle? messageHeaderStyle, Group? group, User? user, List<Widget>? trailingView(User? user, Group? group, BuildContext context)?, Widget listItemView(Group? group, User? user, BuildContext context)?, bool? showBackButton = true, Widget? subtitleView(Group? group, User? user, BuildContext context)?, ListItemStyle? listItemStyle, VoidCallback? onBack, bool? threadSubscriptionVisibility = true, BaseMessage? parentMessage, bool? pinnedMessagesVisibility = true, dynamic onPinnedMessageItemTap(BaseMessage message)?, CometChatPinnedMessagesStyle? pinnedMessagesStyle, VoidCallback? onInfoTap, VoidCallback? onSearchTap, VoidCallback? onHeaderTap, VoidCallback? onPinnedMessagesTap, double? avatarHeight, double? avatarWidth, double? height, EdgeInsetsGeometry? padding, bool? hideVideoCallButton, bool? hideVoiceCallButton, Widget? titleView(Group? group, User? user, BuildContext context)?, Widget? leadingStateView(Group? group, User? user, BuildContext context)?, Widget? auxiliaryButtonView(Group? group, User? user, BuildContext context)?, bool? usersStatusVisibility = true, DateTimeFormatterCallback? dateTimeFormatterCallback, bool? hideNewChatButton, bool? hideChatHistoryButton, VoidCallback? chatHistoryButtonClick, VoidCallback? newChatButtonClick, IconData? newChatIcon, IconData? chatHistoryIcon})
const

Properties

auxiliaryButtonView Widget? Function(Group? group, User? user, BuildContext context)?
auxiliaryButtonView to set auxiliary view
final
avatarHeight double?
avatarHeight set height for avatar
final
avatarWidth double?
avatarWidth set width for avatar
final
backButton WidgetBuilder?
backButton used to set back button widget
final
chatHistoryButtonClick VoidCallback?
chatHistoryButtonClick callback triggered on chat history button click
final
chatHistoryIcon IconData?
chatHistoryIcon provides chat history icon
final
dateTimeFormatterCallback DateTimeFormatterCallback?
dateTimeFormatterCallback is a callback that can be used to format the date and time
final
group Group?
set Group object, one is mandatory either user or group
final
hashCode int
The hash code for this object.
no setterinherited
height double?
height set height for message header
final
hideChatHistoryButton bool?
hideChatHistoryButton is a bool that can be used to hide/display chat history button
final
hideNewChatButton bool?
hideNewChatButton is a bool that can be used to hide/display chat button button
final
hideVideoCallButton bool?
hideVideoCallButton is a bool that can be used to hide/display video call button
final
hideVoiceCallButton bool?
hideVoiceCallButton is a bool that can be used to hide/display voice call button
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leadingStateView Widget? Function(Group? group, User? user, BuildContext context)?
leadingStateView to set leading View
final
listItemStyle ListItemStyle?
listItemStyle style for every list item
final
listItemView Widget Function(Group? group, User? user, BuildContext context)?
listItemView set custom view for listItem
final
messageHeaderStyle CometChatMessageHeaderStyle?
CometChatMessageHeaderStyle set styling props for message header
final
newChatButtonClick VoidCallback?
newChatButtonClick callback triggered on new chat button click
final
newChatIcon IconData?
newChatIcon provides new chat icon
final
onBack VoidCallback?
onBack callback triggered on closing this screen
final
onHeaderTap VoidCallback?
onHeaderTap fires when the avatar/name/subtitle area is tapped — typically wired to open the info screen.
final
onInfoTap VoidCallback?
onInfoTap when set, the header's ⋯ overflow menu carries a "Group Info"/"User Info" entry that invokes it (the host app owns the info screen).
final
onPinnedMessageItemTap → dynamic Function(BaseMessage message)?
onPinnedMessageItemTap forwarded to the pinned-messages screen — fires when a pinned row is tapped (after that screen pops) so the host screen can jump its message list to the tapped message.
final
onPinnedMessagesTap VoidCallback?
onPinnedMessagesTap when set, the ⋯ menu's pinned-messages entry invokes this instead of pushing CometChatPinnedMessages itself — so a host with its own layout (a desktop side panel, say) can decide where the list appears. onPinnedMessageItemTap still forwards row taps when the kit does the presenting.
final
onSearchTap VoidCallback?
onSearchTap when set, the header's ⋯ overflow menu carries a "Search" entry that invokes it.
final
padding EdgeInsetsGeometry?
padding set padding for message header
final
parentMessage BaseMessage?
parentMessage the thread's root message the notification bell acts on. The bell renders only when this is set (and threadSubscriptionVisibility is not false).
final
pinnedMessagesStyle CometChatPinnedMessagesStyle?
pinnedMessagesStyle styling for the pinned-messages screen opened from the header's overflow (⋯) menu.
final
pinnedMessagesVisibility bool?
pinnedMessagesVisibility controls the pinned-messages entry in the header's overflow (⋯) menu, which opens the conversation's CometChatPinnedMessages as a pushed screen. Defaults to visible; the entry additionally requires the server Pin feature flag (CometChat.isPinMessageEnabled) and renders only on a conversation header (never when parentMessage puts the header in thread mode).
final
preferredSize Size
The size this widget would prefer if it were otherwise unconstrained.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showBackButton bool?
showBackButton toggle visibility for back button
final
subtitleView Widget? Function(Group? group, User? user, BuildContext context)?
subtitleView to set subtitle view
final
threadSubscriptionVisibility bool?
threadSubscriptionVisibility controls the thread mute/unmute notification bell rendered in the header's trailing area (pinned right, sized to the back icon) when parentMessage is set. Defaults to visible; the bell additionally requires the thread-subscription feature gate (UIKitSettings.enableThreadSubscription) to be on.
final
titleView Widget? Function(Group? group, User? user, BuildContext context)?
titleView to set to set titleView view
final
trailingView List<Widget>? Function(User? user, Group? group, BuildContext context)?
trailingView set appbar options
final
user User?
set User object, one is mandatory either user or group
final
usersStatusVisibility bool?
usersStatusVisibility controls visibility of status indicator shown if a user is online
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CometChatMessageHeader>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited