Simplify code in thumbnail widget
This commit is contained in:
parent
83fc76f479
commit
31e3ac7251
1 changed files with 7 additions and 11 deletions
|
@ -59,17 +59,13 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
|
|||
_logger.warning("Could not load image: ", e);
|
||||
_encounteredErrorLoadingThumbnail = true;
|
||||
}).then((data) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
if (data != null) {
|
||||
final imageProvider = Image.memory(data).image;
|
||||
precacheImage(imageProvider, context).then((value) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_imageProvider = imageProvider;
|
||||
_hasLoadedThumbnail = true;
|
||||
});
|
||||
}
|
||||
if (data != null && mounted) {
|
||||
final imageProvider = Image.memory(data).image;
|
||||
precacheImage(imageProvider, context).then((value) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_imageProvider = imageProvider;
|
||||
_hasLoadedThumbnail = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue