diff --git a/lib/ui/tiles/post_tile.dart b/lib/ui/tiles/post_tile.dart index dee42fd..ed07df0 100644 --- a/lib/ui/tiles/post_tile.dart +++ b/lib/ui/tiles/post_tile.dart @@ -205,6 +205,7 @@ class _PostTileState extends State { url: widget.post.fileURL, allowFullScreen: true, roundedEdges: false, + loadingHeight: 150, ); } diff --git a/lib/ui/widgets/network_image_widget.dart b/lib/ui/widgets/network_image_widget.dart index d8278a0..2141c1e 100644 --- a/lib/ui/widgets/network_image_widget.dart +++ b/lib/ui/widgets/network_image_widget.dart @@ -14,6 +14,7 @@ class NetworkImageWidget extends StatelessWidget { final bool roundedEdges; final double width; final double height; + final double loadingHeight; const NetworkImageWidget({ Key key, @@ -22,10 +23,15 @@ class NetworkImageWidget extends StatelessWidget { this.width, this.height, this.roundedEdges = true, + this.loadingHeight, }) : assert(url != null), assert(allowFullScreen != null), super(key: key); + double get _loadingHeight => loadingHeight != null ? loadingHeight : height; + + double get _loadingWidth => width; + @override Widget build(BuildContext context) { return Material( @@ -41,16 +47,16 @@ class NetworkImageWidget extends StatelessWidget { height: height, fit: BoxFit.cover, placeholder: (c, s) => Container( - width: width, - height: height, + width: _loadingWidth, + height: _loadingHeight, color: Colors.lightBlueAccent, child: Center( child: CircularProgressIndicator(), ), ), errorWidget: (c, s, o) => Container( - width: width, - height: height, + width: _loadingWidth, + height: _loadingHeight, color: Colors.red, child: Center( child: Icon(