diff --git a/lib/models/post.dart b/lib/models/post.dart index 9f23ca8..2223785 100644 --- a/lib/models/post.dart +++ b/lib/models/post.dart @@ -74,6 +74,8 @@ class Post implements LikeElement { bool get canUpdate => access == UserAccessLevels.FULL; + bool get hasLinkImage => linkImage != null; + bool get canDelete => access == UserAccessLevels.FULL || access == UserAccessLevels.INTERMEDIATE; diff --git a/lib/ui/tiles/post_tile.dart b/lib/ui/tiles/post_tile.dart index 338101b..18b85a9 100644 --- a/lib/ui/tiles/post_tile.dart +++ b/lib/ui/tiles/post_tile.dart @@ -263,11 +263,16 @@ class _PostTileState extends State { children: [ Padding( padding: const EdgeInsets.only(right: 8.0), - child: NetworkImageWidget( - url: widget.post.linkImage, - width: 70, - roundedEdges: false, - ), + child: widget.post.hasLinkImage + ? NetworkImageWidget( + url: widget.post.linkImage, + width: 70, + roundedEdges: false, + ) + : Icon( + Icons.link, + size: 70, + ), ), Flexible( child: Column(