copyWith method

JSONRPCErrorResponse copyWith({
  1. ErrorObject? error,
  2. Object? id,
})

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

Implementation

JSONRPCErrorResponse copyWith({
  ErrorObject? error,
  Object? id,
}) =>
    JSONRPCErrorResponse.fromJson({
      ...toJson(),
      if (error != null) 'error': $encode(error),
      if (id != null) 'id': $encode(id),
    });