felangel / felangel/bloc

feat(flutter_bloc): disallow providing a bloc via RepositoryProvider

Open
#3,067 2 comments 4 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.