toJson method

Map<String, Object?> toJson(
  1. Object? encodeItem(
    1. T item
    )
)

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,
    };