@@ -103,24 +103,25 @@ $ dart pub add [options] [{dev|override}:]<package>[:descriptor] [[{dev|override
103103` ` `
104104
105105The syntax reflects how dependencies are written in `pubspec.yaml`.
106+ Follow the same format including spaces.
106107
107108` ` ` plaintext
108- ' <package>:{" <source>":" <descriptor>"[," <source>":" <descriptor>"]," version":" <constraint>"}'
109+ " <package>:{<source>: <descriptor>[, <source>: <descriptor>], version: <constraint>}"
109110` ` `
110111
111112# ## `git`
112113
113114Adds a [git dependency](/tools/pub/dependencies#git-packages).
114115
115116` ` ` console
116- $ dart pub add ' foo:{" git":" https://github.com/foo/foo"}'
117+ $ dart pub add " foo:{git: https://github.com/foo/foo}"
117118` ` `
118119
119120You can specify the repository, and the branch or commit, or exact location,
120121within that repository :
121122
122123` ` ` console
123- $ dart pub add ' foo:{" git":{" url":" ../foo.git"," ref":" branch"," path":" subdir"}}'
124+ $ dart pub add " foo:{git:{ url: ../foo.git, ref: branch, path: subdir}}"
124125` ` `
125126
126127# ### `url`
@@ -155,7 +156,7 @@ Adds a [hosted dependency][] that depends on
155156the package server at the specified URL.
156157
157158` ` ` console
158- $ dart pub add ' foo:{" hosted":" my-pub.dev"}'
159+ $ dart pub add " foo:{hosted: my-pub.dev}"
159160` ` `
160161
161162_Previously the `--hosted-url=<package_server_url>` option_.
@@ -167,7 +168,7 @@ _Previously the `--hosted-url=<package_server_url>` option_.
167168Adds a [path dependency][] on a locally stored package.
168169
169170` ` ` console
170- $ dart pub add ' foo:{" path":" ../foo"}'
171+ $ dart pub add " foo:{path: ../foo}"
171172` ` `
172173
173174_Previously the `--path=<directory_path>` option_.
@@ -179,7 +180,7 @@ _Previously the `--path=<directory_path>` option_.
179180Adds a package from the specified SDK source.
180181
181182` ` ` console
182- $ dart pub add ' foo:{" sdk":" flutter"}'
183+ $ dart pub add " foo:{sdk: flutter}"
183184` ` `
184185
185186_Previously the `--sdk=<sdk_name>` option_ :
0 commit comments