I\'m trying to do something similar to centerCrop property from android ImageView. Setting the height of the imageview, and making it crop and align to center, just as centerCro
Please add this following width and height to the image
Note: We are zooming the image
height: double.infinity,
width: double.infinity,`
Android ScaleType and BoxFit should match like this:
So you should use Cover to achieve the CENTER_CROP result.
EDIT:
The problem should be crossAxisAlignment of the Column widget. Setting this property to crossAxisAlignment: CrossAxisAlignment.stretch should fix your issue.
new Center(
child: Container(
child: new Stack(
children: <Widget>[
new Image.asset(
'assets/images/firebase1.png',
width: 100.0,
height: 100.0,
),
],
),
),
),
new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Expanded(child: new Image.network(
cover.img,fit: BoxFit.fitWidth,
),
),
Text(cover.name),
]
)
this works for me