tezvyn:

Classic BLoC with Streams and Sinks

intermediate

Classic BLoC separates UI from business logic by exposing inputs as Sinks and outputs as Streams. The widget pushes events into sinks, the BLoC processes them, and emits new state on streams that the UI rebuilds from, keeping logic testable and…

Classic BLoC, the Business Logic Component pattern, models a component as a black box: events flow in through Sinks and state flows out through Streams, with no Flutter widgets inside. The UI uses a StreamBuilder to react to emitted state and adds events via sinks. Because the logic is pure Dart over streams, it is highly testable and reusable across UI frameworks. This predates the flutter_bloc package, which later wrapped the same idea in a friendlier API.

Read the original → direct-llm://classicblocwithstreamsandsinks

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Classic BLoC with Streams and Sinks · Tezvyn