zoomTo method

void zoomTo(
  1. double target
)

Sets the zoom to an absolute target, clamped to [minZoom, maxZoom] by the Controller. A no-op when not isAttached.

The Controller only zooms multiplicatively (relative to the zoom captured by startZoom), so this asks it to scale from the current zoom to target; the clamp still applies. A current zoom of 0 (only reachable with a minZoom <= 0) has no defined scale to target, so it is left untouched.

Implementation

void zoomTo(double target) {
  final inner = _inner;
  if (inner == null) return;
  final current = inner.zoom;
  if (current <= 0) return;
  inner.startZoom();
  inner.updateZoom(target / current);
}