StreamAvatarGroup class

A widget that displays multiple avatars in a grid layout.

StreamAvatarGroup arranges avatars in a 2x2 grid pattern, typically used for displaying group channel participants. It supports two sizes and automatically handles overflow with a StreamBadgeCount indicator.

The avatar automatically handles:

  • Grid layout for up to 4 avatars
  • Overflow indicator using StreamBadgeCount for additional participants
  • Consistent sizing across all child avatars

{@tool snippet}

Basic usage with avatars:

StreamAvatarGroup(
  children: [
    StreamAvatar(placeholder: (context) => Text('A')),
    StreamAvatar(placeholder: (context) => Text('B')),
    StreamAvatar(placeholder: (context) => Text('C')),
    StreamAvatar(placeholder: (context) => Text('D')),
  ],
)

{@end-tool}

{@tool snippet}

With custom size:

StreamAvatarGroup(
  size: StreamAvatarGroupSize.xl,
  children: [
    StreamAvatar(placeholder: (context) => Text('A')),
    StreamAvatar(placeholder: (context) => Text('B')),
  ],
)

{@end-tool}

Theming

StreamAvatarGroup uses StreamAvatarThemeData for styling the child avatars. Colors are inherited from the theme or can be customized per-avatar.

See also:

Inheritance

Constructors

StreamAvatarGroup({Key? key, StreamAvatarGroupSize? size, required Iterable<Widget> children})
Creates a Stream avatar group.

Properties

hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
props StreamAvatarGroupProps
The properties that configure this avatar group.
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