Skip to content
This repository was archived by the owner on Oct 17, 2024. It is now read-only.

Commit b5be1d1

Browse files
committed
Update to latest lints, require Dart 3.2
1 parent 24266ca commit b5be1d1

21 files changed

+67
-65
lines changed

.github/workflows/test-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
matrix:
4848
# Add macos-latest and/or windows-latest if relevant for this package.
4949
os: [ubuntu-latest]
50-
sdk: [2.19.0, dev]
50+
sdk: [3.2, dev]
5151
steps:
5252
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
5353
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 2.12.0-wip
22

3-
- Require Dart 2.19
3+
- Require Dart 3.2
44

55
## 2.11.0
66

analysis_options.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# https://dart.dev/guides/language/analysis-options
1+
# https://dart.dev/tools/analysis#the-analysis-options-file
22
include: package:dart_flutter_team_lints/analysis_options.yaml
33

44
analyzer:
@@ -7,16 +7,15 @@ analyzer:
77
errors:
88
only_throw_errors: ignore
99
unawaited_futures: ignore
10+
inference_failure_on_instance_creation: ignore
11+
inference_failure_on_function_invocation: ignore
12+
inference_failure_on_collection_literal: ignore
1013

1114
linter:
1215
rules:
1316
- avoid_unused_constructor_parameters
14-
- comment_references
1517
- literal_only_boolean_expressions
1618
- missing_whitespace_between_adjacent_strings
1719
- no_adjacent_strings_in_list
1820
- no_runtimeType_toString
1921
- package_api_docs
20-
- prefer_relative_imports
21-
- test_types_in_equals
22-
- use_super_parameters

lib/src/subscription_stream.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class _CancelOnErrorSubscriptionWrapper<T>
7373
@override
7474
void onError(Function? handleError) {
7575
// Cancel when receiving an error.
76-
super.onError((error, StackTrace stackTrace) {
76+
super.onError((Object error, StackTrace stackTrace) {
7777
// Wait for the cancel to complete before sending the error event.
7878
super.cancel().whenComplete(() {
7979
if (handleError is ZoneBinaryCallback) {

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ description: Utility functions and classes related to the 'dart:async' library.
44
repository: https://github.com/dart-lang/async
55

66
environment:
7-
sdk: '>=2.19.0 <4.0.0'
7+
sdk: ^3.2.0
88

99
dependencies:
1010
collection: ^1.15.0
1111
meta: ^1.1.7
1212

1313
dev_dependencies:
14-
dart_flutter_team_lints: ^1.0.0
14+
dart_flutter_team_lints: ^2.0.0
1515
fake_async: ^1.2.0
1616
stack_trace: ^1.10.0
1717
test: ^1.16.0

test/async_cache_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void main() {
6060
Future<String> throwingCall() async => throw Exception();
6161
await expectLater(cache.fetch(throwingCall), throwsA(isException));
6262
// To let the timer invalidate the cache
63-
await Future.delayed(Duration(milliseconds: 5));
63+
await Future.delayed(const Duration(milliseconds: 5));
6464

6565
Future<String> call() async => 'Completed';
6666
expect(await cache.fetch(call), 'Completed', reason: 'Cache invalidates');

test/cancelable_operation_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,8 @@ void main() {
574574
test('waits for chained cancellation', () async {
575575
var completer = CancelableCompleter<void>();
576576
var chainedOperation = completer.operation
577-
.then((_) => Future.delayed(Duration(milliseconds: 1)))
578-
.then((_) => Future.delayed(Duration(milliseconds: 1)));
577+
.then((_) => Future.delayed(const Duration(milliseconds: 1)))
578+
.then((_) => Future.delayed(const Duration(milliseconds: 1)));
579579

580580
await completer.operation.cancel();
581581
expect(completer.operation.isCanceled, true);

test/lazy_stream_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void main() {
1414
var callbackCalled = false;
1515
var stream = LazyStream(expectAsync0(() {
1616
callbackCalled = true;
17-
return Stream.empty();
17+
return const Stream.empty();
1818
}));
1919

2020
await flushMicrotasks();
@@ -28,7 +28,7 @@ void main() {
2828
var callbackCalled = false;
2929
var stream = LazyStream(expectAsync0(() {
3030
callbackCalled = true;
31-
return Stream.empty();
31+
return const Stream.empty();
3232
}));
3333

3434
await flushMicrotasks();
@@ -95,7 +95,7 @@ void main() {
9595
late LazyStream stream;
9696
stream = LazyStream(expectAsync0(() {
9797
expect(() => stream.listen(null), throwsStateError);
98-
return Stream.empty();
98+
return const Stream.empty();
9999
}));
100100
stream.listen(null);
101101
});

test/null_stream_sink_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void main() {
5151

5252
expect(() => sink.add(1), throwsStateError);
5353
expect(() => sink.addError('oh no'), throwsStateError);
54-
expect(() => sink.addStream(Stream.empty()), throwsStateError);
54+
expect(() => sink.addStream(const Stream.empty()), throwsStateError);
5555
});
5656

5757
group('addStream', () {
@@ -93,15 +93,15 @@ void main() {
9393
test('causes events to throw StateErrors until the future completes',
9494
() async {
9595
var sink = NullStreamSink();
96-
var future = sink.addStream(Stream.empty());
96+
var future = sink.addStream(const Stream.empty());
9797
expect(() => sink.add(1), throwsStateError);
9898
expect(() => sink.addError('oh no'), throwsStateError);
99-
expect(() => sink.addStream(Stream.empty()), throwsStateError);
99+
expect(() => sink.addStream(const Stream.empty()), throwsStateError);
100100

101101
await future;
102102
sink.add(1);
103103
sink.addError('oh no');
104-
expect(sink.addStream(Stream.empty()), completes);
104+
expect(sink.addStream(const Stream.empty()), completes);
105105
});
106106
});
107107
});

test/reject_errors_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void main() {
171171

172172
test('throws on addStream()', () {
173173
var sink = controller.sink.rejectErrors()..close();
174-
expect(() => sink.addStream(Stream.empty()), throwsStateError);
174+
expect(() => sink.addStream(const Stream.empty()), throwsStateError);
175175
});
176176

177177
test('allows close()', () {
@@ -196,7 +196,7 @@ void main() {
196196
test('throws on addStream()', () {
197197
var sink = controller.sink.rejectErrors()
198198
..addStream(StreamController().stream);
199-
expect(() => sink.addStream(Stream.empty()), throwsStateError);
199+
expect(() => sink.addStream(const Stream.empty()), throwsStateError);
200200
});
201201

202202
test('throws on close()', () {

0 commit comments

Comments
 (0)