Content constructor

const Content({
  1. required ContentfulContentNodeType nodeType,
  2. ContentfulContentNodeType? parentNodeType,
  3. Data? data,
  4. @JsonKey(name: 'content') List<Content>? subContent,
  5. List<ContentfulTextMark>? marks,
  6. String? value,
})

Content is usually non null when we have a node type of document or paragraph. It contains a list of paragraph contents. And if it is a document it contains a list of different node types.

Implementation

const factory Content({
  required ContentfulContentNodeType nodeType,
  ContentfulContentNodeType? parentNodeType,
  Data? data,
  // ignore: invalid_annotation_target
  @JsonKey(name: 'content') List<Content>? subContent,
  List<ContentfulTextMark>? marks,

  /// value will be not null if we have a text
  String? value,
}) = _Content;