diff --git a/.idea/modules.xml b/.idea/modules.xml index b5f4852fb..ba2ba4b4b 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -7,6 +7,7 @@ + diff --git a/dio/lib/src/options.dart b/dio/lib/src/options.dart index 8a816ae98..50891bccb 100644 --- a/dio/lib/src/options.dart +++ b/dio/lib/src/options.dart @@ -122,45 +122,27 @@ mixin OptionsMixin { /// The base config for the Dio instance, used by [Dio.options]. class BaseOptions extends _RequestConfig with OptionsMixin { BaseOptions({ - String? method, + super.method, Duration? connectTimeout, - Duration? receiveTimeout, - Duration? sendTimeout, + super.receiveTimeout, + super.sendTimeout, String baseUrl = '', Map? queryParameters, - Map? extra, - Map? headers, - bool preserveHeaderCase = false, - ResponseType? responseType = ResponseType.json, - String? contentType, - ValidateStatus? validateStatus, - bool? receiveDataWhenStatusError, - bool? followRedirects, - int? maxRedirects, - bool? persistentConnection, - RequestEncoder? requestEncoder, - ResponseDecoder? responseDecoder, - ListFormat? listFormat, + super.extra, + super.headers, + bool super.preserveHeaderCase = false, + super.responseType = ResponseType.json, + super.contentType, + super.validateStatus, + super.receiveDataWhenStatusError, + super.followRedirects, + super.maxRedirects, + super.persistentConnection, + super.requestEncoder, + super.responseDecoder, + super.listFormat, }) : assert(connectTimeout == null || !connectTimeout.isNegative), - assert(baseUrl.isEmpty || Uri.parse(baseUrl).host.isNotEmpty), - super( - method: method, - receiveTimeout: receiveTimeout, - sendTimeout: sendTimeout, - extra: extra, - headers: headers, - preserveHeaderCase: preserveHeaderCase, - responseType: responseType, - contentType: contentType, - validateStatus: validateStatus, - receiveDataWhenStatusError: receiveDataWhenStatusError, - followRedirects: followRedirects, - maxRedirects: maxRedirects, - persistentConnection: persistentConnection, - requestEncoder: requestEncoder, - responseDecoder: responseDecoder, - listFormat: listFormat, - ) { + assert(baseUrl.isEmpty || Uri.parse(baseUrl).host.isNotEmpty) { this.queryParameters = queryParameters ?? {}; this.baseUrl = baseUrl; this.connectTimeout = connectTimeout; @@ -488,46 +470,28 @@ class RequestOptions extends _RequestConfig with OptionsMixin { this.onReceiveProgress, this.onSendProgress, this.cancelToken, - String? method, - Duration? sendTimeout, - Duration? receiveTimeout, + super.method, + super.sendTimeout, + super.receiveTimeout, Duration? connectTimeout, Map? queryParameters, String? baseUrl, - Map? extra, - Map? headers, - bool? preserveHeaderCase, - ResponseType? responseType, - String? contentType, - ValidateStatus? validateStatus, - bool? receiveDataWhenStatusError, - bool? followRedirects, - int? maxRedirects, - bool? persistentConnection, - RequestEncoder? requestEncoder, - ResponseDecoder? responseDecoder, - ListFormat? listFormat, + super.extra, + super.headers, + super.preserveHeaderCase, + super.responseType, + super.contentType, + super.validateStatus, + super.receiveDataWhenStatusError, + super.followRedirects, + super.maxRedirects, + super.persistentConnection, + super.requestEncoder, + super.responseDecoder, + super.listFormat, bool? setRequestContentTypeWhenNoPayload, StackTrace? sourceStackTrace, - }) : assert(connectTimeout == null || !connectTimeout.isNegative), - super( - method: method, - sendTimeout: sendTimeout, - receiveTimeout: receiveTimeout, - extra: extra, - headers: headers, - preserveHeaderCase: preserveHeaderCase, - responseType: responseType, - contentType: contentType, - validateStatus: validateStatus, - receiveDataWhenStatusError: receiveDataWhenStatusError, - followRedirects: followRedirects, - maxRedirects: maxRedirects, - persistentConnection: persistentConnection, - requestEncoder: requestEncoder, - responseDecoder: responseDecoder, - listFormat: listFormat, - ) { + }) : assert(connectTimeout == null || !connectTimeout.isNegative) { this.sourceStackTrace = sourceStackTrace ?? StackTrace.current; this.queryParameters = queryParameters ?? {}; this.baseUrl = baseUrl ?? ''; diff --git a/dio/test/utils.dart b/dio/test/utils.dart index fb4c0669e..f260bb416 100644 --- a/dio/test/utils.dart +++ b/dio/test/utils.dart @@ -177,7 +177,7 @@ final Matcher throwsDioExceptionConnectionError = throwsA( /// A stream of chunks of bytes representing a single piece of data. class ByteStream extends StreamView> { - ByteStream(Stream> stream) : super(stream); + ByteStream(super.stream); /// Returns a single-subscription byte stream that will emit the given bytes /// in a single chunk. diff --git a/dio_workspace.iml b/dio_workspace.iml index 7beb2dae2..47f8e0a3e 100644 --- a/dio_workspace.iml +++ b/dio_workspace.iml @@ -19,6 +19,12 @@ + + + + + + diff --git a/example_flutter_app/pubspec.yaml b/example_flutter_app/pubspec.yaml index 082705494..07b0b5035 100644 --- a/example_flutter_app/pubspec.yaml +++ b/example_flutter_app/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.15.0 <4.0.0" + sdk: ">=2.19.0 <4.0.0" dependencies: flutter: