StreamVisibility enum

Controls the visibility and layout participation of a widget slot.

This is typically used for optional slots (such as leading avatars in a message row) where a theme needs to express whether the widget should be shown, hidden while still reserving space, or removed entirely.

{@tool snippet}

Conditionally hide the avatar in non-bottom stack positions:

StreamMessageItemTheme(
  data: StreamMessageItemThemeData(
    avatarVisibility: StreamMessageLayoutProperty.resolveWith(
      (p) => switch (p.stackPosition) {
        StreamMessageStackPosition.bottom ||
        StreamMessageStackPosition.single => StreamVisibility.visible,
        _ => StreamVisibility.hidden,
      },
    ),
  ),
  child: ...,
)

{@end-tool}

Inheritance
Available extensions

Values

visible → const StreamVisibility

The widget is fully visible and participates in layout.

hidden → const StreamVisibility

The widget is invisible but still occupies its layout space.

gone → const StreamVisibility

The widget is removed from the layout entirely — it takes no space.

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

apply(Widget? child) → Widget?
Applies this visibility to the given child widget.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<StreamVisibility>
A constant List of the values in this enum, in order of their declaration.