Implementing BLoC States

Learn how to create state classes using the flutter_bloc library.

To start creating the likes_bloc, we first need to add the flutter_bloc package to our application. This can be done by adding the following line under the dependencies in the pubspec.yaml file:

Press + to interact
dependencies:
# ...
flutter_bloc: ^8.1.2

This will give us all the classes we need to implement our BLoC pattern using the flutter_bloc library.

In this lesson, we’ll focus on implementing the likes state. This state will be emitted to the UI ...