Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsIn BlocSignal’s Flutter bindings, use context.value<B, S>() when the current widget’s build needs the raw state and should respond to emissions. Use context.state<B, S>() when you need the underlying ReadonlySignal<S> for reactive composition; looking it up does not, by itself, register the calling widget element to rebuild on every state emission. These are extensions from bloc_signals_flutter, not methods built into Flutter’s BuildContext.
What each method returns
The names distinguish two forms of the same state. context.value<B, S>() returns the current state as a plain S. context.state<B, S>() returns a ReadonlySignal<S>, preserving the reactive signal rather than unwrapping its current value. The BlocSignal Flutter API documentation shows both patterns: bloc_signals_flutter API documentation.
As an Amazon Associate I earn from qualifying purchases.
| Call | Returns | Use it when | Widget-element behavior |
|---|---|---|---|
context.value<B, S>() |
Current raw state, type S |
The widget’s build reads the state and should reflect its emissions | The calling element registers a state dependency and rebuilds for emissions |
context.state<B, S>() |
Underlying ReadonlySignal<S> |
You want to compose the signal with reactive constructs such as computed() or effect() |
The lookup itself does not register an element rebuild dependency |
Here, B is the BlocSignal type and S is its state type. The context extensions provide access to state associated with the widget’s context; they do not change the state’s type or turn a raw value into a signal.
Free tools Windows power users keep installed
One-click scans. No signup required.
When to use context.value
Use context.value when the build method directly displays or otherwise uses the current state. The calling widget element then responds to state emissions, so its next build can produce output from the updated value.
#1 Best Overall
final count = context.value<CounterCubit, int>();
return Text('Count: $count');
This is the straightforward choice for a widget whose own rendered output depends on the current value. It is not a general-purpose promise that a particular application architecture will rebuild only one widget or perform better: the package documentation establishes the subscription behavior of the extension, not comparative performance across app designs.
When to use context.state
Use context.state when a downstream reactive construct should consume the signal. Getting the signal does not subscribe the calling widget element for rebuilds; the reactive computation or effect is where the signal is used.
Rank #2
final counterSignal = context.state<CounterCubit, int>();
final isEven = computed(() => counterSignal.value.isEven);
In this example, counterSignal remains a signal, and computed() derives a value from it. The reactive consumer is responsible for responding to changes. Simply obtaining the signal in a widget does not make that widget rebuild on every state emission.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Why provide both names?
The pair makes the consumer’s intent visible at the call site: value asks for the unwrapped state, while state asks for the signal. That distinction matches the container-level naming. The bloc_signals 1.4.0 changelog records container.value as an alias for container.stateValue, aligning it with container.state and the Flutter context extensions: bloc_signals changelog.
The bloc_signals_flutter changelog records the addition of both context APIs in version 1.3.0. Its entry describes context.state<T, S>() as looking up the underlying ReadonlySignal<S> without registering an element rebuild dependency, for composition with computed() or effect(). The package API documentation showed version 1.3.2 when reviewed; check the package’s current documentation and compatibility requirements when choosing a dependency version: bloc_signals_flutter changelog.
Choosing for a widget tree
Make the choice according to where the state should be consumed, not merely which name looks shorter:
Rank #4
- Choose
context.valuewhen the current element’s build output directly depends on the raw state. - Choose
context.statewhen you need to pass a signal into a reactive computation or effect and want that downstream consumer to handle changes.
Keeping a state-dependent read close to the widget that renders it can make rebuild intent easier to see. BlocSignal’s article also illustrates using Flutter’s Builder to scope a read to a nested element and composing signals from multiple containers. Those are architectural examples, not evidence of a quantified speedup or a universal guarantee about which elements rebuild; validate behavior against the BlocSignal and Flutter versions used by your application.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




