setZoomRatio method

Future<void> setZoomRatio({
  1. required double zoomRatio,
  2. Offset? center,
  3. Duration duration = const Duration(milliseconds: 200),
})

Set zoom ratio.

center specifies the center of the zoom operation in widget's local coordinates. e.g. tap-position in the widget; most likely to ScaleStartDetails.localFocalPoint.

Implementation

Future<void> setZoomRatio({
  required double zoomRatio,
  Offset? center,
  Duration duration = const Duration(milliseconds: 200),
}) =>
    _state!._goTo(
      destination: zoomMatrix(zoomRatio, center: center),
      duration: duration,
    );