StreamAvatarStack class
A widget that displays a stack of StreamAvatar widgets with overlap.
This is useful for showing multiple participants in a chat, group, or team.
The size, overlap, and max can be customized.
{@tool snippet}
Basic usage with default size and overlap:
StreamAvatarStack(
children: [
StreamAvatar(placeholder: (context) => Text('A')),
StreamAvatar(placeholder: (context) => Text('B')),
StreamAvatar(placeholder: (context) => Text('C')),
],
)
{@end-tool}
{@tool snippet}
With max limit showing overflow badge:
StreamAvatarStack(
max: 3,
children: [
StreamAvatar(placeholder: (context) => Text('A')),
StreamAvatar(placeholder: (context) => Text('B')),
StreamAvatar(placeholder: (context) => Text('C')),
StreamAvatar(placeholder: (context) => Text('D')),
StreamAvatar(placeholder: (context) => Text('E')),
],
)
// Shows: [A] [B] [C] [StreamBadgeCount with +2]
{@end-tool}
{@tool snippet}
Custom size and overlap:
StreamAvatarStack(
size: StreamAvatarStackSize.sm,
overlap: 0.5, // 50% overlap
children: [
StreamAvatar(placeholder: (context) => Text('A')),
StreamAvatar(placeholder: (context) => Text('B')),
StreamAvatar(placeholder: (context) => Text('C')),
],
)
{@end-tool}
See also:
- StreamAvatarStackSize, which defines the available size variants.
- StreamAvatar, the individual avatar widget.
- StreamBadgeCount, used for the overflow indicator.
- StreamAvatarThemeData, for customizing avatar theme properties.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- StreamAvatarStack
Constructors
-
StreamAvatarStack({Key? key, StreamAvatarStackSize? size, required Iterable<
Widget> children, double overlap = 0.33, int max = 5, bool isFloating = false, String? semanticsLabel}) - Creates a StreamAvatarStack with the given children.
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 → StreamAvatarStackProps
-
The properties that configure this avatar stack.
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