Setting up Workspace

Adding linters, Adding Dependency

Adding dependencies

On the main project folder go to pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  bloc: ^6.1.1

pubspec.yaml is used to maintain dependencies on the flutter project.

Once you added the package run the following command to install the package in your project.

$ flutter pub get

Once install the package make sure to restart the project. Because the flutter hot-reload can't access the package unless it restarts.

Last updated