Skip to content

Upgrading flutter_bloc 4 to 5

Breaking4.0.1 → 5.0.1Breaking3Changed7Other8

BreakingUpgrade verdict

3 breaking changes.

  • If you use BlocBuilder with a condition to control rebuilds, rename that parameter to buildWhen.
  • If you use BlocListener with a condition to control when it reacts, rename that parameter to listenWhen.
  • This version requires bloc 5.0.0, which has its own breaking changes you may need to handle.
3 items need code or config changes
Breaking3
Renames the condition parameter on BlocBuilder to buildWhen.
BlocBuilderconditionbuildWhen
Renames the condition parameter on BlocListener to listenWhen.
BlocListenerconditionlistenWhen
Upgrades to bloc v5.0.0, which is a breaking dependency change.
bloc