copyWith<NewBodyType> method
Response<NewBodyType>
copyWith<NewBodyType>({
- BaseResponse? base,
- NewBodyType? body,
- Object? bodyError,
Makes a copy of this Response, replacing original values with the given ones. This method can also alter the type of the response body.
Implementation
Response<NewBodyType> copyWith<NewBodyType>({
http.BaseResponse? base,
NewBodyType? body,
Object? bodyError,
}) =>
Response<NewBodyType>(
base ?? this.base,
body ?? (this.body as NewBodyType?),
error: bodyError ?? error,
);