My image is unable to resize. Firstly I have put the background in the container widget. After that, I have put the logo image in the center widget using Image.assets. The main problem is that the size of the image is resizing according to the height and width. Currently, I am coding in the flutter framework using dart language.
I am doing coding in Android Studio.
@override
Widget build(BuildContext context) {
return new MaterialApp(
debugShowCheckedModeBanner: false,
home: new Scaffold(
body: new Stack(
children: <Widget>[
new Container(
decoration: new BoxDecoration(
image: new DecorationImage(
image: new AssetImage("assets/imgs/home_bg.png"),
fit: BoxFit.cover,
)
),
),
new Center(
child: Image.asset("assets/imgs/home_logo.png",height: 300,width:300,),
)
],
),
),
);
No error messages are showing. Then also the image is not resizing.
body: Center(
child: SizedBox(
width: 100.0,
height: 100.0,
child: Image.network(
"https://th.thgim.com/opinion/op-ed/article22695424.ece/alternates/FREE_300/9thscience"),
),
))
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