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.
Asked
Active
Viewed 2,270 times
9

Ariful Haque
- 183
- 1
- 9
-
1You can use && to combine multiple single commands like: `flutter pub add xxx && flutter pub add yyy && flutter pub add zzz` tell me if it's a valid solution for you – Alex Rintt Nov 01 '21 at 19:11
1 Answers
8
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

Alexander Dischberg
- 1,890
- 2
- 13
- 26
-
this is the answer for the above question, it should my marked as the answer. – Abdullah Bahattab Jul 25 '22 at 11:36