latLngBounds property Null safety

MapLatLngBounds? latLngBounds

Specifies the current latlng bounds of the maps. The maps zoom level and focalLatLng get updated based on the given bounds.

For dynamic changes, the bounds value get updated with an animation.If both latLngBounds and MapTileLayer.initialLatLngBounds or MapShapeLayer.initialLatLngBounds are given, considered latLngBounds values as load time value.


MapLatLngBounds? get latLngBounds => _latLngBounds;
void latLngBounds=(MapLatLngBounds? value)


set latLngBounds(MapLatLngBounds? value) {
  if (_latLngBounds == value) {

  _latLngBounds = value;
  if (_controller != null) {
    zoomLevel = getZoomLevel(_latLngBounds!, _controller!.layerType!,
            renderBox.size, _controller!.shapeLayerSizeFactor / zoomLevel)
        .clamp(minZoomLevel, maxZoomLevel);
    focalLatLng = getFocalLatLng(_latLngBounds!);