Group class

A group content item that can contain and organize multiple content items.

Groups can:

  • Display a collection of content items in various layouts
  • Have an optional title and description
  • Be used inside portable text blocks
  • Support different layouts (grid, list, carousel)

Example:

final group = Group(
  title: 'My Collection',
  description: 'A collection of cards',
  items: [
    Card(title: 'First Card', description: 'Card 1'),
    Card(title: 'Second Card', description: 'Card 2'),
  ],
  layout: GridGroupLayout(columns: 2),
);

Groups can be used:

  • To organize related content items
  • Create grid or list layouts
  • Build carousels or slideshows
  • Inside portable text blocks
Inheritance
Annotations
  • @JsonSerializable()

Constructors

Group.new({String? title, String? description, required List<ContentItem> items, LayoutConfiguration<ContentItem>? layout, List<ContentModifierConfiguration>? modifiers})
Group.fromJson(Map<String, dynamic> json)
factory

Properties

blockType String
A unique string-name for the block type.
no setteroverride
description String?
final
hashCode int
The hash code for this object.
no setterinherited
items List<ContentItem>
final
layout → LayoutConfiguration<ContentItem>?
The layout configuration for the content item.
finalinherited
modifiers List<ContentModifierConfiguration>?
finalinherited
parent ↔ ContentItem?
The parent content item of this content item. This is used internally by the content system.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schemaType String
The schema type of the content item.
finalinherited
title String?
final

Methods

getLayout() → LayoutConfiguration<ContentItem>?
Gets the layout to use for the ContentItem. By default its the layout itself. However this acts as an extension point for custom ContentItems that may have a different strategy for applying layouts.
inherited
getModifiers() List<ContentModifierConfiguration>?
Gets the modifiers to use for the ContentItem. By default its the modifiers itself. However this acts as an extension point for custom ContentItems that may have a different strategy for applying modifiers.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setParent(Iterable<ContentItem?> children) → void
Sets the parent content item for the given list of children.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

contentBuilder → ContentBuilder<Group>
final
typeDescriptor → TypeDescriptor<Group>
final

Constants

schemaName → const String