CockpitPage<T> constructor
Creates a CockpitPage.
Implementation
CockpitPage({required Iterable<T> items, this.nextCursor, this.totalCount})
: items = List<T>.unmodifiable(items) {
if (this.items.length > cockpitFoundationPageSizeMaximum) {
throw const FormatException('Page cannot contain more than 100 items.');
}
if (nextCursor != null) {
CockpitFoundationValueReader.opaqueToken(nextCursor, r'$.nextCursor');
}
if (totalCount != null && totalCount! < this.items.length) {
throw const FormatException('Page totalCount is smaller than items.');
}
}