setBaseOptions static method

void setBaseOptions({
  1. String? baseUrl,
  2. Map<String, dynamic>? queryParameters,
  3. Duration? connectTimeout,
  4. Duration? receiveTimeout,
  5. Duration? sendTimeout,
  6. Map<String, Object?>? extra,
  7. Map<String, Object?>? headers,
  8. UnifiedResponseType? responseType,
  9. String? contentType,
  10. bool? followRedirects,
  11. int? maxRedirects,
  12. 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,
  );
}