Skip to content

Conversation

@szakarias
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes Contributor has signed the Contributor License Agreement label Sep 6, 2017
- packages/fancy_backgrounds/backgrounds/background1.png
```

Note that the `lib/` is implied, so it should not be included in the asset path.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid empty prose like "Note that", you can just start with "The".

@Hixie
Copy link
Contributor

Hixie commented Sep 6, 2017

LGTM

@Hixie
Copy link
Contributor

Hixie commented Sep 6, 2017

@LarkAscending may wish to review also.

@szakarias
Copy link
Contributor Author

Fixes flutter/flutter#9249

Copy link
Member

@mit-mit mit-mit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nits, otherwise looks great!


### 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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe link package to https://flutter.io/using-packages/ which has a short intro to what packages are?


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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add 'in its pubspec.yaml' after 'which ones to include' ?

* .../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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma after 'say'

@szakarias szakarias merged commit a47719d into flutter:master Sep 8, 2017
mit-mit added a commit to flutter/flutter that referenced this pull request Sep 11, 2017
mit-mit added a commit to flutter/flutter that referenced this pull request Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Contributor has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants