copyWith method

ApiRequest<ResponseType, InnerType> copyWith({
  1. String? method,
  2. String? path,
  3. String? dataKey,
  4. String? baseUrl,
  5. bool? hasPagination,
  6. Pagination? pagination,
  7. List<Extra>? extra,
  8. int? timeout,
  9. bool? isMultipart,
  10. Map<String, dynamic>? body,
  11. Map<String, String>? headers,
  12. List<ApiInterceptor>? interceptors,
  13. ErrorDescription? error,
  14. String? nestedKey,
  15. Map<String, dynamic>? query,
})

Implementation

ApiRequest<ResponseType, InnerType> copyWith(
        {String? method,
        String? path,
        String? dataKey,
        String? baseUrl,
        bool? hasPagination,
        Pagination? pagination,
        List<Extra>? extra,
        int? timeout,
        bool? isMultipart,
        Map<String, dynamic>? body,
        Map<String, String>? headers,
        List<ApiInterceptor>? interceptors,
        ErrorDescription? error,
        String? nestedKey,
        Map<String, dynamic>? query}) =>
    ApiRequest<ResponseType, InnerType>(
        requestId: requestId,
        hasPagination: hasPagination ?? this.hasPagination,
        headers: headers ?? this.headers,
        query: query ?? this.query,
        method: method ?? this.method,
        dataKey: dataKey ?? this.dataKey,
        nestedKey: nestedKey ?? this.nestedKey,
        isMultipart: isMultipart ?? this.isMultipart,
        path: path ?? this.path,
        extra: extra ?? this.extra,
        error: error ?? this.error,
        timeout: timeout ?? this.timeout,
        baseUrl: baseUrl ?? this.baseUrl,
        interceptors: [...?interceptors, ...this.interceptors],
        body: body ?? this.body);