Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add multiple packages in single command in flutter

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.

like image 557
Ariful Haque Avatar asked Feb 23 '26 04:02

Ariful Haque


1 Answers

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
like image 189
Alexander Dischberg Avatar answered Feb 26 '26 10:02

Alexander Dischberg