diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4c3a0f74e..1fecae071 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ on: - '6.0.0' paths-ignore: - "**.md" - pull_request_target: + pull_request: branches: - main - '6.0.0' @@ -37,11 +37,11 @@ jobs: TEST_PRESET: all steps: - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@v2.13.0 with: - cache: true +# cache: true flutter-version: ${{ matrix.sdk == 'min' && '3.3.0' || '' }} - channel: ${{ matrix.sdk == 'min' && '' || matrix.channel }} + channel: ${{ matrix.sdk == 'min' && 'stable' || matrix.channel }} - run: dart pub get - uses: bluefireteam/melos-action@v3 with: diff --git a/dio/lib/src/options.dart b/dio/lib/src/options.dart index 8631b7135..e749caae0 100644 --- a/dio/lib/src/options.dart +++ b/dio/lib/src/options.dart @@ -136,43 +136,26 @@ 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( - 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, - ) { + super.extra, + super.headers, + 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, + }) { this.baseUrl = baseUrl; this.queryParameters = queryParameters ?? {}; this.connectTimeout = connectTimeout; @@ -500,46 +483,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 556e2cb6f..f4a06d0bc 100644 --- a/dio/test/utils.dart +++ b/dio/test/utils.dart @@ -173,7 +173,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_test/lib/src/test/download_tests.dart b/dio_test/lib/src/test/download_tests.dart index e0c60bbb5..2fdd23479 100644 --- a/dio_test/lib/src/test/download_tests.dart +++ b/dio_test/lib/src/test/download_tests.dart @@ -272,7 +272,7 @@ void downloadTests( }, // The download of the main.zip file can be slow, // so we need to increase the timeout. - timeout: Timeout(Duration(milliseconds: 1)), + timeout: Timeout(Duration(seconds: 1)), ); test('delete on error', () async { diff --git a/example_flutter_app/lib/main.dart b/example_flutter_app/lib/main.dart index 97bc8f2d0..9b6546258 100644 --- a/example_flutter_app/lib/main.dart +++ b/example_flutter_app/lib/main.dart @@ -24,7 +24,10 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key? key, this.title = ''}) : super(key: key); + MyHomePage({ + super.key, + this.title = '', + }); final String title;