dart pub add <package>

Add a dependency to pubspec.yaml

Arguments

NameDescription
packageDart pub package name

Options

NameDescription
-h, --helpPrint this usage information
-d, --devAdds package to the development dependencies instead
--git-urlGit URL of the package
--git-refGit branch or commit to be retrieved
--git-pathPath of git package in repository
--hosted-urlURL of package host server
--pathLocal path
--sdkSDK source for package
--offlineUse cached packages instead of accessing the network
--no-offlineDo not use cached packages instead of accessing the network
-n, --dry-runReport what dependencies would change but don't change any
--precompilePrecompile executables in immediate dependencies
--no-precompileDo not precompile executables in immediate dependencies