targetOf static method

CenterZoom? targetOf(
  1. BuildContext context
)

Finds the target center zoom of the surrounding CenterZoomMap widget.

The returned value represents the target center zoom given the widget's bounds and focusedPoint. It does not change as the user zooms in and out of the map.

Unlike CenterZoomMapState.getWidgetCenterZoom, this creates a dependency on the widget's center zoom. Any consumers will rebuild if the widget center zoom changes.

Implementation

static CenterZoom? targetOf(BuildContext context) => context
    .dependOnInheritedWidgetOfExactType<_InheritedTargetCenterZoom>()
    ?.target;