discarded_futures lint false positive #59504
Labels
area-devexp
For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
devexp-linter
Issues with the analyzer's support for the linter package
linter-false-positive
P3
A lower priority bug or feature request
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Describe the issue
With
discarded_futures
lint enabled the false positive is triggered when method returning aFuture
is called from a non-async method and returned future is passed to another method or Flutter widget. In FlutterMultiFrameImageStreamCompleter
andFutureBuilder
both are takingFuture
as a parameter.Similarly, a future could be assigned to a variable and used later in a method, yet still
discarded_futures
lint is raised.To Reproduce
Here is a code snippet that is triggering issue. Note that
FutureBuilder
is usually within Flutter'sbuild()
method, which can't be async.Where the
_buildImage
method is declared like this:The text was updated successfully, but these errors were encountered: