copyWith method

AutoPilotConfig copyWith({
  1. String? baseUrl,
  2. String? tokenType,
  3. int? timeoutSeconds,
  4. bool? enableLogs,
  5. bool? enableCache,
  6. Duration? cacheDuration,
  7. Map<String, String>? globalHeaders,
  8. int? maxRetries,
  9. Duration? retryDelay,
  10. bool? enableTokenRefresh,
  11. Future<String?> onRefreshToken()?,
  12. bool? enableGlobalLoader,
  13. void onLoadingChanged(
    1. bool
    )?,
  14. void onError(
    1. String,
    2. int
    )?,
  15. void onRequestSent(
    1. String,
    2. String
    )?,
  16. void onResponseReceived(
    1. String,
    2. int,
    3. Duration
    )?,
  17. String? successKey,
  18. dynamic successValue,
  19. String? messageKey,
  20. String? dataKey,
  21. bool? enableDeduplication,
  22. bool? printPayload,
  23. bool? prettyPrint,
})

Implementation

AutoPilotConfig copyWith({
  String? baseUrl,
  String? tokenType,
  int? timeoutSeconds,
  bool? enableLogs,
  bool? enableCache,
  Duration? cacheDuration,
  Map<String, String>? globalHeaders,
  int? maxRetries,
  Duration? retryDelay,
  bool? enableTokenRefresh,
  Future<String?> Function()? onRefreshToken,
  bool? enableGlobalLoader,
  void Function(bool)? onLoadingChanged,
  void Function(String, int)? onError,
  void Function(String, String)? onRequestSent,
  void Function(String, int, Duration)? onResponseReceived,
  String? successKey,
  dynamic successValue,
  String? messageKey,
  String? dataKey,
  bool? enableDeduplication,
  bool? printPayload,
  bool? prettyPrint,
}) =>
    AutoPilotConfig(
      baseUrl: baseUrl ?? this.baseUrl,
      tokenType: tokenType ?? this.tokenType,
      timeoutSeconds: timeoutSeconds ?? this.timeoutSeconds,
      enableLogs: enableLogs ?? this.enableLogs,
      enableCache: enableCache ?? this.enableCache,
      cacheDuration: cacheDuration ?? this.cacheDuration,
      globalHeaders: globalHeaders ?? this.globalHeaders,
      maxRetries: maxRetries ?? this.maxRetries,
      retryDelay: retryDelay ?? this.retryDelay,
      enableTokenRefresh: enableTokenRefresh ?? this.enableTokenRefresh,
      onRefreshToken: onRefreshToken ?? this.onRefreshToken,
      enableGlobalLoader: enableGlobalLoader ?? this.enableGlobalLoader,
      onLoadingChanged: onLoadingChanged ?? this.onLoadingChanged,
      onError: onError ?? this.onError,
      onRequestSent: onRequestSent ?? this.onRequestSent,
      onResponseReceived: onResponseReceived ?? this.onResponseReceived,
      successKey: successKey ?? this.successKey,
      successValue: successValue ?? this.successValue,
      messageKey: messageKey ?? this.messageKey,
      dataKey: dataKey ?? this.dataKey,
      enableDeduplication: enableDeduplication ?? this.enableDeduplication,
      printPayload: printPayload ?? this.printPayload,
      prettyPrint: prettyPrint ?? this.prettyPrint,
    );