feat(flutter_bloc): disallow providing a bloc via RepositoryProvider
Open
dependency
enhancement
pkg:flutter_bloc
- Dominant language
- Dart
- Stars
- 12.5k
- Forks
- 3.4k
- PR merge metrics
- No merged PRs in 30d
Description
I spent a **ridiculous** amount debugging a scenario where a context.select never updated its widget, only to find out that the Bloc it was accessing was registered through a _RepositoryProvider_ rather than a BlocProvider. The main issue why I didn't figure it out sooner was that the context.select in this case still _works_... only like a context.read 😅 do you think making this at least a runtime error, if not possible as compile-time, would be an option?
_Originally posted by @Lootwig in https://github.com/felangel/bloc/issues/3054#issuecomment-991817877_
Contributor guide
Assessment
This issue has not been assessed yet.