rect is render size if return true, it will not paint original image,
rect
typedef BeforePaintImage = bool Function( Canvas canvas, Rect rect, ui.Image image, Paint paint);