-
-
Notifications
You must be signed in to change notification settings - Fork 956
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
If dependencies is empty, add const #2310
If dependencies is empty, add const #2310
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2310 +/- ##
===========================================
+ Coverage 95.25% 100.00% +4.74%
===========================================
Files 53 3 -50
Lines 2253 74 -2179
===========================================
- Hits 2146 74 -2072
+ Misses 107 0 -107 |
|
||
expect( | ||
emptyDependenciesStatefulProvider.dependencies, | ||
const <ProviderOrFamily>[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those tests would pass even without the const. Wrap the list in a "same()"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrapped it with "same()"👍
@@ -106,6 +106,18 @@ void main() { | |||
transitiveDependenciesProvider.dependencies, | |||
same(transitiveDependenciesProvider.dependencies), | |||
); | |||
expect( | |||
smallTransitiveDependencyCountProvider.dependencies, | |||
same(smallTransitiveDependencyCountProvider.dependencies), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not what I meant
Do same(const <ProviderOrFamily>[])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rrousselGit I have responded to the comment you provided, and I would appreciate it if you could take a moment to review my response
LGTM, thanks a lot ! |
When creating a provider with an empty list for dependencies, a warning was raised.
I fixed it by adding const.
https://dart-lang.github.io/linter/lints/prefer_const_literals_to_create_immutables.html