RichBlock.pre constructor

const RichBlock.pre({
  1. @JsonKey.new(name: 'type') @Default.new(RichBlockType.pre) RichBlockType type,
  2. @JsonKey.new(name: 'text') @RichTextConverter() required RichText text,
  3. @JsonKey.new(name: 'language') String? language,
})

A preformatted text block, corresponding to the nested HTML tags <pre> and <code>.

Implementation

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

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

  /// Optional. The programming language of the text
  @JsonKey(name: 'language') String? language,
}) = RichBlockPreformatted;