RichBlock.heading constructor

const RichBlock.heading({
  1. @JsonKey.new(name: 'type') @Default.new(RichBlockType.heading) RichBlockType type,
  2. @JsonKey.new(name: 'text') @RichTextConverter() required RichText text,
  3. @JsonKey.new(name: 'size') required int size,
})

A section heading, corresponding to the HTML tags <h1>, <h2>, <h3>, <h4>, <h5>, or <h6>.

Implementation

const factory RichBlock.heading({
  /// Type of the block, always "heading"
  @JsonKey(name: 'type') @Default(RichBlockType.heading) RichBlockType type,

  /// Text of the block
  @JsonKey(name: 'text') @RichTextConverter() required RichText text,

  /// Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest
  @JsonKey(name: 'size') required int size,
}) = RichBlockSectionHeading;