Document use of asset images in package dependencies.#663
Merged
szakarias merged 4 commits intoflutter:masterfrom Sep 8, 2017
Merged
Document use of asset images in package dependencies.#663szakarias merged 4 commits intoflutter:masterfrom
szakarias merged 4 commits intoflutter:masterfrom
Conversation
Hixie
reviewed
Sep 6, 2017
assets-and-images.md
Outdated
| - packages/fancy_backgrounds/backgrounds/background1.png | ||
| ``` | ||
|
|
||
| Note that the `lib/` is implied, so it should not be included in the asset path. |
Contributor
There was a problem hiding this comment.
Avoid empty prose like "Note that", you can just start with "The".
Contributor
Contributor
|
@LarkAscending may wish to review also. |
Contributor
Author
|
Fixes flutter/flutter#9249 |
mit-mit
reviewed
Sep 7, 2017
Member
mit-mit
left a comment
There was a problem hiding this comment.
Few nits, otherwise looks great!
assets-and-images.md
Outdated
|
|
||
| ### Asset images in package dependencies | ||
|
|
||
| To load an image from a package dependency, the `package` argument must be provided to [`AssetImage`](https://docs.flutter.io/flutter/services/AssetImage-class.html). |
Member
There was a problem hiding this comment.
Maybe link package to https://flutter.io/using-packages/ which has a short intro to what packages are?
assets-and-images.md
Outdated
|
|
||
| If the desired asset is specified in the `pubspec.yaml` file of the package, it is bundled automatically with the application. In particular, assets used by the package itself must be specified in its `pubspec.yaml`. | ||
|
|
||
| A package can also choose to have assets in its `lib/` folder that are not specified in its `pubspec.yaml` file. In this case, for those images to be bundled, the application has to specify which ones to include. For instance, a package named `fancy_backgrounds` could have the following files: |
Member
There was a problem hiding this comment.
Maybe add 'in its pubspec.yaml' after 'which ones to include' ?
assets-and-images.md
Outdated
| * .../lib/backgrounds/background2.png | ||
| * .../lib/backgrounds/background3.png | ||
|
|
||
| To include, say the first image, the `pubspec.yaml` of the application should specify it in the `assets` section: |
mit-mit
added a commit
to flutter/flutter
that referenced
this pull request
Sep 11, 2017
Update to reflect #11751 and flutter/website#663
mit-mit
added a commit
to flutter/flutter
that referenced
this pull request
Sep 12, 2017
Update to reflect #11751 and flutter/website#663
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.