AutoPilotConfig constructor
const
AutoPilotConfig({
- required String baseUrl,
- String tokenType = 'Bearer',
- int timeoutSeconds = 30,
- bool enableLogs = kDebugMode,
- bool enableCache = false,
- Duration cacheDuration = const Duration(minutes: 5),
- Map<
String, String> globalHeaders = const {}, - int maxRetries = 3,
- Duration retryDelay = const Duration(seconds: 1),
- bool enableTokenRefresh = false,
- Future<
String?> onRefreshToken()?, - bool enableGlobalLoader = false,
- void onLoadingChanged(
- bool loading
- void onError()?,
- void onRequestSent()?,
- void onResponseReceived()?,
- String successKey = 'status',
- dynamic successValue = true,
- String messageKey = 'message',
- String dataKey = 'data',
- bool enableDeduplication = true,
- bool printPayload = true,
- 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,
});