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
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
The text was updated successfully, but these errors were encountered:
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 :)
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 usingprovider.dart
orflutter_modular.dart
because extensionsReadContext
on BuildContext is in conflict withModularWatchExtension
on BuildContext.Also, when importing both
flutter_modular.dart
andprovider.dart
in a file, there is ambiguous extension call so you have to either hide extension from import or use explicitReadContext(context).read<T>
andModularWatchExtension(context).read<T>
Describe the solution you'd like
Set different and more verbose naming not being in conflict with Provider
context.read<T>
likereadDependency
orwatchDependency
Describe alternatives you've considered
Just move
extension ModularWatchExtension on BuildContext
to another file that needs explicit import call and not be included in globalflutter_modular.dart
exports.Additional context
Screenshots
The text was updated successfully, but these errors were encountered: