setBaseOptions static method
void
setBaseOptions({
- String? baseUrl,
- Map<
String, dynamic> ? queryParameters, - Duration? connectTimeout,
- Duration? receiveTimeout,
- Duration? sendTimeout,
- Map<
String, Object?> ? extra, - Map<
String, Object?> ? headers, - UnifiedResponseType? responseType,
- String? contentType,
- bool? followRedirects,
- int? maxRedirects,
- bool? persistentConnection,
call this function to set base options of Dio client
Implementation
static void setBaseOptions({
String? baseUrl,
Map<String, dynamic>? queryParameters,
Duration? connectTimeout,
Duration? receiveTimeout,
Duration? sendTimeout,
Map<String, Object?>? extra,
Map<String, Object?>? headers,
UnifiedResponseType? responseType,
String? contentType,
bool? followRedirects,
int? maxRedirects,
bool? persistentConnection,
}) {
_baseOptions = BaseOptions(
baseUrl: baseUrl ?? '',
headers: headers,
extra: extra,
queryParameters: queryParameters,
sendTimeout: sendTimeout,
connectTimeout: connectTimeout,
receiveTimeout: receiveTimeout,
contentType: contentType,
responseType: _mapResponseType(responseType),
maxRedirects: maxRedirects,
followRedirects: followRedirects,
persistentConnection: persistentConnection,
);
}