AutoPilotConfig constructor

const AutoPilotConfig({
  1. required String baseUrl,
  2. String tokenType = 'Bearer',
  3. int timeoutSeconds = 30,
  4. bool enableLogs = kDebugMode,
  5. bool enableCache = false,
  6. Duration cacheDuration = const Duration(minutes: 5),
  7. Map<String, String> globalHeaders = const {},
  8. int maxRetries = 3,
  9. Duration retryDelay = const Duration(seconds: 1),
  10. bool enableTokenRefresh = false,
  11. Future<String?> onRefreshToken()?,
  12. bool enableGlobalLoader = false,
  13. void onLoadingChanged(
    1. bool loading
    )?,
  14. void onError(
    1. String message,
    2. int statusCode
    )?,
  15. void onRequestSent(
    1. String url,
    2. String method
    )?,
  16. void onResponseReceived(
    1. String url,
    2. int statusCode,
    3. Duration time
    )?,
  17. String successKey = 'status',
  18. dynamic successValue = true,
  19. String messageKey = 'message',
  20. String dataKey = 'data',
  21. bool enableDeduplication = true,
  22. bool printPayload = true,
  23. bool prettyPrint = true,
})

Implementation

const AutoPilotConfig({
  required this.baseUrl,
  this.tokenType = 'Bearer',
  this.timeoutSeconds = 30,
  this.enableLogs = kDebugMode,
  this.enableCache = false,
  this.cacheDuration = const Duration(minutes: 5),
  this.globalHeaders = const {},
  this.maxRetries = 3,
  this.retryDelay = const Duration(seconds: 1),
  this.enableTokenRefresh = false,
  this.onRefreshToken,
  this.enableGlobalLoader = false,
  this.onLoadingChanged,
  this.onError,
  this.onRequestSent,
  this.onResponseReceived,
  this.successKey = 'status',
  this.successValue = true,
  this.messageKey = 'message',
  this.dataKey = 'data',
  this.enableDeduplication = true,
  this.printPayload = true,
  this.prettyPrint = true,
});