DocumentView constructor
DocumentView({
- String? title,
- ObjectReference? reference,
- DocumentLoadStrategy loadStrategy = DocumentLoadStrategy.reference,
- List<
ContentItem> items = const [], - required QueryConfiguration? query,
- LayoutConfiguration<
ContentItem> ? layout,
Implementation
DocumentView({
this.title,
this.reference,
this.loadStrategy = DocumentLoadStrategy.reference,
this.items = const [],
required this.query,
super.layout,
}) : 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.');
}