openfoodfacts-dart icon indicating copy to clipboard operation
openfoodfacts-dart copied to clipboard

ProductImage size non-nullable?

Open WildOrangutan opened this issue 1 year ago • 1 comments

Why - Problem description

I'm looking at ProductImage class and wondering if size really has to be nullable, since there is also ImageSize.UNKNOWN.

I'm not the most familiar with how things work in Dart, but maybe this could be avoided, to simplify size handling code.

What - Proposed solution

Two options: A. Make size type ImageSize B. Remove ImageSize.UNKNOWN

WildOrangutan avatar Oct 12 '22 14:10 WildOrangutan

@WildOrangutan You're probably right, but here we're in the library, not in the app: if we change something, that may impact other apps. In addition to that, it's really not a priority. My suggestion: add a TODO in the code.

monsieurtanuki avatar Oct 13 '22 08:10 monsieurtanuki