1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 04:49:21 +00:00

Improve post image loading size

This commit is contained in:
Pierre HUBERT 2019-05-20 09:13:12 +02:00
parent 0bf85b478a
commit 073ddd8386
2 changed files with 11 additions and 4 deletions

View File

@ -205,6 +205,7 @@ class _PostTileState extends State<PostTile> {
url: widget.post.fileURL,
allowFullScreen: true,
roundedEdges: false,
loadingHeight: 150,
);
}

View File

@ -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(