Is there any way to show fullscreen image ?
var imagejadwal = new Image.network( "https://firebasestorage.googleapis.com/v0/b/c-smp-bruder.appspot.com/o/fotojadwal.jpg?alt=media&token=b35b74df-eb40-4978-8039-2f1ff2565a57", fit: BoxFit.cover ); return new Scaffold( appBar: new AppBar( title: new Text(widget.title), ), body: new Center( child: imagejadwal ), );
in that code, there's space around the image :/
Your problem is that Center
will make the image to get it's preferred size instead of the full size. The correct approach would be instead to force the image to expand.
return new Scaffold( body: new Image.network( "https://cdn.pixabay.com/photo/2017/02/21/21/13/unicorn-2087450_1280.png", fit: BoxFit.cover, height: double.infinity, width: double.infinity, alignment: Alignment.center, ), );
The alignment: Alignment.center
is unnecessary. But since you used the Center
widget, I tought it would be interesting to know how to customize it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With