AudioGridOptions class

Configuration options for the AudioGrid widget.

Provides properties to customize a Stack-based layout for audio-only participant cards, allowing multiple AudioCard widgets to be layered with configurable alignment and clipping.

Core Properties:

  • componentsToRender: List of widgets to stack (typically AudioCard components)
  • alignment: Stack alignment (default: AlignmentDirectional.topStart)
  • clipBehavior: How to clip overflowing content (default: Clip.hardEdge)

Builder Hooks (2):

  • itemBuilder: Override individual items before adding to Stack; receives AudioGridItemContext + default
  • containerBuilder: Override entire Stack; receives AudioGridContainerContext + default

Usage Patterns:

  1. Basic Audio Grid:

    AudioGrid(
      options: AudioGridOptions(
        componentsToRender: audioParticipants.map((p) => AudioCard(
          options: AudioCardOptions(
            name: p.name,
            participant: p,
            parameters: parameters,
            customStyle: BoxDecoration(color: Colors.grey[800]),
          ),
        )).toList(),
      ),
    )
    
  2. Centered Alignment:

    AudioGrid(
      options: AudioGridOptions(
        componentsToRender: audioCards,
        alignment: Alignment.center,
      ),
    )
    
  3. Custom Item Wrapper:

    AudioGrid(
      options: AudioGridOptions(
        componentsToRender: audioCards,
        itemBuilder: (context) {
          return Padding(
            padding: EdgeInsets.all(8),
            child: context.defaultItem,
          );
        },
      ),
    )
    
  4. Custom Container:

    AudioGrid(
      options: AudioGridOptions(
        componentsToRender: audioCards,
        containerBuilder: (context) {
          return Container(
            decoration: BoxDecoration(color: Colors.black87),
            child: context.defaultContainer,
          );
        },
      ),
    )
    

Override Integration: Can be overridden via MediasfuUICustomOverrides:

overrides: MediasfuUICustomOverrides(
  audioGridOptions: ComponentOverride<AudioGridOptions>(
    builder: (existingOptions) => AudioGridOptions(
      componentsToRender: existingOptions.componentsToRender,
      alignment: Alignment.topCenter,
      clipBehavior: Clip.antiAlias,
    ),
  ),
),

Stack Behavior:

  • All components rendered in single Stack (overlapping layout)
  • Order: first component in list = bottom layer, last = top layer
  • Alignment affects positioning of each child within Stack bounds
  • Typically used when audio-only participants need visual representation

Implementation Notes:

  • Uses Stack widget for layering (not Grid/GridView)
  • No automatic sizing or spacing (Stack fills available space)
  • clipBehavior prevents overflow outside Stack bounds
  • Builder hooks called for each item during build

Constructors

AudioGridOptions({required List<Widget> componentsToRender, AlignmentGeometry alignment = AlignmentDirectional.topStart, Clip clipBehavior = Clip.hardEdge, AudioGridItemBuilder? itemBuilder, AudioGridContainerBuilder? containerBuilder})

Properties

alignment AlignmentGeometry
final
clipBehavior Clip
final
componentsToRender List<Widget>
final
containerBuilder AudioGridContainerBuilder?
final
hashCode int
The hash code for this object.
no setterinherited
itemBuilder AudioGridItemBuilder?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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