I have integrated zoom image logic on double tap here is full code
void _handleDoubleTap(Offset tapPosition) {
if (_isZoomed) {
_transformationController.value = Matrix4.identity();
_isZoomed = false;
} else {
final RenderBox renderBox = context.findRenderObject() as RenderBox;
final Size size = renderBox.size;
double zoomScale = 2.5;
double x = -(tapPosition.dx * (zoomScale - 1));
double y = -(tapPosition.dy * (zoomScale - 1));
// Ensure boundaries
x = x.clamp(-size.width, 0);
y = y.clamp(-size.height, 0);
_transformationController.value =
Matrix4.identity()
..translate(x, y)
..scale(zoomScale);
_isZoomed = true;
}
}
where i user Matrix4 params which are deprecated so i need solution for this can anyone help me with this?