When you install a package from pub.dev, the process is very simple. For this example, we will install the http package, and connect to a Git repository:
- Create a new Flutter project, called plugins.
- Go to https://pub.dev.
- In the search box, type http.
- Click on the http package on the results page.
- From the http package's home page, click on the Installing button.
- Copy the dependencies version in the Depend on it section at the top of the page.
- Open the pubspec.yaml file in your project.
- Paste the http dependency into the dependencies section of your pubspec.yaml file. Your dependencies should look like the following code (the http version number may be different by the time you read this). Make sure that the alignment is precisely as shown here, where http is exactly under flutter:
dependencies:
flutter:
sdk: flutter
http: ^0.13.1
- To download the package, the actions depend on your system. In the Terminal, type flutter pub get. This will initiate...