copyWith method

JSONRPCResultResponse copyWith({
  1. Object? id,
  2. McpResult? result,
})

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

Implementation

JSONRPCResultResponse copyWith({
  Object? id,
  McpResult? result,
}) =>
    JSONRPCResultResponse.fromJson({
      ...toJson(),
      if (id != null) 'id': $encode(id),
      if (result != null) 'result': $encode(result),
    });