UiChatHeader class

WhatsApp-style chat header bar with avatar, name, status, and action icons.

Shows a back arrow, avatar circle with initials, name with subtitle (online status, last seen, or typing indicator), and action buttons for call, video, and more.

UiChatHeader(
  name: 'Alice',
  avatarInitials: 'A',
  isOnline: true,
  onBack: () => Navigator.pop(context),
  onCall: () => startCall(),
  onVideo: () => startVideo(),
  onMore: () => showMenu(),
)
Inheritance

Constructors

UiChatHeader({Key? key, required String name, required String avatarInitials, bool isOnline = false, DateTime? lastSeen, bool isTyping = false, VoidCallback? onBack, VoidCallback? onCall, VoidCallback? onVideo, VoidCallback? onMore})
const

Properties

avatarInitials String
Initials rendered inside the avatar circle.
final
hashCode int
The hash code for this object.
no setterinherited
isOnline bool
Whether the user is currently online.
final
isTyping bool
Whether the other user is currently typing.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lastSeen DateTime?
When the user was last seen. Ignored if isOnline or isTyping.
final
name String
Display name shown in the header.
final
onBack VoidCallback?
Called when the back arrow is tapped.
final
onCall VoidCallback?
Called when the phone icon is tapped.
final
onMore VoidCallback?
Called when the more (3-dots) icon is tapped.
final
onVideo VoidCallback?
Called when the video icon is tapped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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
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