Member-only story

Flutter: A very brief explanation of BLoC and Streams.

BLoC stands for Business Logic Component.

Tiya Chows
3 min readFeb 26, 2020

--

Model View Controller (MVC) is a popular design pattern amongst developers across the community. However, as it is incompatible with the nature of Flutter, so BLoC was created.

BLoC, stands for Business Logic Component, like other design patterns, is used to manage state using streams and sinks. BLoC acts as a middle layer between source of data (e.g db, api call) and UI widgets that need that data.

The BLoC will receive a stream of data from source, apply any transformation/business logic required and then publishes streams of changed data to widgets listening to the stream.

BLoC Pattern https://medium.com/flutterpub/architecting-your-flutter-project-bd04e144a8f1

BLoC is baked into the flutter framework, so “sinks” and “streams” are provided by the inbuilt “stream controller”. Streams of events/data are added into a sink and those listening to the stream automagically receive updates.

Streams

--

--

Tiya Chows
Tiya Chows

Written by Tiya Chows

Software Engineer @GoldmanSachs. I write technical articles about building software, but short stories and poetry feed my soul.

No responses yet