Suppose I have a list of packages which I want to add in my flutter project. I can do the job by simply adding those packages in pubspec.yaml
file and then in command line write this command flutter pub get
and get all those packages in my app. But If I want to do the same thing by command line how to do that?
Like to add a single package what we do is flutter pub add xxx
. What if I want to add multiple packages at the same time in project with a single command line. I have searched but did not get any clue.
Add multiple packages in single command in flutter
Asked Answered
Actually you can already do this using flutter pub add
For example i want to add dependecies for a project that use drift and riverpod, just run these two command instead of running separate pub add
for each package.
# app dependencies
flutter pub add drift sqlite3_flutter_libs path_provider path flutter_riverpod
# dev dependencies
flutter pub add --dev drift_dev build_runner
this is the answer for the above question, it should my marked as the answer. –
Brach
© 2022 - 2025 — McMap. All rights reserved.
flutter pub add xxx && flutter pub add yyy && flutter pub add zzz
tell me if it's a valid solution for you – Ssw