• Post category:Flutter
  • Reading time:2 mins read

Hello Folks! I am back with another fresh article on Flutter.

This time I will talk about using Bloc Pattern In Flutter and How to plan your Flutter ventures? With the goal that you can keep up, scale and test your Flutter extends without any problem.

Prior to jumping into the subject. I might want to share a little story on why we should concentrate on building a strong design of our tasks.

My biggest problem when getting into Flutter development was figuring out how to manage my code?

Native Android development splits UI code and Logic code between XML files and Java (or Kotlin) files respectively, but with Flutter it can all become a mess if you’re not careful.

After working over the years on Flutter, I have quite an experience on this subject and so, I have prepared a simple guide to help you architect your app in the best way possible that will help in future refactoring and readability.

Image for post

The BLOC Pattern: The above diagram shows how the data flows from UI then to the Data layer or even vice versa.

BLOC will never have any reference of the Widgets in the UI Screen. The UI screen will only observe changes coming from BLOC class.

Let’s have a small Q&A to understand this diagram:

1. What is a BLOC Pattern?

Its a state management system for Flutter recommended by Google developers. It helps in managing state and make access to data from a central place in your project.


2. Can I co-relate this architecture with any other architectures out there?

Yes of course. MVP and MVVM are some good examples. Only the thing that will change is: BLOC will be replaced with ViewModel in MVVM.


3. What is under the hood of BLOC ?

What is that core thing that manages the state in one place?

STREAMS or REACTIVE approach. In general terms, data will be flowing from the BLOC to the UI or from UI to the BLOC in the form of streams.

So guys, this was all about the Flutter ventures and use of Bloc Pattern.

If you want to know more on Flutter or even Python,PHP and WordPress, just feel free to log in to https://www.ideatebox.com and get to know more about the technical languages and their functionalities.

Leave a Reply