DEV Community

Technology Insights
Technology Insights

Posted on • Originally published at

State Management using BLoC Pattern

Before starting with the Flutter tutorial, let's understand what BLoC is first.

What is BLoC

BLoC is known as Business Logic Components and the main aim of BLoC is to separate the Application’s business logic from the user interface. It makes the application code more scalable, testable and unambiguous.

Pros & Cons of BLoC Design Pattern

But, as you know everything has two sides. So, before moving further we will list down pros and cons of BLoC design pattern.

Pros of Using BLoC

  • Have well maintain documentation
  • Make development easy by separating Business logic from UI
  • Excellent testability for product
  • Easy to keep everything on track

Cons of Using BLoC

  • Need more focus to learn it
  • Not suitable for simple applications
  • More boilerplate code

Further we have discussed the following points with all the coding formulas in our blog post.

  • Understanding BLoC Concepts: Events and States
  • Creating an Event
  • Creating a State
  • Event and State Management using BLoC Pattern
    • Providing our BLoC
    • Triggering the Event and States
  • Testing the BLoC Design Pattern

If you want to explore and learn more about Flutter BLoC Tutorial, read our blogpost now.

Oldest comments (0)