BaseOptions constructor Null safety

BaseOptions(
  1. {String? method,
  2. int? connectTimeout,
  3. int? receiveTimeout,
  4. int? sendTimeout,
  5. String baseUrl = '',
  6. Map<String, dynamic>? queryParameters,
  7. Map<String, dynamic>? extra,
  8. Map<String, dynamic>? headers,
  9. ResponseType? responseType = ResponseType.json,
  10. String? contentType,
  11. ValidateStatus? validateStatus,
  12. bool? receiveDataWhenStatusError,
  13. bool? followRedirects,
  14. int? maxRedirects,
  15. RequestEncoder? requestEncoder,
  16. ResponseDecoder? responseDecoder,
  17. ListFormat? listFormat,
  18. bool setRequestContentTypeWhenNoPayload = false}
)

Implementation

BaseOptions({
  String? method,
  int? connectTimeout,
  int? receiveTimeout,
  int? sendTimeout,
  String baseUrl = '',
  Map<String, dynamic>? queryParameters,
  Map<String, dynamic>? extra,
  Map<String, dynamic>? headers,
  ResponseType? responseType = ResponseType.json,
  String? contentType,
  ValidateStatus? validateStatus,
  bool? receiveDataWhenStatusError,
  bool? followRedirects,
  int? maxRedirects,
  RequestEncoder? requestEncoder,
  ResponseDecoder? responseDecoder,
  ListFormat? listFormat,
  this.setRequestContentTypeWhenNoPayload = false,
}) : super(
        method: method,
        receiveTimeout: receiveTimeout,
        sendTimeout: sendTimeout,
        extra: extra,
        headers: headers,
        responseType: responseType,
        contentType: contentType,
        validateStatus: validateStatus,
        receiveDataWhenStatusError: receiveDataWhenStatusError,
        followRedirects: followRedirects,
        maxRedirects: maxRedirects,
        requestEncoder: requestEncoder,
        responseDecoder: responseDecoder,
        listFormat: listFormat,
      ) {
  this.queryParameters = queryParameters ?? {};
  this.baseUrl = baseUrl;
  this.connectTimeout = connectTimeout ?? 0;
}