I use the following code to draw an image on the screen. I want to draw an overlay on top of this image. However, when the image height is larger, the boxfit reduces the image width. I cannot calculate the image top and left drawn position when this happens. The image width and height are still equal to screen size, but image width is drawn centered with gaps on both sides, which is clearly less than the screen size.
Is there a way to calculate the accurate size and top, left the position after the image has been bixfited.
return Image.memory(
imageBytes,
width: reqWidth,
height: reqHeight,
filterQuality: FilterQuality.high,
fit: BoxFit.fitHeight,
);