Skip to content
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

fix: ImageHelper - new methods with ImageSize parameters + minor fix #572

Merged
merged 2 commits into from
Oct 12, 2022

Conversation

monsieurtanuki
Copy link
Contributor

Impacted file:

  • ImageHelper.dart: added flexibility and ImageSize parametered methods; fixed a minor bug (trailing slash)

What

  • Refactoring around ImageHelper

Part of

Impacted file:
* `ImageHelper.dart`: added flexibility and `ImageSize` parametered methods; fixed a minor bug (trailing slash)
@WildOrangutan
Copy link

Would it be possible to shorten function naming a bit. Some are getting overly verbose imho.

I suggest making imageSize as optional argument(s) and taking it from ProductImage if not set.

Impacted file:
* `ImageHelper.dart`: added optional parameters instead of methods.
@monsieurtanuki
Copy link
Contributor Author

Would it be possible to shorten function naming a bit. Some are getting overly verbose imho.
I suggest making imageSize as optional argument(s) and taking it from ProductImage if not set.

Sounds reasonable.

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @monsieurtanuki

@@ -27,23 +27,31 @@ class ImageHelper {
}
}

/// Returns the product image full url, or null if [barcode] is null
/// Returns the [image] full url - for a specific [imageSize] if needed.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// Returns the [image] full url - for a specific [imageSize] if needed.
/// Returns the image full url as [String] - for a specific [imageSize] if needed.


/// Returns the product image filename
/// Returns the [image] filename - for a specific [imageSize] if needed.
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@monsieurtanuki monsieurtanuki merged commit 24ec991 into openfoodfacts:master Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants