Automatic way
Run either of the following commands in the terminal ( inside your project directory) to add the package to your project.
dart pub add package_name
or
flutter pub add package_name
Manual way
- go to pub.dev
- search your package
- go to installing tab and copy the package name and version under dependencies
- open
pubspec.yaml
file present in root directory - paste it under dependencies.(be careful about the indentation)
- save and your ide will download the package in the project.
- go to the dart file where you want to use it and import at the top
That's it. Now you can use the package however you like.
Top comments (1)
I really like it! if you are interested in this topic, then check this article - dev.to/pablonax/free-flutter-templ...