toJson method

Map<String, dynamic> toJson()

Converts the pagination to a json map

Implementation

Map<String, dynamic> toJson() {
  return when(
    page: (currentPage, perPage, total) => {
      'currentPage': currentPage,
      'perPage': perPage,
      'total': total,
    },
    cursor: (startCursor, endCursor, hasNextPage) => {
      'startCursor': startCursor,
      'endCursor': endCursor,
      'hasNextPage': hasNextPage,
    },
  );
}