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

fixes to anticipate next Dart linter release #127211

Merged
merged 2 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ abstract final class _UntilNextFrame {
if (_UntilNextFrame._completer == null) {
_UntilNextFrame._completer = Completer<void>();
SchedulerBinding.instance.addPostFrameCallback((_) {
_UntilNextFrame._completer!.complete(null);
_UntilNextFrame._completer!.complete();
_UntilNextFrame._completer = null;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ abstract final class _UntilNextFrame {
if (_UntilNextFrame._completer == null) {
_UntilNextFrame._completer = Completer<void>();
SchedulerBinding.instance.addPostFrameCallback((_) {
_UntilNextFrame._completer!.complete(null);
_UntilNextFrame._completer!.complete();
_UntilNextFrame._completer = null;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class _UntilNextFrame {
if (_UntilNextFrame._completer == null) {
_UntilNextFrame._completer = Completer<void>();
SchedulerBinding.instance.addPostFrameCallback((_) {
_UntilNextFrame._completer!.complete(null);
_UntilNextFrame._completer!.complete();
_UntilNextFrame._completer = null;
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ abstract class ImageProvider<T extends Object> {
exception: exception,
stack: stack,
));
completer.complete(null);
completer.complete();
}
},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/test/material/scaffold_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ void main() {
),
TextButton(
onPressed: () {
Navigator.pop(context, null);
Navigator.pop(context);
},
child: const Text('Pop route'),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void main() {
expect(binding.restorationManager.rootBucketAccessed, 1);
expect(find.text('Hello'), findsNothing);

completer.complete(null);
completer.complete();
await tester.pump(const Duration(milliseconds: 100));

expect(binding.restorationManager.rootBucketAccessed, 1);
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter_test/lib/src/matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1624,10 +1624,10 @@ class _MatchAnythingExceptClip extends _FailWithDescriptionMatcher {
final RenderObject renderObject = nodes.single.renderObject!;

switch (renderObject.runtimeType) {
case RenderClipPath:
case RenderClipOval:
case RenderClipRect:
case RenderClipRRect:
case const (RenderClipPath):
case const (RenderClipOval):
case const (RenderClipRect):
case const (RenderClipRRect):
return failWithDescription(matchState, 'had a root render object of type: ${renderObject.runtimeType}');
default:
return true;
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_test/lib/src/test_pointer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ class TestPointer {
_buttons = buttons;
}
switch (event.runtimeType) {
case PointerDownEvent:
case const (PointerDownEvent):
assert(!isDown);
_isDown = true;
case PointerUpEvent:
case PointerCancelEvent:
case const (PointerUpEvent):
case const (PointerCancelEvent):
assert(isDown);
_isDown = false;
default:
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/compile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class StdoutHandler {
}
}
if (message.length <= messageBoundaryKey.length) {
compilerOutput?.complete(null);
compilerOutput?.complete();
return;
}
final int spaceDelimiter = message.lastIndexOf(' ');
Expand Down Expand Up @@ -809,7 +809,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
// when outputFilename future is not completed, but stdout is closed
// process has died unexpectedly.
if (_stdoutHandler.compilerOutput?.isCompleted == false) {
_stdoutHandler.compilerOutput?.complete(null);
_stdoutHandler.compilerOutput?.complete();
throwToolExit('the Dart compiler exited unexpectedly.');
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class CustomDevicePortForwarder extends DevicePortForwarder {
// a port forwarding failure and we complete with a null value.
unawaited(process.exitCode.whenComplete(() {
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void main() {
await FakeAsync().run((FakeAsync time) {
unawaited(FakeAsyncCrashingDoctor(time, logger).diagnose(verbose: false).then((bool r) {
expect(r, isFalse);
completer.complete(null);
completer.complete();
}));
time.elapse(const Duration(seconds: 1));
time.flushMicrotasks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ void main() {
caughtByHandler = true;
}
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}, (Object e, StackTrace s) {
caughtByZone = true;
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}));
time.elapse(const Duration(seconds: 1));
Expand Down Expand Up @@ -214,12 +214,12 @@ void main() {
caughtByHandler = true;
}
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}, (Object e, StackTrace s) {
caughtByZone = true;
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}));
time.elapse(const Duration(seconds: 1));
Expand Down Expand Up @@ -252,12 +252,12 @@ void main() {
caughtByHandler = true;
}
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}, (Object e, StackTrace s) {
caughtByZone = true;
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}));
time.elapse(const Duration(seconds: 1));
Expand Down Expand Up @@ -292,12 +292,12 @@ void main() {
caughtByHandler = true;
}
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}, (Object e, StackTrace s) {
caughtByZone = true;
if (!completer.isCompleted) {
completer.complete(null);
completer.complete();
}
}));
time.elapse(const Duration(seconds: 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void main() {
packageConfig: PackageConfig.empty,
packagesPath: '.packages',
);
stdoutHandler.compilerOutput?.complete(null);
stdoutHandler.compilerOutput?.complete();
completer.complete();

expect(await output, null);
Expand Down