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 title of CometChatListItem and their online/offline status will be in the subtitle if its being shown for an Group then the name of the group will be in the title of CometChatListItem and their member count will be in the subtitle

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

For Group

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

Inheritance
Implemented types

Constructors

CometChatMessageHeader({Key? key, WidgetBuilder? backButton, MessageHeaderStyle messageHeaderStyle = const MessageHeaderStyle(), Group? group, User? user, List<Widget>? appBarOptions(User? user, Group? group, BuildContext context)?, Widget listItemView(Group? group, User? user, BuildContext context)?, bool? hideBackButton = true, bool? disableUserPresence, Widget? privateGroupIcon, Widget? protectedGroupIcon, Widget? subtitleView(Group? group, User? user, BuildContext context)?, Widget? chatMessagesHeader({String? avatarUrl, String? groupRef, bool? isGroup, bool? isTyping, bool? online, String? subtitle, required String title, bool? userIsNotBlocked})?, CometChatTheme? theme, AvatarStyle? avatarStyle, StatusIndicatorStyle? statusIndicatorStyle, ListItemStyle? listItemStyle, Widget? chatAvatar({String? name, required bool online, Color? rimColor, double? size, required String url})?, bool disableTyping = false, VoidCallback? onBack})
const

Properties

appBarOptions List<Widget>? Function(User? user, Group? group, BuildContext context)?
appBarOptions set appbar options
final
avatarStyle AvatarStyle?
avatarStyle set style for avatar
final
backButton WidgetBuilder?
backButton used to set back button widget
final
chatAvatar Widget? Function({String? name, required bool online, Color? rimColor, double? size, required String url})?
custom
final
chatMessagesHeader Widget? Function({String? avatarUrl, String? groupRef, bool? isGroup, bool? isTyping, bool? online, String? subtitle, required String title, bool? userIsNotBlocked})?
final
disableTyping bool
disableTyping flag to disable typing indicators, default false
final
disableUserPresence bool?
disableUserPresence toggle functionality to show user's presence
final
group Group?
set Group object, one is mandatory either user or group
final
hashCode int
The hash code for this object.
no setterinherited
hideBackButton bool?
hideBackButton toggle visibility for back button
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
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 MessageHeaderStyle
MessageHeaderStyle set styling props for message header
final
onBack VoidCallback?
onBack callback triggered on closing this screen
final
preferredHeight double
no setter
preferredSize Size
The size this widget would prefer if it were otherwise unconstrained.
no setteroverride
privateGroupIcon Widget?
privateGroupIcon group icon to be shown for protected groups
final
protectedGroupIcon Widget?
protectedGroupIcon group icon to be shown for protected groups
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusIndicatorStyle StatusIndicatorStyle?
statusIndicatorStyle set style for status indicator
final
subtitleView Widget? Function(Group? group, User? user, BuildContext context)?
subtitleView to set subtitle view
final
theme CometChatTheme?
theme set custom theme
final
user User?
set User object, one is mandatory either user or group
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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
getBackButton(BuildContext context, CometChatTheme theme) Widget
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