DocumentView constructor

DocumentView({
  1. String? title,
  2. ObjectReference? reference,
  3. DocumentLoadStrategy loadStrategy = DocumentLoadStrategy.reference,
  4. List<ContentItem> items = const [],
  5. required QueryConfiguration? query,
  6. LayoutConfiguration<ContentItem>? layout,
  7. List<ContentModifierConfiguration>? modifiers,
})

Implementation

DocumentView({
  this.title,
  this.reference,
  this.loadStrategy = DocumentLoadStrategy.reference,
  this.items = const [],
  required this.query,
  super.layout,
  super.modifiers,
}) : super(schemaType: schemaName) {
  if (loadStrategy == DocumentLoadStrategy.reference) {
    assert(reference != null,
        'A document-reference is required when the loadStrategy is set to "reference"');
  }

  if (loadStrategy == DocumentLoadStrategy.query) {
    assert(query != null,
        'A query-configuration is required when the loadStrategy is set to "query"');
  }

  assert(items.isNotEmpty, 'There has to be at least one section to render.');
}