Test your Flutter BLoC knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/12Score 0
What is `RepositoryProvider` (also part of the broader flutter_bloc/bloc ecosystem) typically used for, distinct from `BlocProvider`?
In this round
What is `RepositoryProvider` (also part of the broader flutter_bloc/bloc ecosystem) typically used for, distinct from `BlocProvider`?
How does `BlocSelector` in flutter_bloc compare to plain `BlocBuilder`, in terms of rebuild optimization?
Why might `context.read<T>()` throw an error if called from inside a widget's `build()` method in certain contexts, even though it's generally described as "safe" for one-off, non-subscribing access?
What does calling `emit()` after the Bloc has already been closed (via `close()`) typically result in, and why does this matter for how async event handlers should be written?
What is a reasonable way to think about the tradeoff between using plain `Bloc` (with explicit named events) versus `Cubit` (direct method calls) SPECIFICALLY within the flutter_bloc package, for a given feature?
What is a reasonable justification for using `RepositoryProvider` to inject a repository into a Bloc's constructor, rather than having the Bloc directly instantiate its own repository internally?
What does the `buildWhen`/`listenWhen` parameter on `BlocBuilder`/`BlocListener` let a developer control?
What is the purpose of `HydratedBloc` (from the related `hydrated_bloc` package built on top of flutter_bloc)?
What is the purpose of the `initialState` (via the constructor's `super()` call) when defining a new `Bloc` or `Cubit` subclass in flutter_bloc?
What is the purpose of `BlocObserver` in flutter_bloc, and what does overriding its methods let a developer do?
What widgets/classes does the `flutter_bloc` package provide beyond the core `Bloc`/`Cubit` base classes?
What is the significance of `flutter_bloc`'s widgets (BlocBuilder, BlocProvider, etc.) internally using `InheritedWidget`, similar to how the Provider package also builds on InheritedWidget?