Open esDotDev opened 4 years ago
I think for the imageprovider it will be difficult to show the placeholder, so that will probably be an exception. The widget can show a placeholder when value is 'null', but than the imageprovider will behave different from the widget (placeholder vs error). I'm not fully sure if error of placeholder is better. If you know the image is 'null' than a placeholder is fine, but if you would have expected an image than an error makes more sense. I think quite some people actually also use the error widget as a placeholder.
According to documentation:
/// Widget displayed while the target [imageUrl] is loading.
final PlaceholderWidgetBuilder? placeholder;
There is also another one simliar:
/// Widget displayed while the target [imageUrl] is loading.
final ProgressIndicatorBuilder? progressIndicatorBuilder;
And finally:
/// Widget displayed while the target [imageUrl] failed loading.
final LoadingErrorWidgetBuilder? errorWidget;
So if imageUrl == null || imageUrl!.isEmpty
expected result should be errorWidget
In some cases, it would be nice to set the imageUrl to null, as we load in a new image.
For example:
As it stands now, you have to leave the old image in place, while the new one uploads, which looks a little janky. Ideally it would just elegantly handle a null url, and fade out the current image.