-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(bloc_lint): add prefer_build_context_extensions
#4562
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
feat(bloc_lint): add prefer_build_context_extensions
#4562
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
2fdc86b
to
ecd913a
Compare
abff5bd
to
4700d6f
Compare
ecd913a
to
6e25ea1
Compare
Hi @felangel |
packages/bloc_lint/lib/src/rules/prefer_context_extensions.dart
Outdated
Show resolved
Hide resolved
407978d
to
d7c215d
Compare
I'll take care of resolving the conflicts and getting this merged shortly, thanks! |
d7c215d
to
141c37c
Compare
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.
Thanks for all your contributions! I really appreciate it 🙏
Unfortunately, I think this PR still needs some work because it currently only accounts for BlocProvider.of
and RepositoryProvider.of
but there are many other cases that aren't accounted for in these changes. For example, I would expect this lint rule to lint when using BlocBuilder
and recommend using context.watch
instead. I would also expect this lint rule to lint when using BlocSelector
and recommend using context.select
instead.
Let me know if you want to rework this PR to incorporate those changes or if you'd prefer me to take it over and thanks again for taking the time to contribute 💙
@felangel I will take care of it. However, I think I need a clearer requirement—like, if |
Thanks! For now I’d always recommend context.watch for BlocBuilder (eventually I want to deprecate and remove buildWhen). |
@felangel I was planning to work on this over the weekend, but I ended up being a bit busy. Feel free to take it. Thank you |
@felangel Any update on this |
Planning to pick this up now, sorry for the delay! |
prefer_build_context_extensions
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.
LGTM thanks so much for the contribution! 💙
Status
READY
Breaking Changes
NO
Description
feat(bloc_lint): prefer_context_extensions #4456
Type of Change