Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump min SDK to Dart 2.18.0 / Flutter 3.3.0 #28

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '6.0.0'
paths-ignore:
- "**.md"
pull_request_target:
pull_request:
branches:
- main
- '6.0.0'
Expand Down Expand Up @@ -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:
Expand Down
103 changes: 34 additions & 69 deletions dio/lib/src/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, dynamic>? queryParameters,
Map<String, dynamic>? extra,
Map<String, dynamic>? 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;
Expand Down Expand Up @@ -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<String, dynamic>? queryParameters,
String? baseUrl,
Map<String, dynamic>? extra,
Map<String, dynamic>? 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 ?? '';
Expand Down
2 changes: 1 addition & 1 deletion dio/test/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ final Matcher throwsDioExceptionConnectionError = throwsA(

/// A stream of chunks of bytes representing a single piece of data.
class ByteStream extends StreamView<List<int>> {
ByteStream(Stream<List<int>> stream) : super(stream);
ByteStream(super.stream);

/// Returns a single-subscription byte stream that will emit the given bytes
/// in a single chunk.
Expand Down
2 changes: 1 addition & 1 deletion dio_test/lib/src/test/download_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion example_flutter_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading