You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
In this case, the onRefresh function may return a Future when shouldRefresh is true. But, when shouldRefresh is false, the function returns null. So the async keyword is needed, but we are getting a lint error for avoid-redundant-async
What actually happened?
'async' keyword is redundant, consider removing it.
dart[avoid-redundant-async](https://dartcodemetrics.dev/docs/rules/common/avoid-redundant-async)
If the async keyword is removed, we get this analysis error:
The body might complete normally, causing 'null' to be returned, but the return type, 'Future<void>', is a potentially non-nullable type.
Try adding either a return or a throw statement at the end. body_might_complete_normally
Are you willing to submit a pull request to fix this bug?
Maybe :)
The text was updated successfully, but these errors were encountered:
This one is tricky. I'll fix this specific case with the if statement, but if you have an option to add another return, I'd recommend to move that way.
What did you do? Please include the source code example causing the issue.
https://api.flutter.dev/flutter/material/RefreshIndicator-class.html
What did you expect to happen?
In this case, the
onRefresh
function may return aFuture
whenshouldRefresh
is true. But, whenshouldRefresh
is false, the function returnsnull
. So theasync
keyword is needed, but we are getting a lint error foravoid-redundant-async
What actually happened?
If the
async
keyword is removed, we get this analysis error:Are you willing to submit a pull request to fix this bug?
Maybe :)
The text was updated successfully, but these errors were encountered: