zoomTo method
Instantly sets the zoom transformation to a specific offset
and scale
.
If offset
is null, Offset.zero is used. If scale
is null, 1.0 is
used.
This method bypasses animation and immediately updates the view.
Implementation
void zoomTo({Offset? offset, double? scale}) {
final effectiveOffset = offset ?? Offset.zero;
final effectiveScale = scale ?? 1.0;
_transformCtrl.value = Matrix4.identity()
..translate(effectiveOffset.dx, effectiveOffset.dy)
..scale(effectiveScale);
}