Skip to content
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

Conflicting extensions ModularWatchExtension & Provider:ReadContext #789

Closed
adamstyrc opened this issue Sep 1, 2022 · 3 comments
Closed
Labels
enhancement New feature or request new New issue request attention

Comments

@adamstyrc
Copy link

adamstyrc commented Sep 1, 2022

Project Name
flutter_modular

Is your feature request related to a problem? Please describe.
Conflict with lib extension at: https://pub.dev/packages/provider

Me & my team finds it tedious that always when using context.read<T>() we are asked for import by IDE then we always have to choose if using provider.dart or flutter_modular.dart because extensions ReadContext on BuildContext is in conflict with ModularWatchExtension on BuildContext.
Also, when importing both flutter_modular.dart and provider.dart in a file, there is ambiguous extension call so you have to either hide extension from import or use explicit ReadContext(context).read<T> and ModularWatchExtension(context).read<T>

Describe the solution you'd like
Set different and more verbose naming not being in conflict with Provider context.read<T> like readDependency or watchDependency

Describe alternatives you've considered
Just move extension ModularWatchExtension on BuildContext to another file that needs explicit import call and not be included in global flutter_modular.dart exports.

Additional context

Screenshots
image

@adamstyrc adamstyrc added enhancement New feature or request new New issue request attention labels Sep 1, 2022
@eduardoflorence
Copy link

Duplicate of #670

@adamstyrc
Copy link
Author

Well, it's just half duplicate because my point of view is that still you always have to think what you import and add show Modular (or btw hide ModularWatchExtension). Using Provider read/watch is really heavy in our project.
I more liked your approach @eduardoflorence that we change naming from read and watch to readBind / watchBind :)

Could we consider that?

@jacobaraujo7
Copy link
Contributor

duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new New issue request attention
Projects
None yet
Development

No branches or pull requests

3 participants