config method
void
config({})
Implementation
void config(
{String? baseUrl,
String? token,
GetOption<String?>? getToken,
GetAsyncOption<String?>? getAsyncToken,
GetOption? unauthenticated,
Map<String, dynamic>? defaultQueryParameters,
String? tokenType,
int? connectTimeout,
bool? enableLog,
List<ApiInterceptor>? interceptors}) async {
this.baseUrl = baseUrl ?? this.baseUrl;
this.token = token ?? this.token;
this.getToken = getToken ?? this.getToken;
this.getAsyncToken = getAsyncToken ?? this.getAsyncToken;
this.unauthenticated = unauthenticated ?? this.unauthenticated;
if (this.defaultQueryParameters.isNotEmpty) {
this.defaultQueryParameters.addAll(defaultQueryParameters ?? {});
} else {
this.defaultQueryParameters =
defaultQueryParameters ?? this.defaultQueryParameters;
}
if (this.interceptors.isNotEmpty) {
this.interceptors.addAll(interceptors ?? []);
} else {
this.interceptors = interceptors ?? this.interceptors;
}
this.tokenType = tokenType ?? this.tokenType;
this.connectTimeout = connectTimeout ?? this.connectTimeout;
this.enableLog = enableLog ?? this.enableLog;
}