toJson method
Encodes this CockpitPage as a JSON object.
Implementation
Map<String, Object?> toJson(Object? Function(T item) encodeItem) =>
<String, Object?>{
'items': items.map(encodeItem).toList(),
if (nextCursor != null) 'nextCursor': nextCursor,
if (totalCount != null) 'totalCount': totalCount,
};