Closed passsy closed 10 months ago
I'm not 100% convinced fireAndForget
is a good API. The wording should match the error message and should contain "unawaited".
Idea: Force a justification why await wasn't called
logAsync('success').unawaitedBecause("logging isn't cirical for control flow");
unawaitedBecause('user does not have to wait for logging', logAsync('success'));
I have to double-check if the string is removed when compiled AOT, since it isn't used.
Can't land this yet. There is currently a great discussion going on at https://github.com/dart-lang/sdk/issues/46218.
A common method that returns Future
but is not awaited is AnimationController.forward()
. Let's see how the dart team solves it
Let's stick with the official unawaited
. I still like the idea of unawaitedBecause
but it should come from an official Dart package
Enables
unawaited_futures
.Where Futures are intentionally not awaited, users can disable this lint with
fireAndForget
which exists as top-level function and extension. It is identical tounawaited
from pedantic.I explicitly did not name it
unawaited
as it causes naming conflicts. That's the main reason whyunawaited
was removed frommeta
again.Fixes #26
Alternative names
notAwaited
runInParallel
ignoreUnawaitedFuture