Poorgramer-Zack/dart-expert-skills / skills/bloc-signals
bloc-signals
VerifiedImplement, review, test, and migrate Dart and Flutter code that uses BlocSignal (bloc_signals, bloc_signals_flutter, bloc_signals_test), the BLoC-style API built on signals. Use this when the code imports package:bloc_signals, extends BlocSignal or CubitSignal, uses BlocSignalProvider, BlocSignalBuilder, BlocSignalListener, or context.select, or when the user asks how BlocSignal differs from flutter_bloc or wants to move from BLoC to synchronous signal-based state.
BlocSignal
BlocSignal keeps the BLoC event model (events in, state out) on top of Rody Davis's signals v7 primitives. Its updates are synchronous: emit changes state immediately, with no stream and no microtask. It is young and its API can change, so verify against the installed package source before editing code.
Start from the installed package
- Read the consumer project's
pubspec.yamlandpubspec.lockto find thebloc_signalsversion. - Check every type and member you plan to use against the installed source (
package:bloc_signals/...). Do not assume parity withpackage:blocor Riverpod. - Read the matching reference below, then make the smallest change that keeps behavior.
Route the task
- references/core.md:
BlocSignal,CubitSignal,on<E>,emit,createEffect, equality, andclose. - references/flutter.md:
BlocSignalProvider,BlocSignalBuilder,BlocSignalListener,BlocSignalConsumer,BlocSignalSelector, andcontext.value/state/select. - references/testing.md:
blocSignalTest, synchronous assertions, and widget tests. - references/migration-from-bloc.md: moving from
flutter_bloc/blocto BlocSignal, and the differences that break code.
Contracts to preserve
- Constructors take named
initialState:. Write: super(initialState: 0), not: super(0). emitis synchronous, and it skips a value equal to the current state.addreturnsvoid. Synchronous handlers finish beforeaddreturns.close()is idempotent, disposes effects created withcreateEffect, and drops events after closure.- Read raw values with
stateValue(orvalue) inside methods and handlers.statereturns aReadonlySignalfor reactive bindings. BlocSignalProvider(create:)is lazy by default and owns its bloc.BlocSignalProvider.valuedoes not own it.context.watch<T>()tracks provider replacement, not state changes. UseBlocSignalBuilderto rebuild on state.- Never create an
effectorcomputedinsidebuild. Give it an explicit owner and a disposal path. - A global
BlocSignalObserveris a single slot. Compose observers instead of replacing them.
Packages
bloc_signals: core (pure Dart).bloc_signals_flutter: Flutter providers, builders, listeners, selectors.bloc_signals_test:blocSignalTesthelpers.- Optional:
bloc_signals_lint,bloc_signals_hydrate,bloc_signals_replay,bloc_signals_riverpod,bloc_signals_devtools,bloc_signals_jaspr.
Validation
Run flutter analyze and the nearest tests. The examples in these references were compiled and tested against bloc_signals 1.7.0, bloc_signals_flutter 1.5.0, and bloc_signals_test 1.0.3.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |