Add a getter for the thumbnail URL

This commit is contained in:
Vishnu Mohandas 2020-05-27 19:50:52 +05:30
parent 1e336897d4
commit 6990faa451
2 changed files with 8 additions and 6 deletions

View file

@ -71,6 +71,10 @@ class Photo {
return Configuration.instance.getHttpEndpoint() + "/" + remotePath;
}
String getThumbnailUrl() {
return Configuration.instance.getHttpEndpoint() + "/" + thumbnailPath;
}
Future<Uint8List> getOriginalBytes() {
return getAsset().originBytes;
}

View file

@ -89,12 +89,10 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
}
void _loadNetworkImage() {
final path = widget.photo.thumbnailPath.isNotEmpty
? widget.photo.thumbnailPath
: widget.photo.remotePath;
_imageProvider =
Image.network(Configuration.instance.getHttpEndpoint() + "/" + path)
.image;
final url = widget.photo.thumbnailPath.isNotEmpty
? widget.photo.getThumbnailUrl()
: widget.photo.getRemoteUrl();
_imageProvider = Image.network(url).image;
}
@override