BlockItemDescriptor class final

Descriptor for configuring block types that can be used within portable text.

Each block type needs:

  • A type descriptor for serialization
  • A builder function to render the block

Example:

final cardBlock = BlockItemDescriptor(
  type: Card.typeDescriptor,
  builder: (context, content) =>
    vyuh.content.buildContent(context, content as Card),
);

Constructors

BlockItemDescriptor.new({required TypeDescriptor<PortableBlockItem> type, required BlockWidgetBuilder builder})

Properties

builder → BlockWidgetBuilder
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type → TypeDescriptor<PortableBlockItem>
final

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