isDynamicHeight property

bool isDynamicHeight
final

Display dynamic height image, this must be enabled if you want to display dynamic height images to avoid UI jumping.

The width argument should be specified to determine the dynamic image height, this value should be smaller than the device\widget width otherwise you could end up with a white vertical space around the image.

prefer to use MediaQuery size if you want to use dynamic width

isDynamicSize: true,
width: MediaQuery.of(context).size.width * 0.4,

Implementation

final bool isDynamicHeight;