copyWith method

PaginatedResult copyWith({
  1. ResultMetaObject? meta,
  2. String? nextCursor,
  3. String? resultType,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

PaginatedResult copyWith({
  ResultMetaObject? meta,
  String? nextCursor,
  String? resultType,
}) =>
    PaginatedResult.fromJson({
      ...toJson(),
      if (meta != null) '_meta': $encode(meta),
      if (nextCursor != null) 'nextCursor': $encode(nextCursor),
      if (resultType != null) 'resultType': $encode(resultType),
    });