openfoodfacts-dart
openfoodfacts-dart copied to clipboard
ProductImage size non-nullable?
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 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.