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
I also don't think there is a way to add awaits here that satisfy the lint.
There are probably other situations in which future returning expectations cause similar problems.
Brainstorming Possible Solutions
One solution would be do change the lint, so that it does not trigger in cascades, but somehow also seems wrong, since there actually are unawaited futures.
Maybe expectations should not return futures, but instead add them to the context? Then the Subject could be a awaited or example by doing:
I just noticed, that with the changes from the master branch this does not seem to be a problem:
But I must say that I am not a fan of the new callback syntax, especially when using it with the usually pretty awesome Type Inlay Hints from the Flutter Enhancement Suite plugin. This makes this very visually cluttered. But even without the type hints, I think repreating the it twice is a bit verbose. This is amplified by the expectations for streams already being relatively verbose, but that is arguably a separate issue :)
But I must say that I am not a fan of the new callback syntax
The Condition syntax got some feedback that it was confusing. I didn't get much positive feedback about the syntax (although I was a fan of the reduced noise and held on to it for a while) so I ended up dropping it. It was a low volume of feedback, and this positive feedback pushes closer to neutral overall.
For example when testing a stream using exactly the way it is described in the README, it triggers the unawaited_futures lint:
Or as image to see the lints:
![image](https://private-user-images.githubusercontent.com/48153628/283939974-eaf19e9d-7e09-4d8a-8061-d64c1aeb5c6d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4ODM3NjIsIm5iZiI6MTcyNDg4MzQ2MiwicGF0aCI6Ii80ODE1MzYyOC8yODM5Mzk5NzQtZWFmMTllOWQtN2UwOS00ZDhhLTgwNjEtZDY0YzFhZWI1YzZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDIyMTc0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU2YzU5NGE1YWQ3OGNkY2E3OTE1YjVjMmQzMjQxN2IxNGU0NjNmMmEwOWUwODI5ZWRhM2VmZmM0MWY2NjgzMjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.-M97-jdq8pzWyny7yVLiVO_Tn3GQEnyR8ZUjqTeVnHM)
Applying the auto fix produces invalid code:
I also don't think there is a way to add
await
s here that satisfy the lint.There are probably other situations in which future returning expectations cause similar problems.
Brainstorming Possible Solutions
One solution would be do change the lint, so that it does not trigger in cascades, but somehow also seems wrong, since there actually are unawaited futures.
Maybe expectations should not return futures, but instead add them to the
context
? Then theSubject
could be a awaited or example by doing:This would then await the completion of the entire check.
Not sure if that's good though.
The text was updated successfully, but these errors were encountered: