Skip to content

[101-103] New data and images #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 25, 2018
Merged

[101-103] New data and images #9

merged 6 commits into from
Apr 25, 2018

Conversation

willlarche
Copy link
Collaborator

New images and data. Is there no easier way to have the images added to my project? It's a lot in my pubspec

@HansMuller
Copy link
Collaborator

That's a lot of images. It might be tidier to put the images in their own package.

The Flutter Gallery example does this.

@willlarche
Copy link
Collaborator Author

Images moved to package. PTAL

Copy link
Collaborator

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

NICE. LGTM

@@ -29,7 +29,8 @@ class _HomePageState extends State<HomePage> {
new AspectRatio(
aspectRatio: 18 / 11,
child: new Image.asset(
'assets/${product.id}-1.jpg',
'${product.id}-0.jpg',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better encapsulation: product.assetName, product.assetPackage:

class Product {
  String get assetName => '$id-0.jpg';
  String get assetPackage => 'shrine_images';
  ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants